Skip to content

Commit 984f242

Browse files
authored
Merge pull request #3962 from jsiirola/parmest-test-guards
Testing: add missing Ipopt guards (parmest); add GHA nosolvers test
2 parents 251c6c9 + a102e94 commit 984f242

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

.github/workflows/test_branches.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,11 @@ jobs:
150150
- os: ubuntu-latest
151151
python: '3.10'
152152
other: /slim
153-
slim: 1
153+
slim: 2
154154
TARGET: linux
155155
PYENV: pip
156156

157+
157158
steps:
158159
- name: Checkout Pyomo source
159160
uses: actions/checkout@v6
@@ -168,7 +169,7 @@ jobs:
168169
echo "GHA_JOBGROUP=other" >> $GITHUB_ENV
169170
fi
170171
EXTRAS=tests
171-
if test -z "${{matrix.slim}}"; then
172+
if test -z "${{matrix.slim}}" -o "${{matrix.slim}}" = 1; then
172173
EXTRAS="$EXTRAS,docs,optional"
173174
fi
174175
echo "EXTRAS=$EXTRAS" >> $GITHUB_ENV

.github/workflows/test_pr_and_main.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ jobs:
161161
- os: ubuntu-latest
162162
python: '3.10'
163163
other: /slim
164+
slim: 2
165+
TARGET: linux
166+
PYENV: pip
167+
168+
- os: ubuntu-latest
169+
python: 3.13
170+
other: /nosolvers
164171
slim: 1
165172
TARGET: linux
166173
PYENV: pip
@@ -215,7 +222,7 @@ jobs:
215222
echo "GHA_JOBGROUP=other" >> $GITHUB_ENV
216223
fi
217224
EXTRAS=tests
218-
if test -z "${{matrix.slim}}"; then
225+
if test -z "${{matrix.slim}}" -o "${{matrix.slim}}" = 1; then
219226
EXTRAS="$EXTRAS,docs,optional"
220227
fi
221228
echo "EXTRAS=$EXTRAS" >> $GITHUB_ENV

pyomo/contrib/parmest/tests/test_parmest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,7 @@ def test_l2_objective_value_matches_manual_quadratic(self):
15391539

15401540
self.assertAlmostEqual(pyo.value(expr), expected)
15411541

1542+
@unittest.skipUnless(ipopt_available, "Test requires ipopt")
15421543
def test_l2_penalty_not_double_counted_across_scenarios(self):
15431544
# Confirms regularization is applied once at the estimator level,
15441545
# not once per scenario.
@@ -1591,6 +1592,7 @@ def test_user_specified_unsupported_regularization_raises(self):
15911592
exp_list, obj_function="SSE", regularization=lambda m: m.theta0**2
15921593
)
15931594

1595+
@unittest.skipUnless(ipopt_available, "Test requires ipopt")
15941596
def test_l2_lambda_zero_matches_unregularized_objective(self):
15951597
exp_list = [self.LinearExperiment(1.0, 1.0), self.LinearExperiment(2.0, 2.0)]
15961598
prior_fim = pd.DataFrame(
@@ -1615,6 +1617,7 @@ def test_l2_lambda_zero_matches_unregularized_objective(self):
16151617
obj_l2_zero = self._obj_at_theta(pest_l2_zero, theta0, theta1)
16161618
self.assertAlmostEqual(obj_l2_zero, obj_base)
16171619

1620+
@unittest.skipUnless(ipopt_available, "Test requires ipopt")
16181621
def test_prior_subset_penalizes_only_selected_parameter(self):
16191622
# Prior indexed only by theta1 should leave theta0 unpenalized.
16201623
exp_list = [self.LinearExperiment(1.0, 1.0)]
@@ -1976,6 +1979,7 @@ def test_l2_weighted_objective_applies_half_regularization_factor(self):
19761979

19771980
self.assertAlmostEqual(pyo.value(expr), expected)
19781981

1982+
@unittest.skipUnless(ipopt_available, "Test requires ipopt")
19791983
def test_indexed_unknown_parameters_regularization_uses_scalar_theta_names(self):
19801984
exp_list = [IndexedThetaExperiment(2.0, 5.0)]
19811985
prior_fim = pd.DataFrame(

0 commit comments

Comments
 (0)