Skip to content

Commit

Permalink
Merge branch 'main' into lp-dual
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiirola authored Nov 13, 2024
2 parents 5e8913f + 9db592c commit 9e6bf2e
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 21 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 @@ -344,6 +344,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
8 changes: 6 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 @@ -376,6 +376,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
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
2 changes: 1 addition & 1 deletion doc/OnlineDocs/getting_started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Installation

Pyomo currently supports the following versions of Python:

* 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

At the time of the first Pyomo release after the end-of-life of a minor Python
Expand Down
7 changes: 5 additions & 2 deletions pyomo/contrib/pynumero/sparse/mpi_block_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,14 @@ def has_none(self):
@property
def owned_blocks(self):
"""
Returns list with inidices of blocks owned by this processor.
Returns list with indices of blocks owned by this processor.
"""
return self._owned_blocks

@property
def shared_blocks(self):
"""
Returns list with inidices of blocks shared by all processors
Returns list with indices of blocks shared by all processors
"""
return np.array([i for i in range(self.nblocks) if self._rank_owner[i] < 0])

Expand Down Expand Up @@ -1377,6 +1377,9 @@ def cumsum(self, axis=None, dtype=None, out=None):
raise RuntimeError('Operation not supported by MPIBlockVector')

def tolist(self):
"""
Disable `np.ndarray.tolist` as it is not supported.
"""
raise RuntimeError('Operation not supported by MPIBlockVector')

def flatten(self, order='C'):
Expand Down
22 changes: 13 additions & 9 deletions pyomo/contrib/viewer/tests/test_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import pyomo.contrib.viewer.qt as myqt
import pyomo.contrib.viewer.pyomo_viewer as pv
from pyomo.contrib.viewer.qt import available
from pyomo.core.base.units_container import pint_available

if available:
import contextvars
Expand All @@ -57,6 +58,18 @@ def qtbot():
"""Overwrite qtbot - remove test failure"""
return

pytestmark = unittest.pytest.mark.skip("Qt components are not available.")

if not pint_available:
pytestmark = unittest.pytest.mark.skip(
"contrib.viewer requires pint, which is not available."
)

if not pv.qtconsole_available:
pytestmark = unittest.pytest.mark.skip(
"contrib.viewer requires qtconsole, which is not available."
)


def get_model():
# Borrowed this test model from the trust region tests
Expand Down Expand Up @@ -100,7 +113,6 @@ def blackbox(a, b):
return m


@unittest.skipIf(not available, "Qt packages are not available.")
def test_get_mainwindow(qtbot):
m = get_model()
mw = get_mainwindow(model=m, testing=True)
Expand All @@ -111,21 +123,18 @@ def test_get_mainwindow(qtbot):
assert isinstance(mw.parameters, ModelBrowser)


@unittest.skipIf(not available, "Qt packages are not available.")
def test_close_mainwindow(qtbot):
mw = get_mainwindow(model=None, testing=True)
mw.exit_action()


@unittest.skipIf(not available, "Qt packages are not available.")
def test_show_model_select_no_models(qtbot):
mw = get_mainwindow(model=None, testing=True)
ms = mw.show_model_select()
ms.update_models()
ms.select_model()


@unittest.skipIf(not available, "Qt packages are not available.")
def test_model_information(qtbot):
m = get_model()
mw = get_mainwindow(model=m, testing=True)
Expand All @@ -146,15 +155,13 @@ def test_model_information(qtbot):
assert isinstance(mw.parameters, ModelBrowser)


@unittest.skipIf(not available, "Qt packages are not available.")
def test_tree_expand_collapse(qtbot):
m = get_model()
mw = get_mainwindow(model=m, testing=True)
mw.variables.treeView.expandAll()
mw.variables.treeView.collapseAll()


@unittest.skipIf(not available, "Qt packages are not available.")
def test_residual_table(qtbot):
m = get_model()
mw = get_mainwindow(model=m, testing=True)
Expand All @@ -181,7 +188,6 @@ def test_residual_table(qtbot):
assert dm.data(dm.index(0, 0)) == "c5"


@unittest.skipIf(not available, "Qt packages are not available.")
def test_var_tree(qtbot):
m = get_model()
mw = get_mainwindow(model=m, testing=True)
Expand Down Expand Up @@ -215,7 +221,6 @@ def test_var_tree(qtbot):
mw.variables.treeView.closePersistentEditor(z1_val_index)


@unittest.skipIf(not available, "Qt packages are not available.")
def test_bad_view(qtbot):
m = get_model()
mw = get_mainwindow(model=m, testing=True)
Expand All @@ -229,7 +234,6 @@ def test_bad_view(qtbot):
assert err == "ValueError"


@unittest.skipIf(not available, "Qt packages are not available.")
def test_qtconsole_app(qtbot):
app = pv.QtApp()
# empty list to prevent picking up args from pytest
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def __ne__(self, other):
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Scientific/Engineering :: Mathematics',
Expand Down

0 comments on commit 9e6bf2e

Please sign in to comment.