Skip to content

Commit

Permalink
Merge branch 'main' into RPB_MBDOE
Browse files Browse the repository at this point in the history
  • Loading branch information
adowling2 authored May 28, 2024
2 parents ac10aad + 0e749d0 commit 655c0e6
Show file tree
Hide file tree
Showing 62 changed files with 1,474 additions and 206 deletions.
4 changes: 2 additions & 2 deletions .coin-or/projDesc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ Carl D. Laird, Chair, Pyomo Management Committee, claird at andrew dot cmu dot e
Use explicit overrides to disable use of automated
version reporting.
-->
<stableVersionNumber>6.7.1</stableVersionNumber>
<releaseNumber>6.7.1</releaseNumber>
<stableVersionNumber>6.7.2</stableVersionNumber>
<releaseNumber>6.7.2</releaseNumber>

</developmentStatus>

Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/test_branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ jobs:
uses: crate-ci/typos@master
with:
config: ./.github/workflows/typos.toml
- name: URL Checker
uses: urlstechie/[email protected]
with:
# A comma-separated list of file types to cover in the URL checks
file_types: .md,.rst,.py
# Choose whether to include file with no URLs in the prints.
print_all: false
# More verbose summary at the end of a run
verbose: true
# How many times to retry a failed request (defaults to 1)
retry_count: 3
# Exclude Jenkins because it's behind a firewall; ignore RTD because
# a magically-generated string is triggering a failure
exclude_urls: https://pyomo-jenkins.sandia.gov/,https://pyomo.readthedocs.io/en/%s/errors.html


build:
Expand Down Expand Up @@ -181,7 +195,7 @@ jobs:
# Notes:
# - install glpk
# - pyodbc needs: gcc pkg-config unixodbc freetds
for pkg in bash pkg-config unixodbc freetds glpk; do
for pkg in bash pkg-config unixodbc freetds glpk ginac; do
brew list $pkg || brew install $pkg
done
Expand All @@ -193,7 +207,8 @@ jobs:
# - install glpk
# - ipopt needs: libopenblas-dev gfortran liblapack-dev
sudo apt-get -o Dir::Cache=${GITHUB_WORKSPACE}/cache/os \
install libopenblas-dev gfortran liblapack-dev glpk-utils
install libopenblas-dev gfortran liblapack-dev glpk-utils \
libginac-dev
sudo chmod -R 777 ${GITHUB_WORKSPACE}/cache/os
- name: Update Windows
Expand Down Expand Up @@ -264,7 +279,7 @@ jobs:
if test -z "${{matrix.slim}}"; then
python -m pip install --cache-dir cache/pip cplex docplex \
|| echo "WARNING: CPLEX Community Edition is not available"
python -m pip install --cache-dir cache/pip gurobipy==10.0.3\
python -m pip install --cache-dir cache/pip gurobipy==10.0.3 \
|| echo "WARNING: Gurobi is not available"
python -m pip install --cache-dir cache/pip xpress \
|| echo "WARNING: Xpress Community Edition is not available"
Expand Down Expand Up @@ -339,7 +354,7 @@ jobs:
echo "*** Install Pyomo dependencies ***"
# Note: this will fail the build if any installation fails (or
# possibly if it outputs messages to stderr)
conda install --update-deps -y $CONDA_DEPENDENCIES
conda install --update-deps -q -y $CONDA_DEPENDENCIES
if test -z "${{matrix.slim}}"; then
PYVER=$(echo "py${{matrix.python}}" | sed 's/\.//g')
echo "Installing for $PYVER"
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/test_pr_and_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ jobs:
uses: crate-ci/typos@master
with:
config: ./.github/workflows/typos.toml
- name: URL Checker
uses: urlstechie/[email protected]
with:
# A comma-separated list of file types to cover in the URL checks
file_types: .md,.rst,.py
# Choose whether to include file with no URLs in the prints.
print_all: false
# More verbose summary at the end of a run
verbose: true
# How many times to retry a failed request (defaults to 1)
retry_count: 3
# Exclude Jenkins because it's behind a firewall; ignore RTD because
# a magically-generated string is triggering a failure
exclude_urls: https://pyomo-jenkins.sandia.gov/,https://pyomo.readthedocs.io/en/%s/errors.html


