Skip to content

Commit

Permalink
Adding the extra argument for the tilemap write_map function (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
chervias authored Mar 4, 2025
1 parent 8ff22dd commit ce86081
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pixell/tilemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,10 +518,10 @@ def reduce(tile_map, comm, root=0):
active = active_distributed if comm.rank == root else []
return redistribute(tile_map, comm, active)

def write_map(fname, tile_map, comm):
def write_map(fname, tile_map, comm, extra={}):
"""Write a distributed tile_map to disk as a single enmap.
Collects all the data on a single task before writing."""
omap = reduce(tile_map, comm)
if comm.rank == 0:
omap = to_enmap(omap)
enmap.write_map(fname, omap, allow_modify=True)
enmap.write_map(fname, omap, allow_modify=True, extra=extra)

0 comments on commit ce86081

Please sign in to comment.