Skip to content

Commit

Permalink
close datasets that are still open after writing
Browse files Browse the repository at this point in the history
  • Loading branch information
hans-permana committed Oct 10, 2017
1 parent 1f770b6 commit f25e499
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cablab/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ def update(self, provider: 'CubeSourceProvider'):
if var_name_to_image:
self._write_images(provider, datasets, (time_index, time_1, time_2), var_name_to_image)
time_1 = time_2
for key in datasets:
if datasets[key].isopen():
datasets[key].close()
provider.close()

def _write_images(self, provider, datasets, target_time, var_name_to_image):
Expand Down

0 comments on commit f25e499

Please sign in to comment.