build:
Expand Down Expand Up @@ -218,7 +232,7 @@ jobs:
# Notes:
# - install glpk
# - pyodbc needs: gcc pkg-config unixodbc freetds
for pkg in bash pkg-config unixodbc freetds glpk; do
for pkg in bash pkg-config unixodbc freetds glpk ginac; do
brew list $pkg || brew install $pkg
done
Expand All @@ -230,7 +244,8 @@ jobs:
# - install glpk
# - ipopt needs: libopenblas-dev gfortran liblapack-dev
sudo apt-get -o Dir::Cache=${GITHUB_WORKSPACE}/cache/os \
install libopenblas-dev gfortran liblapack-dev glpk-utils
install libopenblas-dev gfortran liblapack-dev glpk-utils \
libginac-dev
sudo chmod -R 777 ${GITHUB_WORKSPACE}/cache/os
- name: Update Windows
Expand Down Expand Up @@ -372,6 +387,7 @@ jobs:
CONDA_DEPENDENCIES="$CONDA_DEPENDENCIES $PKG"
fi
done
echo ""
echo "*** Install Pyomo dependencies ***"
# Note: this will fail the build if any installation fails (or
# possibly if it outputs messages to stderr)
Expand Down
18 changes: 14 additions & 4 deletions .jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ fi
if test -z "$SLIM"; then
export VENV_SYSTEM_PACKAGES='--system-site-packages'
fi
if test ! -z "$CATEGORY"; then
export PY_CAT="-m $CATEGORY"
fi

if test "$WORKSPACE" != "`pwd`"; then
echo "ERROR: pwd is not WORKSPACE"
Expand Down Expand Up @@ -122,10 +119,23 @@ if test -z "$MODE" -o "$MODE" == setup; then
echo "PYOMO_CONFIG_DIR=$PYOMO_CONFIG_DIR"
echo ""

# Call Pyomo build scripts to build TPLs that would normally be
# skipped by the pyomo download-extensions / build-extensions
# actions below
if [[ " $CATEGORY " == *" builders "* ]]; then
echo ""
echo "Running local build scripts..."
echo ""
set -x
python pyomo/contrib/simplification/build.py --build-deps || exit 1
set +x
fi

# Use Pyomo to download & compile binary extensions
i=0
while /bin/true; do
i=$[$i+1]
echo ""
echo "Downloading pyomo extensions (attempt $i)"
pyomo download-extensions $PYOMO_DOWNLOAD_ARGS
if test $? == 0; then
Expand Down Expand Up @@ -178,7 +188,7 @@ if test -z "$MODE" -o "$MODE" == test; then
python -m pytest -v \
-W ignore::Warning \
--junitxml="TEST-pyomo.xml" \
$PY_CAT $TEST_SUITES $PYTEST_EXTRA_ARGS
-m "$CATEGORY" $TEST_SUITES $PYTEST_EXTRA_ARGS

# Combine the coverage results and upload
if test -z "$DISABLE_COVERAGE"; then
Expand Down
75 changes: 75 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,81 @@ Pyomo CHANGELOG
===============


-------------------------------------------------------------------------------
Pyomo 6.7.2 (9 May 2024)
-------------------------------------------------------------------------------

