From 663b70c600a54ab1e01e1202511f1a4c87e54d5c Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Sun, 13 Apr 2025 11:47:13 -0500 Subject: [PATCH] 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. --- mpas_analysis/ocean/conservation.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mpas_analysis/ocean/conservation.py b/mpas_analysis/ocean/conservation.py index ecd251edf..50c915a65 100644 --- a/mpas_analysis/ocean/conservation.py +++ b/mpas_analysis/ocean/conservation.py @@ -769,6 +769,9 @@ def _compute_time_series_with_xarray(self, variable_list): unique_indices = sorted(unique_indices) # Ensure ascending order ds = ds.isel(Time=unique_indices) + # seeing hanging during saving. Let's try loading + ds.load() + if append: # Load the existing dataset and combine it with the new dataset self.logger.info( @@ -785,6 +788,9 @@ def _compute_time_series_with_xarray(self, variable_list): self.logger.info('Sorting by xtime...') ds = ds.sortby('xtime') + # again, seeing hanging during saving. Let's try loading + ds.load() + # Save the resulting dataset to the output file self.logger.info( f'Saving concatenated dataset to {self.outputFile}...')