diff --git a/pipt/loop/assimilation.py b/pipt/loop/assimilation.py index be9272b6..305f9a8a 100644 --- a/pipt/loop/assimilation.py +++ b/pipt/loop/assimilation.py @@ -536,12 +536,12 @@ def post_process_forecast(self): self.ensemble.pred_data[i][k] = np.zeros( (len(self.ensemble.obs_data[i][k]), self.ensemble.ne)) for m in range(pred_data_tmp[i][k].shape[1]): - data_array = self.ensemble.compress(pred_data_tmp[i][k][:, m], vintage, + data_array = self.ensemble.compress_manager(pred_data_tmp[i][k][:, m], vintage, self.ensemble.sparse_info['use_ensemble']) self.ensemble.pred_data[i][k][:, m] = data_array vintage = vintage + 1 if self.ensemble.sparse_info['use_ensemble']: - self.ensemble.compress() + self.ensemble.compress_manager() self.ensemble.sparse_info['use_ensemble'] = None # Extra option debug diff --git a/pipt/loop/ensemble.py b/pipt/loop/ensemble.py index b986a76e..1d997a15 100644 --- a/pipt/loop/ensemble.py +++ b/pipt/loop/ensemble.py @@ -287,7 +287,7 @@ def _org_obs_data(self): if self.sparse_info is not None and \ vintage < len(self.sparse_info['mask']) and \ len(data_array) == int(np.sum(self.sparse_info['mask'][vintage])): - data_array = self.compress(data_array, vintage, False) + data_array = self.compress_manager(data_array, vintage, False) vintage = vintage + 1 # Save array in obs_data. If it is an array with single value (not list), then we convert it to a @@ -321,7 +321,7 @@ def _org_obs_data(self): if self.sparse_info is not None and \ vintage < len(self.sparse_info['mask']) and \ len(data_array) == int(np.sum(self.sparse_info['mask'][vintage])): - data_array = self.compress(data_array, vintage, False) + data_array = self.compress_manager(data_array, vintage, False) vintage = vintage + 1 # Save array in obs_data. If it is an array with single value (not list), then we convert it to a @@ -645,7 +645,7 @@ def save_temp_state_ml(self, ind_save): self.temp_state[ind_save] = deepcopy(self.state) np.savez('temp_state_ml', self.temp_state) - def compress(self, data=None, vintage=0, aug_coeff=None): + def compress_manager(self, data=None, vintage=0, aug_coeff=None): """ Compress the input data using wavelets. diff --git a/pipt/misc_tools/extract_tools.py b/pipt/misc_tools/extract_tools.py index c59d2d52..622705d7 100644 --- a/pipt/misc_tools/extract_tools.py +++ b/pipt/misc_tools/extract_tools.py @@ -260,8 +260,8 @@ def organize_sparse_representation(info: Union[dict,list]) -> dict: # Redefine all 'yes' and 'no' values to bool for key, val in info.items(): - if val == 'yes': info[key] == True - if val == 'no': info[key] == False + if val == 'yes': info[key] = True + if val == 'no': info[key] = False # Intial dict sparse = {}