Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions fireatlas/FireConsts.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ def check_epsg(cls, epsg: int):
)
N_DASK_WORKERS: int = Field(6, description="How many dask workers to use for Run.")

DEPARALLELIZE_POSTPROCESS: bool = Field(
False, description="whether to avoid dask for postprocessing in case of worker memory errors"
)

DO_NIFC_MATCHING: bool = Field(
False,
description="If True, reads from the NIFC incident database for current "
Expand Down
7 changes: 4 additions & 3 deletions fireatlas/postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,11 @@ def merge_and_save_fire(data, fid):
futures = []
processed_gdfs = []
for fid, data in gdf[gdf["fireID"].isin(large_fires)].groupby("fireID"):
if client:
futures.append(client.submit(merge_and_save_fire, data, fid))
else:
if settings.DEPARALLELIZE_POSTPROCESS == True:
processed_gdfs.append(merge_and_save_fire(data, fid))
else:
futures.append(client.submit(merge_and_save_fire, data, fid))

if futures:
processed_gdfs = client.gather(futures)

Expand Down