Skip to content

Commit

Permalink
Remove dask and fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Jun 18, 2024
1 parent c67a05f commit 995ad7e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions isimip_qa/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ def open(self):
logger.info(f'open {self.path}')

try:
self.ds = xr.open_dataset(self.path, chunks={'time': 'auto'})
self.ds = xr.open_dataset(self.path)
except ValueError:
# workaround for non standard times (e.g. growing seasons)
self.ds = xr.open_dataset(self.path, chunks={'time': 'auto'}, decode_times=False)
self.ds = xr.open_dataset(self.path, decode_times=False)

if self.ds['time'].units.startswith('growing seasons'):
units = self.ds['time'].units.replace('growing seasons', 'common_years')
Expand All @@ -67,6 +67,7 @@ def open(self):
def close(self):
logger.info(f'close {self.path}')
self.ds.close()
del self.ds


class Region:
Expand Down

0 comments on commit 995ad7e

Please sign in to comment.