Skip to content

Commit

Permalink
Merge pull request #464 from jtwhite79/develop
Browse files Browse the repository at this point in the history
A couple little things
  • Loading branch information
jtwhite79 authored Oct 19, 2023
2 parents 3e7f96a + ce2a94c commit e687e1c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
13 changes: 10 additions & 3 deletions autotest/pst_from_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,14 @@ def mf6_freyberg_test(tmp_path):
assert rcov.sum().sum() > dsum

num_reals = 100
pe = pf.draw(num_reals, use_specsim=True)
pe = pf.draw(num_reals, use_specsim=False)
#pe = pe.copy()
pe.enforce()
lbnd = pst.parameter_data.parlbnd.to_dict()
for pname,lb in lbnd.items():
diff = pe.loc[:,pname].values - lb
print(pname,lb,diff.min())
assert diff.min() >= 0
pe.to_binary(Path(template_ws, "prior.jcb"))
assert pe.shape[1] == pst.npar_adj, "{0} vs {1}".format(pe.shape[1], pst.npar_adj)
assert pe.shape[0] == num_reals
Expand Down Expand Up @@ -5159,7 +5166,7 @@ def plot_thresh(m_d):
# invest()
#freyberg_test(os.path.abspath("."))
# freyberg_prior_build_test()
# mf6_freyberg_test()
mf6_freyberg_test(os.path.abspath("."))
#$mf6_freyberg_da_test()
#shortname_conversion_test()
#mf6_freyberg_shortnames_test()
Expand All @@ -5181,7 +5188,7 @@ def plot_thresh(m_d):
# tpf.test_add_list_parameters()
# # pstfrom_profile()
# mf6_freyberg_arr_obs_and_headerless_test()
usg_freyberg_test(".")
#usg_freyberg_test(".")
#vertex_grid_test()
#direct_quickfull_test()
#list_float_int_index_test()
Expand Down
6 changes: 3 additions & 3 deletions pyemu/utils/os_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ def run(cmd_str, cwd=".", verbose=False):
raise Exception("run() returned non-zero: {0}".format(ret_val))
else:
estat = os.WEXITSTATUS(ret_val)
if estat != 0:
raise Exception("run() returned non-zero: {0}".format(estat))

if estat != 0 or ret_val != 0:
raise Exception("run() returned non-zero: {0},{1}".format(estat,ret_val))

def _try_remove_existing(d, forgive=False):
try:
Expand Down
2 changes: 1 addition & 1 deletion pyemu/utils/pst_from.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ def draw(self, num_reals=100, sigma_range=6, use_specsim=False, scale_offset=Tru
else:
pe = pyemu.ParameterEnsemble(pst=self.pst, df=gr_par_pe)
self.logger.log("drawing realizations")
return pe
return pe.copy()

def build_pst(self, filename=None, update=False, version=1):
"""Build control file from i/o files in PstFrom object.
Expand Down

0 comments on commit e687e1c

Please sign in to comment.