Skip to content

Commit

Permalink
Merge branch 'main' into pr/3200
Browse files Browse the repository at this point in the history
  • Loading branch information
blnicho committed Nov 13, 2024
2 parents fecd201 + 9db592c commit 1a4663d
Show file tree
Hide file tree
Showing 529 changed files with 19,047 additions and 14,023 deletions.
2 changes: 1 addition & 1 deletion .coin-or/projDesc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ Carl D. Laird, Chair, Pyomo Management Committee, claird at andrew dot cmu dot e

<platform>
<operatingSystem>Any</operatingSystem>
<compiler>Python 3.8, 3.9, 3.10, 3.11, 3.12</compiler>
<compiler>Python 3.8, 3.9, 3.10, 3.11, 3.12, 3.13</compiler>
</platform>

</testedPlatforms>
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/release_wheel_creation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
matrix:
os: [ubuntu-22.04, windows-latest, macos-latest]
arch: [all]
wheel-version: ['cp38*', 'cp39*', 'cp310*', 'cp311*', 'cp312*']
wheel-version: ['cp38*', 'cp39*', 'cp310*', 'cp311*', 'cp312*', 'cp313*']

include:
- wheel-version: 'cp38*'
Expand All @@ -42,12 +42,17 @@ jobs:
- wheel-version: 'cp312*'
TARGET: 'py312'
GLOBAL_OPTIONS: "--without-cython --with-distributable-extensions"
- wheel-version: 'cp313*'
TARGET: 'py313'
GLOBAL_OPTIONS: "--without-cython --with-distributable-extensions"

exclude:
- wheel-version: 'cp311*'
os: windows-latest
- wheel-version: 'cp312*'
os: windows-latest
- wheel-version: 'cp313*'
os: windows-latest

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -77,7 +82,7 @@ jobs:
matrix:
os: [ubuntu-22.04]
arch: [all]
wheel-version: ['cp38*', 'cp39*', 'cp310*', 'cp311*', 'cp312*']
wheel-version: ['cp38*', 'cp39*', 'cp310*', 'cp311*', 'cp312*', 'cp313*']

include:
- wheel-version: 'cp38*'
Expand All @@ -95,6 +100,9 @@ jobs:
- wheel-version: 'cp312*'
TARGET: 'py312'
GLOBAL_OPTIONS: "--without-cython --with-distributable-extensions"
- wheel-version: 'cp313*'
TARGET: 'py313'
GLOBAL_OPTIONS: "--without-cython --with-distributable-extensions"
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/test_branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python: ['3.12']
python: ['3.13']
other: [""]
category: [""]

Expand All @@ -83,7 +83,7 @@ jobs:

include:
- os: ubuntu-latest
python: '3.12'
python: '3.13'
TARGET: linux
PYENV: pip

Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
PACKAGES: openmpi mpi4py

- os: ubuntu-latest
python: '3.10'
python: '3.12'
other: /cython
setup_options: --with-cython
skip_doctest: 1
Expand Down Expand Up @@ -350,6 +350,10 @@ jobs:
if test "${{matrix.TARGET}}" == linux; then
EXCLUDE="casadi numdifftools $EXCLUDE"
fi
if [[ "${{matrix.TARGET}}" == win && "${{matrix.python}}" == "3.13" ]]; then
# As of Nov 7, 2024, qtconsole is not compatible with python 3.13 on win
EXCLUDE="qtconsole $EXCLUDE"
fi
EXCLUDE=`echo "$EXCLUDE" | xargs`
if test -n "$EXCLUDE"; then
for WORD in $EXCLUDE; do
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/test_pr_and_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: [ 3.8, 3.9, '3.10', '3.11', '3.12' ]
python: [ 3.8, 3.9, '3.10', '3.11', '3.12', '3.13' ]
other: [""]
category: [""]

Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
PACKAGES: openmpi mpi4py

- os: ubuntu-latest
python: '3.10'
python: '3.12'
other: /cython
setup_options: --with-cython
skip_doctest: 1
Expand Down Expand Up @@ -141,6 +141,15 @@ jobs:
TARGET: linux
PYENV: pip

- os: ubuntu-latest
python: 3.12
other: /numpy2
slim: 1
skip_doctest: 1
TARGET: linux
PYENV: pip
PACKAGES: "gurobipy dill numpy>2.0 scipy networkx"

- os: ubuntu-latest
python: 3.9
other: /pyutilib
Expand Down Expand Up @@ -373,6 +382,10 @@ jobs:
if test "${{matrix.TARGET}}" == linux; then
EXCLUDE="casadi numdifftools $EXCLUDE"
fi
if [[ "${{matrix.TARGET}}" == win && "${{matrix.python}}" == "3.13" ]]; then
# As of Nov 7, 2024, qtconsole is not compatible with python 3.13 on win
EXCLUDE="qtconsole $EXCLUDE"
fi
EXCLUDE=`echo "$EXCLUDE" | xargs`
if test -n "$EXCLUDE"; then
for WORD in $EXCLUDE; do
Expand Down
14 changes: 10 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# temporary editor files
*~
.#*
\#*#

# IDE configuration files
.idea
.spyder*
.ropeproject
.vscode

# Python generates numerous files when byte compiling / installing packages
__pycache__/
*.pyx
*.pyc
*.pyo
*.egg-info
*.py[cod]
*.egg-info/

# Documentation builds
doc/OnlineDocs/_build
Expand All @@ -17,14 +23,14 @@ doc/OnlineDocs/**/*.spy
*.out
pyomo/dataportal/parse_table_datacmds.py
gurobi.log
cplex.log

# Results from pytest --with-coverage
.coverage
*.cover

# Jupyterhub/Jupyterlab checkpoints
.ipynb_checkpoints
cplex.log

