Skip to content

Commit 61b916a

Browse files
committed
Merge remote-tracking branch 'myfork/sarah_api' into sarah_api
# Conflicts: # atlite/data.py
2 parents ff842cc + 23aae8c commit 61b916a

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

‎atlite/data.py‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -320,13 +320,15 @@ def cutout_prepare(
320320
write_job.compute(**dask_kwargs)
321321
else:
322322
write_job.compute(**dask_kwargs)
323-
if cutout.path.exists():
324-
cutout.data.close()
325-
cutout.path.unlink()
326-
Path(tmp).rename(cutout.path)
327-
328-
cutout.data = xr.open_dataset(cutout.path, chunks=cutout.chunks)
329-
del ds, write_job
323+
else:
324+
write_job.compute(**dask_kwargs)
325+
if cutout.path.exists():
326+
cutout.data.close()
327+
cutout.path.unlink()
328+
Path(tmp).rename(cutout.path)
329+
330+
cutout.data = xr.open_dataset(cutout.path, chunks=cutout.chunks)
331+
del ds, write_job
330332
finally:
331333
# Remove raw files that modules downloaded into tmpdir (e.g. SARAH API)
332334
for module in target.index.unique("module"):

0 commit comments

Comments
 (0)