Skip to content

Commit f093e88

Browse files
committed
Merge branch 'main' into doc-reorg
2 parents fac094a + b983b91 commit f093e88

File tree

10 files changed

+66
-46
lines changed

10 files changed

+66
-46
lines changed

.github/workflows/test_branches.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,19 @@ jobs:
7575
other: [""]
7676
category: [""]
7777

78+
# win/3.8 conda builds no longer work due to environment not being able
79+
# to resolve. We are skipping it now.
80+
exclude:
81+
- os: windows-latest
82+
python: 3.8
83+
7884
include:
7985
- os: ubuntu-latest
8086
python: '3.12'
8187
TARGET: linux
8288
PYENV: pip
8389

84-
- os: macos-13
90+
- os: macos-latest
8591
python: '3.10'
8692
TARGET: osx
8793
PYENV: pip
@@ -215,6 +221,7 @@ jobs:
215221
if: matrix.TARGET == 'win'
216222
run: |
217223
echo "SETUPTOOLS_USE_DISTUTILS=local" >> $GITHUB_ENV
224+
choco install pkgconfiglite
218225
219226
- name: Set up Python ${{ matrix.python }}
220227
if: matrix.PYENV == 'pip'
@@ -352,6 +359,10 @@ jobs:
352359
done
353360
echo ""
354361
echo "*** Install Pyomo dependencies ***"
362+
# For windows, cannot use newer setuptools because of APPSI compilation issues
363+
if test "${{matrix.TARGET}}" == 'win'; then
364+
CONDA_DEPENDENCIES="$CONDA_DEPENDENCIES setuptools<74.0.0"
365+
fi
355366
# Note: this will fail the build if any installation fails (or
356367
# possibly if it outputs messages to stderr)
357368
conda install --update-deps -q -y $CONDA_DEPENDENCIES

.github/workflows/test_pr_and_main.yml

+16-10
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
strategy:
6868
fail-fast: false
6969
matrix:
70-
os: [ubuntu-latest, macos-13, windows-latest]
70+
os: [ubuntu-latest, macos-latest, windows-latest]
7171
python: [ 3.8, 3.9, '3.10', '3.11', '3.12' ]
7272
other: [""]
7373
category: [""]
@@ -77,12 +77,13 @@ jobs:
7777
exclude:
7878
- os: windows-latest
7979
python: 3.8
80+
8081
include:
8182
- os: ubuntu-latest
8283
TARGET: linux
8384
PYENV: pip
8485

85-
- os: macos-13
86+
- os: macos-latest
8687
TARGET: osx
8788
PYENV: pip
8889

@@ -108,14 +109,6 @@ jobs:
108109
PYENV: conda
109110
PACKAGES: openmpi mpi4py
110111

111-
- os: ubuntu-latest
112-
python: '3.11'
113-
other: /singletest
114-
category: "-m 'neos or importtest'"
115-
skip_doctest: 1
116-
TARGET: linux
117-
PYENV: pip
118-
119112
- os: ubuntu-latest
120113
python: '3.10'
121114
other: /cython
@@ -132,6 +125,14 @@ jobs:
132125
TARGET: win
133126
PYENV: pip
134127

