Skip to content

Commit

Permalink
Merge branch 'main' into linear-walker-wrt
Browse files Browse the repository at this point in the history
  • Loading branch information
emma58 committed May 21, 2024
2 parents 2c4a1cb + 9e102d8 commit 034b564
Show file tree
Hide file tree
Showing 151 changed files with 10,301 additions and 1,301 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
25 changes: 20 additions & 5 deletions .github/workflows/test_branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ 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
# 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
exclude_urls: https://pyomo-jenkins.sandia.gov/


build:
Expand Down Expand Up @@ -181,7 +194,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 +206,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,11 +278,12 @@ 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 \
-i https://pypi.gurobi.com 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"
python -m pip install --cache-dir cache/pip maingopy \
|| echo "WARNING: MAiNGO is not available"
if [[ ${{matrix.python}} == pypy* ]]; then
echo "skipping wntr for pypy"
else
Expand Down Expand Up @@ -338,7 +353,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
27 changes: 22 additions & 5 deletions .github/workflows/test_pr_and_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ 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
# 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
exclude_urls: https://pyomo-jenkins.sandia.gov/


build:
Expand Down Expand Up @@ -218,7 +231,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 +243,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 @@ -301,11 +315,12 @@ 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 \
-i https://pypi.gurobi.com 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"
python -m pip install --cache-dir cache/pip maingopy \
|| echo "WARNING: MAiNGO is not available"
if [[ ${{matrix.python}} == pypy* ]]; then
echo "skipping wntr for pypy"
else
Expand Down Expand Up @@ -371,6 +386,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 Expand Up @@ -613,7 +629,8 @@ jobs:
if: ${{ ! matrix.slim }}
shell: bash
run: |
$PYTHON_EXE -m pip install --cache-dir cache/pip highspy \
echo "NOTE: temporarily pinning to highspy pre-release for testing"
$PYTHON_EXE -m pip install --cache-dir cache/pip "highspy>=1.7.1.dev1" \
|| echo "WARNING: highspy is not available"
- name: Set up coverage tracking
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ WRONLY = "WRONLY"
Hax = "Hax"
# Big Sur
Sur = "Sur"
# contrib package named mis and the acronym whence the name comes
mis = "mis"
MIS = "MIS"
# Ignore the shorthand ans for answer
ans = "ans"
# Ignore the keyword arange
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
1 change: 1 addition & 0 deletions doc/OnlineDocs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
'sphinx.ext.todo',
'sphinx_copybutton',
'enum_tools.autoenum',
'sphinx.ext.autosectionlabel',
#'sphinx.ext.githubpages',
]

Expand Down
Loading

0 comments on commit 034b564

Please sign in to comment.