- General
- Support config domains with either method or attribute domain_name (#3159)
- Automate TPL callback registrations (#3167)
- Fix type registrations for ExternalFunction arguments (#3168)
- Only modify module path and spec for deferred import modules (#3176)
- Add "mixed" standard form representation (#3201)
- Support "default" dispatchers in `ExitNodeDispatcher` (#3194)
- Redefine objective sense as a proper `IntEnum` (#3224)
- Fix division-by-0 bug in linear walker (#3246)
- Core
- Allow `Var` objects in `LinearExpression.args` (#3189)
- Add type hints to components (#3173)
- Simplify expressions generated by `TemplateSumExpression` (#3196)
- Make component data public classes (#3221, #3253)
- Exploit repeated named expressions in `identify_variables` (#3190)
- Documentation
- NFC: Add link to the HOMOWP companion notebooks (#3195)
- Update installation documentation to include Cython instructions (#3208)
- Add links to the Pyomo Book Springer page (#3211)
- Solver Interfaces
- Fix division by zero error in linear presolve (#3161)
- Subprocess timeout update (#3183)
- Solver Refactor - Bug fixes for various components (#3181, #3214, #3228)
- NLv2: handle presolved independent linear subsystems (#3193)
- Update `LegacySolverWrapper` compatibility with the `pyomo` script (#3202)
- Fix mosek_direct to use putqconk instead of putqcon (#3199)
- Check _skip_trivial_constraints before the constraint body (#3226)
- Fix AMPL solver duplicate funcadd (#3206)
- Disable the use of universal newlines in the ipopt_v2 NL file (#3231)
- NLv2: fix reporting numbers of nonlinear discrete variables (#3238)
- Fix: Get SCIP solving time considering float number with some text (#3234)
- Solver Refactor - Add `gurobi_direct` implementation (#3225)
- Testing
- Update TPL package list due to `contrib.solver` (#3164)
- Set maxDiff=None on the base TestCase class (#3171)
- Testing infrastructure updates (#3175)
- Typos update for March 2024 (#3219)
- Add openmpi to testing environment to resolve issue in mpi4py (#3236, #3239)
- Skip black 24.4.1 due to a bug in the parser (#3247)
- Skip tests on draft and WIP pull requests (#3223)
- Update GHA to grab gurobipy from PyPI (#3254)
- GDP
- Use private_data for all original / transformed component mappings (#3166)
- Fix a bug in gdp.bigm transformation for nested GDPs (#3213)
- Contributed Packages
- APPSI: cmodel: handle non-mutable params in var / constraint bounds (#3182)
- APPSI: Allow APPSI FBBT to handle nested named Expressions (#3185)
- APPSI: Add MAiNGO solver interface (#3165)
- CP: Add SequenceVar and other logical expressions for scheduling (#3227)
- DoE: Bug fixes (#3245)
- iis: Add minimal intractable system infeasibility diagnostics (#3172)
- incidence_analysis: Improve `solve_strongly_connected_components`
performance for models with named expressions (#3186)
- incidence_analysis: Add function to plot incidence graph in
Dulmage-Mendelsohn order (#3207)
- incidence_analysis: Require variables and constraints to be specified
separately in `IncidenceGraphInterface.remove_nodes` (#3212)
- latex_printer: bugfix for set operations / multidimensional sets (#3177)
- MindtPy: Add HiGHS support (#2971)
- MindtPy: Add call_before_subproblem_solve callback (#3251)
- Parmest: New UI using experiment lists (#3160)
- piecewise: Add piecewise linear transformations (#3036)
- preprocessing: bugfix: intersect domains in variable aggregator (#3241)
- PyNumero: Allow CyIpopt to solve problems without objectives (#3163)
- PyNumero: Work around bug in CyIpopt 1.4.0 (#3222)
- PyNumero: Include "inventory" in readme (#3248)
- PyROS: Simplify custom domain validators (#3169)
- PyROS: Fix iteration logging for edge case involving discrete sets (#3170)
- PyROS: Update solver timing system (#3198)
- simplification: expression simplification using GiNaC or SymPy (#3088)

-------------------------------------------------------------------------------
Pyomo 6.7.1 (21 Feb 2024)
-------------------------------------------------------------------------------
Expand Down
9 changes: 7 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
We are pleased to announce the release of Pyomo 6.7.1.
We are pleased to announce the release of Pyomo 6.7.2.

Pyomo is a collection of Python software packages that supports a
diverse set of optimization capabilities for formulating and analyzing
Expand All @@ -10,9 +10,14 @@ The following are highlights of the 6.7 release series:
- Removed support for Python 3.7
- New writer for converting linear models to matrix form
- Improved handling of nested GDPs
- Redesigned user API for parameter estimation
- New packages:
- latex_printer (print Pyomo models to a LaTeX compatible format)
- iis: new capability for identifying minimal intractable systems
- latex_printer: print Pyomo models to a LaTeX compatible format
- contrib.solver: preview of redesigned solver interfaces
- simplification: simplify Pyomo expressions
- New solver interfaces
- MAiNGO: Mixed-integer nonlinear global optimization
- ...and of course numerous minor bug fixes and performance enhancements

A full list of updates and changes is available in the
Expand Down
27 changes: 20 additions & 7 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@

import pytest

_implicit_markers = {'default'}
_extended_implicit_markers = _implicit_markers.union({'solver'})


def pytest_collection_modifyitems(items):
"""
This method will mark any unmarked tests with the implicit marker ('default')
"""
for item in items:
try:
next(item.iter_markers())
except StopIteration:
for marker in _implicit_markers:
item.add_marker(getattr(pytest.mark, marker))


def pytest_runtest_setup(item):
"""
Expand All @@ -32,23 +48,20 @@ def pytest_runtest_setup(item):
the default mode; but if solver tests are also marked with an explicit
category (e.g., "expensive"), we will skip them.
"""
marker = item.iter_markers()
solvernames = [mark.args[0] for mark in item.iter_markers(name="solver")]
solveroption = item.config.getoption("--solver")
markeroption = item.config.getoption("-m")
implicit_markers = ['default']
extended_implicit_markers = implicit_markers + ['solver']
item_markers = set(mark.name for mark in marker)
item_markers = set(mark.name for mark in item.iter_markers())
if solveroption:
if solveroption not in solvernames:
pytest.skip("SKIPPED: Test not marked {!r}".format(solveroption))
return
elif markeroption:
return
elif item_markers:
if not set(implicit_markers).issubset(
item_markers
) and not item_markers.issubset(set(extended_implicit_markers)):
if not _implicit_markers.issubset(item_markers) and not item_markers.issubset(
_extended_implicit_markers
):
pytest.skip('SKIPPED: Only running default, solver, and unmarked tests.')


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ NumPy compatible functions:
* `numpy.arccos() <https://numpy.org/doc/stable/reference/generated/numpy.arccos.html>`_
* `numpy.sinh() <https://numpy.org/doc/stable/reference/generated/numpy.sinh.html>`_
* `numpy.cosh() <https://numpy.org/doc/stable/reference/generated/numpy.cosh.html>`_
* `numpy.abs() <https://numpy.org/doc/stable/reference/generated/numpy.abs.html>`_
* `numpy.abs() <https://numpy.org/doc/stable/reference/generated/numpy.absolute.html>`_
* `numpy.tanh() <https://numpy.org/doc/stable/reference/generated/numpy.tanh.html>`_
* `numpy.arccosh() <https://numpy.org/doc/stable/reference/generated/numpy.arccosh.html>`_
* `numpy.arcsinh() <https://numpy.org/doc/stable/reference/generated/numpy.arcsinh.html>`_
Expand Down
44 changes: 2 additions & 42 deletions doc/OnlineDocs/contribution_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -404,50 +404,10 @@ Contrib packages will be tested along with Pyomo. If test failures
arise, then these packages will be disabled and an issue will be
created to resolve these test failures.

The following two examples illustrate the two ways
that ``pyomo.contrib`` can be used to integrate third-party
contributions.

Including External Packages
+++++++++++++++++++++++++++

The `pyomocontrib_simplemodel
<http://pyomocontrib-simplemodel.readthedocs.io/en/latest/>`_ package
is derived from Pyomo, and it defines the class SimpleModel that
illustrates how Pyomo can be used in a simple, less object-oriented
manner. Specifically, this class mimics the modeling style supported
by `PuLP <https://github.com/coin-or/pulp>`_.

While ``pyomocontrib_simplemodel`` can be installed and used separate
from Pyomo, this package is included in ``pyomo/contrib/simplemodel``.
This allows this package to be referenced as if were defined as a
subpackage of ``pyomo.contrib``. For example::

from pyomo.contrib.simplemodel import *
from math import pi

m = SimpleModel()

r = m.var('r', bounds=(0,None))
h = m.var('h', bounds=(0,None))

m += 2*pi*r*(r + h)
m += pi*h*r**2 == 355

status = m.solve("ipopt")

This example illustrates that a package can be distributed separate
from Pyomo while appearing to be included in the ``pyomo.contrib``
subpackage. Pyomo requires a separate directory be defined under
``pyomo/contrib`` for each such package, and the Pyomo developer
team will approve the inclusion of third-party packages in this
manner.


Contrib Packages within Pyomo
+++++++++++++++++++++++++++++

Third-party contributions can also be included directly within the
Third-party contributions can be included directly within the
``pyomo.contrib`` package. The ``pyomo/contrib/example`` package
provides an example of how this can be done, including a directory
for plugins and package tests. For example, this package can be
Expand All @@ -465,7 +425,7 @@ import this package, but if an import failure occurs, Pyomo will
silently ignore it. Otherwise, this pyomo package will be treated
like any other. Specifically:

* Plugin classes defined in this package are loaded when `pyomo.environ` is loaded.
* Plugin classes defined in this package are loaded when ``pyomo.environ`` is loaded.

* Tests in this package are run with other Pyomo tests.

2 changes: 1 addition & 1 deletion doc/OnlineDocs/modeling_extensions/dae.rst
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ supported by CasADi. A list of available integrators for each package is
given below. Please refer to the `SciPy
<https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.ode.html>`_
and `CasADi
<http://casadi.sourceforge.net/api/html/db/d3d/classcasadi_1_1Integrator.html>`_ documentation directly for the most up-to-date information about
<https://web.casadi.org/python-api/#integrator>`_ documentation directly for the most up-to-date information about
these packages and for more information about the various integrators and
options.

Expand Down
Loading

0 comments on commit 655c0e6

Please sign in to comment.