Skip to content

Commit 8caea1c

Browse files
authored
Merge branch 'main' into main
2 parents 5aba506 + 926c91a commit 8caea1c

96 files changed

Lines changed: 3412 additions & 988 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test_branches.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ jobs:
354354
if test "${{matrix.TARGET}}" == linux; then
355355
EXCLUDE="casadi numdifftools $EXCLUDE"
356356
fi
357-
if [[ "${{matrix.TARGET}}" == win && "${{matrix.python}}" == "3.13" ]]; then
357+
if [[ "${{matrix.TARGET}}" == win && "${{matrix.python}}" == 3.13* ]]; then
358358
# As of Nov 7, 2024, qtconsole is not compatible with python 3.13 on win
359359
EXCLUDE="qtconsole $EXCLUDE"
360360
fi
@@ -379,7 +379,7 @@ jobs:
379379
fi
380380
# Note: this will fail the build if any installation fails (or
381381
# possibly if it outputs messages to stderr)
382-
conda install --update-deps -q -y $CONDA_DEPENDENCIES
382+
conda install --update-deps -q -y python="${{matrix.python}}" $CONDA_DEPENDENCIES
383383
if test -z "${{matrix.slim}}"; then
384384
# xpress.init() (xpress 9.5.1 from conda) hangs indefinitely
385385
# on GHA/Windows under Python 3.10 and 3.11. Exclude that
@@ -540,9 +540,8 @@ jobs:
540540
echo "DYLD_LIBRARY_PATH=${env:DYLD_LIBRARY_PATH}:$GAMS_DIR" `
541541
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
542542
$INSTALLER = "${env:DOWNLOAD_DIR}/gams_install.exe"
543-
# We are pinning to 29.1.0 because a license is required for
544-
# versions after this in order to run in demo mode.
545-
$URL = "https://d37drm4t2jghv5.cloudfront.net/distributions/29.1.0"
543+
# Demo licenses are included for 5mo from the newest release
544+
$URL = "https://d37drm4t2jghv5.cloudfront.net/distributions/50.1.0"
546545
if ( "${{matrix.TARGET}}" -eq "win" ) {
547546
$URL = "$URL/windows/windows_x64_64.exe"
548547
} elseif ( "${{matrix.TARGET}}" -eq "osx" ) {

.github/workflows/test_pr_and_main.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ jobs:
406406
if test "${{matrix.TARGET}}" == linux; then
407407
EXCLUDE="casadi numdifftools $EXCLUDE"
408408
fi
409-
if [[ "${{matrix.TARGET}}" == win && "${{matrix.python}}" == "3.13" ]]; then
409+
if [[ "${{matrix.TARGET}}" == win && "${{matrix.python}}" == 3.13* ]]; then
410410
# As of Nov 7, 2024, qtconsole is not compatible with python 3.13 on win
411411
EXCLUDE="qtconsole $EXCLUDE"
412412
fi
@@ -431,7 +431,7 @@ jobs:
431431
fi
432432
# Note: this will fail the build if any installation fails (or
433433
# possibly if it outputs messages to stderr)
434-
conda install --update-deps -q -y $CONDA_DEPENDENCIES
434+
conda install --update-deps -q -y python="${{matrix.python}}" $CONDA_DEPENDENCIES
435435
if test -z "${{matrix.slim}}"; then
436436
# xpress.init() (xpress 9.5.1 from conda) hangs indefinitely
437437
# on GHA/Windows under Python 3.10 and 3.11. Exclude that
@@ -592,9 +592,8 @@ jobs:
592592
echo "DYLD_LIBRARY_PATH=${env:DYLD_LIBRARY_PATH}:$GAMS_DIR" `
593593
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
594594
$INSTALLER = "${env:DOWNLOAD_DIR}/gams_install.exe"
595-
# We are pinning to 29.1.0 because a license is required for
596-
# versions after this in order to run in demo mode.
597-
$URL = "https://d37drm4t2jghv5.cloudfront.net/distributions/29.1.0"
595+
# Demo licenses are included for 5mo from the newest release
596+
$URL = "https://d37drm4t2jghv5.cloudfront.net/distributions/50.1.0"
598597
if ( "${{matrix.TARGET}}" -eq "win" ) {
599598
$URL = "$URL/windows/windows_x64_64.exe"
600599
} elseif ( "${{matrix.TARGET}}" -eq "osx" ) {

doc/OnlineDocs/_templates/recursive-base.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
# import everything from the module containing this class so that
88
# doctests for the class docstrings see the correct environment
99
from {{ module }} import *
10+
try:
11+
from {{ module }} import _autosummary_doctest_setup
12+
_autosummary_doctest_setup()
13+
except ImportError:
14+
pass
1015

1116
.. currentmodule:: {{ module }}
1217

doc/OnlineDocs/_templates/recursive-class.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
# import everything from the module containing this class so that
88
# doctests for the class docstrings see the correct environment
99
from {{ module }} import *
10+
try:
11+
from {{ module }} import _autosummary_doctest_setup
12+
_autosummary_doctest_setup()
13+
except ImportError:
14+
pass
1015

1116
.. currentmodule:: {{ module }}
1217

doc/OnlineDocs/_templates/recursive-enum.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
# import everything from the module containing this class so that
88
# doctests for the class docstrings see the correct environment
99
from {{ module }} import *
10+
try:
11+
from {{ module }} import _autosummary_doctest_setup
12+
_autosummary_doctest_setup()
13+
except ImportError:
14+
pass
1015

1116
.. currentmodule:: {{ module }}
1217

doc/OnlineDocs/_templates/recursive-module.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ Library Reference
55
{{ name | escape | underline}}
66
{% endif %}
77

8+
.. testsetup:: *
9+
10+
# import everything from the module containing this class so that
11+
# doctests for the class docstrings see the correct environment
12+
from {{ module }} import *
13+
try:
14+
from {{ module }} import _autosummary_doctest_setup
15+
_autosummary_doctest_setup()
16+
except ImportError:
17+
pass
18+
19+
.. currentmodule:: {{ module }}
20+
821
.. automodule:: {{ fullname }}
922
:undoc-members:
1023

doc/OnlineDocs/errors.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ Common Warnings/Errors
88
for backwards compatibility, DO NOT recycle old ID (no longer used)
99
numbers.
1010
11-
.. doctest::
12-
:hide:
11+
.. testsetup::
1312

14-
>>> import pyomo.environ as pyo
13+
import pyomo.environ as pyo
14+
# Ensure that all logged messages are sent to stdout
15+
# (so they show up in the doctest output and can be tested)
16+
import pyomo.common.log as _log
17+
_log.pyomo_handler.__class__ = _log.StdoutHandler
1518

1619
.. py:currentmodule:: pyomo.environ
1720

doc/OnlineDocs/explanation/developer_utils/deprecation.rst

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,29 @@ Deprecation
99
-----------
1010

1111
We offer a set of tools to help with deprecation in
12-
``pyomo.common.deprecation``.
12+
:py:mod:`pyomo.common.deprecation`.
1313

1414
By policy, when deprecating or moving an existing capability, one of the
1515
following utilities should be leveraged. Each has a required
1616
``version`` argument that should be set to current development version (e.g.,
1717
``"6.6.2.dev0"``). This version will be updated to the next actual
1818
release as part of the Pyomo release process. The current development version
19-
can be found by running ``pyomo --version`` on your local fork/branch.
19+
can be found by running
20+
21+
``pyomo --version``
22+
23+
on your local fork/branch.
2024

2125
.. currentmodule:: pyomo.common.deprecation
2226

2327
.. autosummary::
2428

2529
deprecated
2630
deprecation_warning
27-
relocated_module
31+
moved_module
2832
relocated_module_attribute
2933
RenamedClass
3034

31-
.. autodecorator:: pyomo.common.deprecation.deprecated
32-
:noindex:
33-
34-
.. autofunction:: pyomo.common.deprecation.deprecation_warning
35-
:noindex:
36-
37-
.. autofunction:: pyomo.common.deprecation.relocated_module
38-
:noindex:
39-
40-
.. autofunction:: pyomo.common.deprecation.relocated_module_attribute
41-
:noindex:
42-
43-
.. autoclass:: pyomo.common.deprecation.RenamedClass
44-
:noindex:
45-
4635

4736
Removal
4837
-------
@@ -52,10 +41,8 @@ warning, pending extenuating circumstances. The functionality should
5241
be deprecated, following the information above.
5342

5443
If the functionality is documented in the most recent
55-
edition of [`Pyomo - Optimization Modeling in Python`_], it may not be removed
56-
until the next major version release.
57-
58-
.. _Pyomo - Optimization Modeling in Python: https://doi.org/10.1007/978-3-030-68928-5
44+
edition of :ref:`Pyomo - Optimization Modeling in Python <pyomobookiii>`,
45+
it may not be removed until the next major version release.
5946

6047
For other functionality, it is preferred that ample time is given
6148
before removing the functionality. At minimum, significant functionality

doc/OnlineDocs/explanation/solvers/pynumero/tutorial.linear_solver_interfaces.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Interface to MA27
4242
>>> status = solver.do_numeric_factorization(A)
4343
>>> x, status = solver.do_back_solve(rhs)
4444
>>> np.max(np.abs(A*x - rhs)) <= 1e-15
45-
True
45+
np.True_
4646

4747

4848
Interface to MUMPS

doc/OnlineDocs/explanation/solvers/pyros.rst

Lines changed: 70 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -963,10 +963,10 @@ Observe that the log contains the following information:
963963
:linenos:
964964
965965
==============================================================================
966-
PyROS: The Pyomo Robust Optimization Solver, v1.3.6.
967-
Pyomo version: 6.9.2
968-
Commit hash: 41cd797e0
969-
Invoked at UTC 2025-03-13T16:20:31.105320+00:00
966+
PyROS: The Pyomo Robust Optimization Solver, v1.3.8.
967+
Pyomo version: 6.9.3dev0
968+
Commit hash: unknown
969+
Invoked at UTC 2025-05-05T00:00:00.000000+00:00
970970
971971
Developed by: Natalie M. Isenberg (1), Jason A. F. Sherman (1),
972972
John D. Siirola (2), Chrysanthos E. Gounaris (1)
@@ -1025,34 +1025,33 @@ Observe that the log contains the following information:
10251025
------------------------------------------------------------------------------
10261026
Itn Objective 1-Stg Shift 2-Stg Shift #CViol Max Viol Wall Time (s)
10271027
------------------------------------------------------------------------------
1028-
0 3.5838e+07 - - 5 1.8832e+04 0.693
1029-
1 3.5838e+07 1.2289e-09 1.5876e-12 5 3.7762e+04 1.514
1030-
2 3.6129e+07 2.7244e-01 3.6878e-01 3 1.1093e+02 2.486
1031-
3 3.6269e+07 3.7352e-01 4.3227e-01 1 2.7711e+01 3.667
1032-
4 3.6285e+07 7.6526e-01 2.8426e-11 0 4.3364e-05g 6.291
1028+
0 3.5838e+07 - - 5 1.8832e+04 0.759
1029+
1 3.5838e+07 2.9329e-09 5.0030e-10 5 2.1295e+04 1.573
1030+
2 3.6285e+07 7.6526e-01 2.0398e-01 2 2.2457e+02 2.272
1031+
3 3.6285e+07 7.7212e-13 1.2525e-10 0 7.2940e-08g 5.280
10331032
------------------------------------------------------------------------------
10341033
Robust optimal solution identified.
10351034
------------------------------------------------------------------------------
10361035
Timing breakdown:
10371036
10381037
Identifier ncalls cumtime percall %
10391038
-----------------------------------------------------------
1040-
main 1 6.291 6.291 100.0
1039+
main 1 5.281 5.281 100.0
10411040
------------------------------------------------------
1042-
dr_polishing 4 0.334 0.083 5.3
1043-
global_separation 27 0.954 0.035 15.2
1044-
local_separation 135 3.046 0.023 48.4
1045-
master 5 1.027 0.205 16.3
1046-
master_feasibility 4 0.133 0.033 2.1
1047-
preprocessing 1 0.013 0.013 0.2
1048-
other n/a 0.785 n/a 12.5
1041+
dr_polishing 3 0.155 0.052 2.9
1042+
global_separation 27 1.280 0.047 24.2
1043+
local_separation 108 2.200 0.020 41.7
1044+
master 4 0.727 0.182 13.8
1045+
master_feasibility 3 0.103 0.034 1.9
1046+
preprocessing 1 0.021 0.021 0.4
1047+
other n/a 0.794 n/a 15.0
10491048
======================================================
10501049
===========================================================
10511050
10521051
------------------------------------------------------------------------------
10531052
Termination stats:
1054-
Iterations : 5
1055-
Solve time (wall s) : 6.291
1053+
Iterations : 4
1054+
Solve time (wall s) : 5.281
10561055
Final objective value : 3.6285e+07
10571056
Termination condition : pyrosTerminationCondition.robust_optimal
10581057
------------------------------------------------------------------------------
@@ -1133,6 +1132,58 @@ The constituent columns are defined in the
11331132
current iteration.
11341133

11351134

1135+
Separation Priority Ordering
1136+
----------------------------
1137+
The PyROS solver supports custom prioritization of
1138+
the separation subproblems (and, thus, the constraints)
1139+
that are automatically derived from
1140+
a given model for robust optimization.
1141+
Users may specify separation priorities through:
1142+
1143+
- (Recommended) :class:`~pyomo.core.base.suffix.Suffix` components
1144+
with local name ``pyros_separation_priority``,
1145+
declared on the model or any of its sub-blocks.
1146+
Each entry of every such
1147+
:class:`~pyomo.core.base.suffix.Suffix`
1148+
should map a
1149+
:class:`~pyomo.core.base.var.Var`
1150+
or :class:`~pyomo.core.base.constraint.Constraint`
1151+
component to a value that specifies the separation
1152+
priority of all constraints derived from that component
1153+
- The optional argument ``separation_priority_order``
1154+
to the PyROS :py:meth:`~pyomo.contrib.pyros.pyros.PyROS.solve`
1155+
method. The argument should be castable to a :py:obj:`dict`,
1156+
of which each entry maps the full name of a
1157+
:class:`~pyomo.core.base.var.Var`
1158+
or :class:`~pyomo.core.base.constraint.Constraint`
1159+
component to a value that specifies the
1160+
separation priority of all constraints
1161+
derived from that component
1162+
1163+
Specification via :class:`~pyomo.core.base.suffix.Suffix` components
1164+
takes precedence over specification via the solver argument
1165+
``separation_priority_order``.
1166+
Moreover, the precedence ordering among
1167+
:class:`~pyomo.core.base.suffix.Suffix`
1168+
components is handled by the Pyomo
1169+
:class:`~pyomo.core.base.suffix.SuffixFinder` utility.
1170+
1171+
A separation priority can be either
1172+
a (real) number (i.e., of type :py:class:`int`, :py:class:`float`, etc.)
1173+
or :py:obj:`None`.
1174+
A higher number indicates a higher priority.
1175+
The default priority for all constraints is 0.
1176+
Therefore a constraint can be prioritized [or deprioritized]
1177+
over the default by mapping the constraint to a positive [or negative] number.
1178+
In practice, critical or dominant constraints are often
1179+
prioritized over algorithmic or implied constraints.
1180+
1181+
Constraints that have been assigned a priority of :py:obj:`None`
1182+
are enforced subject to only the nominal uncertain parameter realization
1183+
provided by the user. Therefore, these constraints are not imposed robustly
1184+
and, in particular, are excluded from the separation problems.
1185+
1186+
11361187
Feedback and Reporting Issues
11371188
-------------------------------
11381189
Please provide feedback and/or report any problems by opening an issue on

0 commit comments

Comments
 (0)