Skip to content

Commit 679020a

Browse files
blnichojsiirola
andauthored
NFC: Apply suggestions from code review
Co-authored-by: John Siirola <[email protected]>
1 parent de9334e commit 679020a

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

pyomo/core/plugins/transform/lp_dual.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def _take_dual(self, model, std_form):
140140
# really expected here, so maybe we just scream? Or we leave
141141
# the constraint in the model as it is written...
142142
raise ValueError(
143-
f"The primal model contains a constraint that that the "
143+
f"The primal model contains a constraint that the "
144144
f"parameterization makes trivial: '{primal_cons.name}'"
145145
f"\nPlease deactivate it or declare it on another Block "
146146
f"before taking the dual."
@@ -172,6 +172,7 @@ def _take_dual(self, model, std_form):
172172

173173
domain = primal.domain
174174
lb, ub = domain.bounds()
175+
# Note: the following checks the domain for continuity and compactness:
175176
if not domain == RangeSet(*domain.bounds(), 0):
176177
raise ValueError(
177178
f"The domain of the primal variable '{primal.name}' "

pyomo/core/tests/unit/test_lp_dual.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def test_parameterization_makes_constraint_trivial(self):
408408
lp_dual = TransformationFactory('core.lp_dual')
409409
with self.assertRaisesRegex(
410410
ValueError,
411-
"The primal model contains a constraint that that the "
411+
"The primal model contains a constraint that the "
412412
"parameterization makes trivial: 'budgetish'"
413413
"\nPlease deactivate it or declare it on another Block "
414414
"before taking the dual.",

pyomo/repn/plugins/parameterized_standard_form.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def tocsr(self):
274274
# Fix the row index pointer by inserting 0 at the beginning. The
275275
# row_index_ptr currently holds pointers to 1 past the last element of
276276
# each row, which is really the starting index for the next
277-
# row. Inserting the 0 (the starting index for the firsst column)
277+
# row. Inserting the 0 (the starting index for the first column)
278278
# shifts everything by one column, "converting" the vector to the
279279
# starting indices of each row, and extending the vector length to
280280
# num_rows + 1 (as is expected by the CSR matrix).

0 commit comments

Comments
 (0)