Skip to content

Commit 663b70c

Browse files
committed
Fix hangs in ocean conservation
A recent change switched to using xarray to concatinate ocean conservation data together. However, recent testing showed hangs if the datasets are not manually loaded. This merge adds 2 places where such manual loads are included.
1 parent 0df26bc commit 663b70c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

mpas_analysis/ocean/conservation.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,9 @@ def _compute_time_series_with_xarray(self, variable_list):
769769
unique_indices = sorted(unique_indices) # Ensure ascending order
770770
ds = ds.isel(Time=unique_indices)
771771

772+
# seeing hanging during saving. Let's try loading
773+
ds.load()
774+
772775
if append:
773776
# Load the existing dataset and combine it with the new dataset
774777
self.logger.info(
@@ -785,6 +788,9 @@ def _compute_time_series_with_xarray(self, variable_list):
785788
self.logger.info('Sorting by xtime...')
786789
ds = ds.sortby('xtime')
787790

791+
# again, seeing hanging during saving. Let's try loading
792+
ds.load()
793+
788794
# Save the resulting dataset to the output file
789795
self.logger.info(
790796
f'Saving concatenated dataset to {self.outputFile}...')

0 commit comments

Comments
 (0)