128+
- os: ubuntu-latest
129+
python: '3.11'
130+
other: /singletest
131+
category: "-m 'neos or importtest'"
132+
skip_doctest: 1
133+
TARGET: linux
134+
PYENV: pip
135+
135136
- os: ubuntu-latest
136137
python: 3.8
137138
other: /slim
@@ -243,6 +244,7 @@ jobs:
243244
if: matrix.TARGET == 'win'
244245
run: |
245246
echo "SETUPTOOLS_USE_DISTUTILS=local" >> $GITHUB_ENV
247+
choco install pkgconfiglite
246248
247249
- name: Set up Python ${{ matrix.python }}
248250
if: matrix.PYENV == 'pip'
@@ -380,6 +382,10 @@ jobs:
380382
done
381383
echo ""
382384
echo "*** Install Pyomo dependencies ***"
385+
# For windows, cannot use newer setuptools because of APPSI compilation issues
386+
if test "${{matrix.TARGET}}" == 'win'; then
387+
CONDA_DEPENDENCIES="$CONDA_DEPENDENCIES setuptools<74.0.0"
388+
fi
383389
# Note: this will fail the build if any installation fails (or
384390
# possibly if it outputs messages to stderr)
385391
conda install --update-deps -q -y $CONDA_DEPENDENCIES

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
[![Jenkins Status](https://github.com/Pyomo/jenkins-status/blob/main/pyomo_main.svg)](https://pyomo-jenkins.sandia.gov/)
33
[![codecov](https://codecov.io/gh/Pyomo/pyomo/branch/main/graph/badge.svg)](https://codecov.io/gh/Pyomo/pyomo)
44
[![Documentation Status](https://readthedocs.org/projects/pyomo/badge/?version=latest)](http://pyomo.readthedocs.org/en/latest/)
5+
[![URL Validation](https://img.shields.io/github/actions/workflow/status/Pyomo/pyomo/url_check.yml?branch=main&label=doc%20urls)](https://github.com/Pyomo/pyomo/actions/workflows/url_check.yml)
56
[![Build services](https://github.com/Pyomo/jenkins-status/blob/main/pyomo_services.svg)](https://pyomo-jenkins.sandia.gov/)
67
[![GitHub contributors](https://img.shields.io/github/contributors/pyomo/pyomo.svg)](https://github.com/pyomo/pyomo/graphs/contributors)
78
[![Merged PRs](https://img.shields.io/github/issues-pr-closed-raw/pyomo/pyomo.svg?label=merged+PRs)](https://github.com/pyomo/pyomo/pulls?q=is:pr+is:merged)

examples/pyomobook/gdp-ch/gdp_uc.py

+6
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,9 @@ def obj(m):
116116
@model.Constraint(model.GENERATORS)
117117
def nontrivial(m, g):
118118
return sum(m.Power[g, t] for t in m.TIME) >= len(m.TIME) / 2 * m.MinPower[g]
119+
120+
121+
@model.ConstraintList()
122+
def nondegenerate(m):
123+
for i, g in enumerate(m.GENERATORS):
124+
yield m.Power[g, i + 1] == 0

examples/pyomobook/gdp-ch/pyomo.gdp_uc.txt

+15-15
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Problem:
2222
Lower bound: 45.0
2323
Upper bound: 45.0
2424
Number of objectives: 1
25-
Number of constraints: 58
25+
Number of constraints: 60
2626
Number of variables: 24
27-
Number of nonzeros: 124
27+
Number of nonzeros: 126
2828
Sense: minimize
2929
# ----------------------------------------------------------
3030
# Solver Information
@@ -34,8 +34,8 @@ Solver:
3434
Termination condition: optimal
3535
Statistics:
3636
Branch and bound:
37-
Number of bounded subproblems: 15
38-
Number of created subproblems: 15
37+
Number of bounded subproblems: 9
38+
Number of created subproblems: 9
3939
Error rc: 0
4040
Time: 0.007754325866699219
4141
# ----------------------------------------------------------
@@ -51,24 +51,24 @@ Solution:
5151
obj:
5252
Value: 45
5353
Variable:
54-
GenOff[g1,2].binary_indicator_var:
54+
GenOff[g1,1].binary_indicator_var:
5555
Value: 1
56-
GenOff[g2,1].binary_indicator_var:
56+
GenOff[g2,2].binary_indicator_var:
5757
Value: 1
58-
GenOn[g1,1].binary_indicator_var:
58+
GenOn[g1,3].binary_indicator_var:
5959
Value: 1
60-
GenOn[g2,3].binary_indicator_var:
60+
GenOn[g2,1].binary_indicator_var:
6161
Value: 1
62-
GenStartup[g1,3].binary_indicator_var:
62+
GenStartup[g1,2].binary_indicator_var:
6363
Value: 1
64-
GenStartup[g2,2].binary_indicator_var:
64+
GenStartup[g2,3].binary_indicator_var:
6565
Value: 1
66-
Power[g1,1]:
67-
Value: 10
68-
Power[g1,3]:
66+
Power[g1,2]:
6967
Value: 5
70-
Power[g2,2]:
68+
Power[g1,3]:
7169
Value: 10
72-
Power[g2,3]:
70+
Power[g2,1]:
7371
Value: 20
72+
Power[g2,3]:
73+
Value: 10
7474
Constraint: No values

pyomo/contrib/fme/tests/test_fourier_motzkin_elimination.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ def test_post_processing(self):
562562
fme = TransformationFactory('contrib.fourier_motzkin_elimination')
563563
fme.apply_to(m, vars_to_eliminate=disaggregatedVars, do_integer_arithmetic=True)
564564
# post-process
565-
fme.post_process_fme_constraints(m, SolverFactory('glpk'))
565+
fme.post_process_fme_constraints(m, SolverFactory('glpk'), tolerance=-1e-6)
566566

567567
constraints = m._pyomo_contrib_fme_transformation.projected_constraints
568568
self.assertEqual(len(constraints), 11)

pyomo/core/kernel/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def getname(
156156
157157
Args:
158158
fully_qualified (bool): Generate a full name by
159-
iterating through all anscestor containers.
159+
iterating through all ancestor containers.
160160
Default is :const:`False`.
161161
convert (function): A function that converts a
162162
storage key into a string

pyomo/core/tests/unit/kernel/test_piecewise.py

+11-13
Original file line numberDiff line numberDiff line change
@@ -209,19 +209,17 @@ def test_generate_delaunay(self):
209209
vlist.append(variable(lb=0, ub=1))
210210
vlist.append(variable(lb=1, ub=2))
211211
vlist.append(variable(lb=2, ub=3))
212-
if not (util.numpy_available and util.scipy_available):
213-
with self.assertRaises(ImportError):
214-
util.generate_delaunay(vlist)
215-
else:
216-
tri = util.generate_delaunay(vlist, num=2)
217-
self.assertTrue(isinstance(tri, util.scipy.spatial.Delaunay))
218-
self.assertEqual(len(tri.simplices), 6)
219-
self.assertEqual(len(tri.points), 8)
220-
221-
tri = util.generate_delaunay(vlist, num=3)
222-
self.assertTrue(isinstance(tri, util.scipy.spatial.Delaunay))
223-
self.assertEqual(len(tri.simplices), 62)
224-
self.assertEqual(len(tri.points), 27)
212+
tri = util.generate_delaunay(vlist, num=2)
213+
self.assertTrue(isinstance(tri, util.scipy.spatial.Delaunay))
214+
self.assertEqual(len(tri.simplices), 6)
215+
self.assertEqual(len(tri.points), 8)
216+
217+
tri = util.generate_delaunay(vlist, num=3)
218+
self.assertTrue(isinstance(tri, util.scipy.spatial.Delaunay))
219+
# we got some simplices
220+
self.assertTrue(len(tri.simplices) > 1)
221+
# all the given points are accounted for
222+
self.assertEqual(len(tri.points) + len(tri.coplanar), 27)
225223

226224
#
227225
# Check cases where not all variables are bounded

pyomo/core/tests/unit/test_sets.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2979,7 +2979,7 @@ def test_initialize_and_clone_from_dict_keys(self):
29792979
#
29802980
# While deepcopying a model is generally not supported, this is
29812981
# an easy way to ensure that this simple model is cleanly
2982-
# clonable.
2982+
# able to be cloned.
29832983
ref = """1 Set Declarations
29842984
INDEX : Size=1, Index=None, Ordered=Insertion
29852985
Key : Dimen : Domain : Size : Members

pyomo/neos/tests/test_neos.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ def test_doc(self):
7979
doc = pyomo.neos.doc
8080
dockeys = set(doc.keys())
8181

82-
# Octeract interface is disabled, see #3321
83-
amplsolvers.remove('octeract')
84-
8582
self.assertEqual(amplsolvers, dockeys)
8683

8784
# gamssolvers = set(v[0].lower() for v in tmp if v[1]=='GAMS')
@@ -152,8 +149,9 @@ def test_minto(self):
152149
def test_mosek(self):
153150
self._run('mosek')
154151

155-
# [16 Jul 24] Octeract is erroring. We will disable the interface
152+
# [16 Jul 24]: Octeract is erroring. We will disable the interface
156153
# (and testing) until we have time to resolve #3321
154+
# [20 Sep 24]: and appears to have been removed from NEOS
157155
#
158156
# def test_octeract(self):
159157
# self._run('octeract')

0 commit comments

Comments
 (0)