Skip to content

Commit d9b111b

Browse files
author
arcticsnow
committed
clean memory
1 parent 6a45891 commit d9b111b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

TopoPyScale/topo_scale_zarr.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ def process_and_store_subset(self, subset_indices):
442442
encoding = {var: comp for var in result.data_vars}
443443
result.to_netcdf(self.output_path / self.meta.get('file_pattern').replace("*", str(subset_indices.get('point_id'))),
444444
engine='h5netcdf', encoding=encoding, mode='a')
445+
result = None
445446

446447
elif self.output_format.lower() == 'zarr':
447448
vars = list(result.keys())
@@ -454,6 +455,7 @@ def process_and_store_subset(self, subset_indices):
454455

455456
#else:
456457
result[self.varout].to_zarr(self.output_path / self.store_name, mode='a', zarr_format=3, region='auto')
458+
result=None
457459
else:
458460
raise ValueError('Only netcdf or zarr available')
459461
print(f"---> Point {subset_indices.get('point_id')} stored to {self.output_format.lower()}")

0 commit comments

Comments
 (0)