Skip to content

Commit ab30261

Browse files
committed
Update test_parmest.py
1 parent f760b8f commit ab30261

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pyomo/contrib/parmest/tests/test_parmest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@
3333
pynumero_ASL_available = AmplInterface.available()
3434
testdir = this_file_dir()
3535

36-
# Set the global seed for reproducibility
36+
# Set the global seed for random number generation in tests
3737
_RANDOM_SEED_FOR_TESTING = 524
38-
np.random.seed(_RANDOM_SEED_FOR_TESTING) # Set seed for reproducibility
3938

4039

4140
@unittest.skipIf(
@@ -49,6 +48,8 @@ def setUp(self):
4948
RooneyBieglerExperiment,
5049
)
5150

51+
np.random.seed(_RANDOM_SEED_FOR_TESTING) # Set seed for reproducibility
52+
5253
# Note, the data used in this test has been corrected to use
5354
# data.loc[5,'hour'] = 7 (instead of 6)
5455
data = pd.DataFrame(
@@ -347,6 +348,7 @@ def setUp(self):
347348
RooneyBieglerExperiment,
348349
)
349350

351+
np.random.seed(_RANDOM_SEED_FOR_TESTING) # Set seed for reproducibility
350352
self.data = pd.DataFrame(
351353
data=[[1, 8.3], [2, 10.3], [3, 19.0], [4, 16.0], [5, 15.6], [7, 19.8]],
352354
columns=["hour", "y"],
@@ -722,6 +724,8 @@ def ABC_model(data):
722724
cb_meas = data["cb"]
723725
cc_meas = data["cc"]
724726

727+
np.random.seed(_RANDOM_SEED_FOR_TESTING) # Set seed for reproducibility
728+
725729
if isinstance(data, pd.DataFrame):
726730
meas_t = data.index # time index
727731
else: # dictionary

0 commit comments

Comments
 (0)