Skip to content

Commit 3603b1e

Browse files
authored
Merge pull request #3965 from jsiirola/cplex-iis
Fix IIS interface for current CPLEX releases
2 parents 7fa8324 + 5643fb7 commit 3603b1e

3 files changed

Lines changed: 6 additions & 31 deletions

File tree

.github/workflows/test_branches.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -320,14 +320,7 @@ jobs:
320320
python -m pip install --cache-dir cache/pip pymysql || \
321321
python -m pip install --cache-dir cache/pip pymysql
322322
if test -z "${{matrix.slim}}"; then
323-
# Disallow cplex 22.1.2.1 because it errors fatally when
324-
# computing IIS on python 3.13 and 3.14
325-
if [[ ${{matrix.python}} =~ 3.1[34] ]]; then
326-
CPLEX='cplex!=22.1.2.1'
327-
else
328-
CPLEX='cplex'
329-
fi
330-
python -m pip install --cache-dir cache/pip "$CPLEX" docplex \
323+
python -m pip install --cache-dir cache/pip cplex docplex \
331324
|| echo "WARNING: CPLEX Community Edition is not available"
332325
python -m pip install --cache-dir cache/pip gurobipy \
333326
|| echo "WARNING: Gurobi is not available"
@@ -410,14 +403,8 @@ jobs:
410403
PYVER=$(echo "py${{matrix.python}}" | sed 's/\.//g')
411404
echo "Installing for $PYVER"
412405
#
413-
# Disallow cplex 22.1.2 and 22.1.2.1, as they error fatally when
414-
# computing IIS on Python 3.13 and 3.14
415406
# Disallow cplex 12.9 (caused segfaults in tests)
416-
if [[ ${{matrix.python}} =~ 3.1[34] ]]; then
417-
CPLEX='cplex>=12.10,<22.1.2|>22.1.2.1'
418-
else
419-
CPLEX='cplex>=12.10'
420-
fi
407+
CPLEX='cplex>=12.10'
421408
# xpress.init() (xpress 9.5.1 from conda) hangs indefinitely
422409
# on GHA/Windows under Python 3.10 and 3.11. Exclude that
423410
# release on that platform.

.github/workflows/test_pr_and_main.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -373,14 +373,7 @@ jobs:
373373
python -m pip install --cache-dir cache/pip pymysql || \
374374
python -m pip install --cache-dir cache/pip pymysql
375375
if test -z "${{matrix.slim}}"; then
376-
# Disallow cplex 22.1.2.1 because it errors fatally when
377-
# computing IIS on python 3.13 and 3.14
378-
if [[ ${{matrix.python}} =~ 3.1[34] ]]; then
379-
CPLEX='cplex!=22.1.2.1'
380-
else
381-
CPLEX='cplex'
382-
fi
383-
python -m pip install --cache-dir cache/pip "$CPLEX" docplex \
376+
python -m pip install --cache-dir cache/pip cplex docplex \
384377
|| echo "WARNING: CPLEX Community Edition is not available"
385378
python -m pip install --cache-dir cache/pip gurobipy \
386379
|| echo "WARNING: Gurobi is not available"
@@ -463,14 +456,8 @@ jobs:
463456
PYVER=$(echo "py${{matrix.python}}" | sed 's/\.//g')
464457
echo "Installing for $PYVER"
465458
#
466-
# Disallow cplex 22.1.2 and 22.1.2.1, as they error fatally when
467-
# computing IIS on Python 3.13 and 3.14
468459
# Disallow cplex 12.9 (caused segfaults in tests)
469-
if [[ ${{matrix.python}} =~ 3.1[34] ]]; then
470-
CPLEX='cplex>=12.10,<22.1.2|>22.1.2.1'
471-
else
472-
CPLEX='cplex>=12.10'
473-
fi
460+
CPLEX='cplex>=12.10'
474461
# xpress.init() (xpress 9.5.1 from conda) hangs indefinitely
475462
# on GHA/Windows under Python 3.10 and 3.11. Exclude that
476463
# release on that platform.

pyomo/contrib/iis/iis.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ def write(self, file_name):
104104

105105
class CplexConflict(_IISBase):
106106
def compute(self):
107-
self._solver._solver_model.conflict.refine()
107+
_conflict = self._solver._solver_model.conflict
108+
_conflict.refine(_conflict.all_constraints())
108109

109110
def write(self, file_name):
110111
self._solver._solver_model.conflict.write(file_name)

0 commit comments

Comments
 (0)