From 96eda3af057f4489687f0cd3c7cbcda2f099717c Mon Sep 17 00:00:00 2001 From: jdub Date: Tue, 31 Oct 2023 16:28:28 +1300 Subject: [PATCH 1/2] stripping off null chars from run stor info text --- pyemu/utils/helpers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyemu/utils/helpers.py b/pyemu/utils/helpers.py index 1153bfda..19b7ed76 100644 --- a/pyemu/utils/helpers.py +++ b/pyemu/utils/helpers.py @@ -1274,6 +1274,7 @@ def _read_run(irun): f.seek(run_start + (irun * run_size)) r_status = np.fromfile(f, dtype=np.int8, count=1) info_txt = struct.unpack("1001s", f.read(1001))[0].strip().lower().decode() + info_txt = info_txt.replace("\x00","") par_vals = np.fromfile(f, dtype=np.float64, count=len(par_names) + 1)[1:] obs_vals = np.fromfile(f, dtype=np.float64, count=len(obs_names) + 1)[:-1] par_df = pd.DataFrame({"parnme": par_names, "parval1": par_vals}) From 1385574e4fefa263e4a09e30c2993117594622b8 Mon Sep 17 00:00:00 2001 From: jdub Date: Tue, 31 Oct 2023 20:30:16 +1300 Subject: [PATCH 2/2] fix in sanity checks --- pyemu/pst/pst_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyemu/pst/pst_handler.py b/pyemu/pst/pst_handler.py index 57b73ca1..b49c3aeb 100644 --- a/pyemu/pst/pst_handler.py +++ b/pyemu/pst/pst_handler.py @@ -1635,8 +1635,8 @@ def sanity_checks(self, forgive=False): if self.tied is not None and len(self.tied) > 0: sadj = set(self.adj_par_names) spar = set(self.par_names) - - tpar_dict = self.parameter_data.partied.to_dict() + ptied = self.parameter_data.loc[self.parameter_data.loc[:,"partrans"]=="tied",:] + tpar_dict = ptied.partied.to_dict() for tpar, ptied in tpar_dict.items(): if pd.isna(ptied):