# Mac tracking files
*.DS_Store*
5 changes: 3 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.8"
python: "3.11"

sphinx:
configuration: doc/OnlineDocs/conf.py

formats: all
formats:
- pdf

# Set the version of Python and requirements required to build the docs
python:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Pyomo is available under the BSD License - see the

Pyomo is currently tested with the following Python implementations:

* CPython: 3.8, 3.9, 3.10, 3.11, 3.12
* CPython: 3.8, 3.9, 3.10, 3.11, 3.12, 3.13
* PyPy: 3.9

_Testing and support policy_:
Expand Down
9 changes: 7 additions & 2 deletions doc/OnlineDocs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SPHINXBUILD = sphinx-build
SPHINXPROJ = Pyomo
SOURCEDIR = .
BUILDDIR = _build
APIDIR = api

# Put it first so that "make" without argument is like "make help".
help:
Expand All @@ -19,8 +20,12 @@ help:
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

clean clean_tests:
clean:
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@echo "Removing *.spy, *.out"
@find . -name \*.spy -delete
@find src -name \*.out -delete
@for D in $(BUILDDIR) $(SOURCEDIR)/$(APIDIR); do \
if test -d "$$D"; then echo "Removing $$D"; rm -r "$$D"; fi \
done

rebuild: clean html
63 changes: 53 additions & 10 deletions doc/OnlineDocs/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,70 @@
Pyomo leverages ``make`` to generate documentation. The following two
sections describe how to build and test the online documentation
locally.

> **NOTE**: All commands assume you are running from the *root Pyomo source directory*.

Preview Changes Locally
------------------------
-----------------------

1. Install Sphinx
1. Install documentation dependencies (e.g., Sphinx, etc):

```bash
$ pip install sphinx sphinx_rtd_theme sphinx_copybutton
$ pip install -e .[docs]
```

**NOTE**: You may get a warning about the `dot` command if you do not have
`graphviz` installed.
> **NOTE**: You may get a warning about the `dot` command if you do
> not have `graphviz` installed.
1. Build the documentation

2. Build the documentation. Sphinx (and Pyomo) support multiple
documentation *targets*. These instructions describe building the
`html` target, but the same process applies for other targets.

```bash
$ make html # Option 1
$ make latexpdf # Option 2
$ make -C doc/OnlineDocs html
```

1. View `_build/html/index.html` in your browser
3. View ``doc/OnlineDocs/_build/html/index.html`` in your browser

Test Changes Locally
--------------------

```bash
$ make -C doc/OnlineDocs doctest -d # from the pyomo root folder
$ make -C doc/OnlineDocs doctest
```

Rebuilding the documentation
----------------------------

Sphinx caches significant amounts of work at the end of a documentation
build. However, if you are in the process of editing the documentation,
it may not correctly invalidate the cache. You can purge the entire
cache with

```bash
$ make -C doc/OnlineDocs clean
```

Combining steps
---------------

These steps can, of course, be combined into a single command:

```bash
$ make -c doc/OnlineDocs clean html doctest
```

Documentation history
---------------------

The Pyomo online documentation went through a significant overhaul in
2024. If you need to go back and look at the old documentation, the
following git hashes might be relevant:

- [23fb726ce](https://github.com/Pyomo/pyomo/commit/23fb726ce0e092412081bd70e8a0370af46f6d0f):
main (close to just) before the reorg was merged

- [c157587fc](https://github.com/Pyomo/pyomo/commit/c157587fc9a03300b53879b99c1f350a26a9519f):
reorg branch just before the `Archive` subdirectory was removed
21 changes: 21 additions & 0 deletions doc/OnlineDocs/_static/theme_overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,27 @@ dl.py.method dt em span.n {
}
}

.rst-content table.diataxis td {
vertical-align: top;
}

.rst-content table.diataxis li.toctree-l1 {
list-style-type: none;
font-weight: bold;
font-size: x-large;
}

.rst-content table.diataxis li ul li {
list-style-type: none;
font-weight: normal;
font-size: medium;
}

.rst-content table.diataxis li ul li ul li {
list-style-type: "- ";
}


/* Remove space after tables in definition lists (e.g., for function
"Parameters" lists*/
.rst-content dl div.wy-table-responsive {
Expand Down
13 changes: 13 additions & 0 deletions doc/OnlineDocs/_templates/recursive-base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ name | escape | underline}}

({{ objtype }} from :py:mod:`{{ module }}`)

.. testsetup:: *

# import everything from the module containing this class so that
# doctests for the class docstrings see the correct environment
from {{ module }} import *

.. currentmodule:: {{ module }}

.. auto{{ objtype }}:: {{ objname }}
49 changes: 49 additions & 0 deletions doc/OnlineDocs/_templates/recursive-class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{{ name | escape | underline}}

(class from :py:mod:`{{ module }}`)

.. testsetup:: *

# import everything from the module containing this class so that
# doctests for the class docstrings see the correct environment
from {{ module }} import *

.. currentmodule:: {{ module }}

{# Note that numpy.ndarray examples fail doctest; disable documentation
of inherited members for classes derived from ndarray #}

.. autoclass:: {{ module }}::{{ objname }}
:members:
:show-inheritance:
{{ '' if (module + '.' + name) in (
'pyomo.contrib.pynumero.sparse.block_vector.BlockVector',
'pyomo.contrib.pynumero.sparse.mpi_block_vector.MPIBlockVector',
'pyomo.core.expr.ndarray.NumericNDArray',
) else ':inherited-members:' }}

{% block methods %}
.. automethod:: __init__

{% if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
{% for item in methods %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

.. rubric:: Member Documentation
Loading

0 comments on commit 1a4663d

Please sign in to comment.