Skip to content

Commit

Permalink
Avoid crash when writing matching results for zero halos
Browse files Browse the repository at this point in the history
  • Loading branch information
jchelly committed Nov 10, 2022
1 parent 5fa975a commit adaee56
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions match_vr_halos.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,9 @@ def consistent_match(match_index_12, match_index_21):

# Write the output
def write_output_field(name, data, description):
phdf5.collective_write(outfile, name, data, comm)
outfile[name].attrs["Description"] = description
dataset = phdf5.collective_write(outfile, name, data, comm)
dataset.attrs["Description"] = description

message("Writing output")
with h5py.File(args.output_file, "w", driver="mpio", comm=comm) as outfile:
# Write input parameters
Expand Down

0 comments on commit adaee56

Please sign in to comment.