Skip to content

Commit 095a6ed

Browse files
authored
Merge pull request #3463 from jsiirola/qt-test-fix
2025 Testing update: Black 25.1.0, testing Qt withough X11
2 parents aa652ca + 3a0cf09 commit 095a6ed

32 files changed

+46
-46
lines changed

examples/gdp/circles/circles.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# ___________________________________________________________________________
1111

1212
"""
13-
The "circles" GDP example problem originating in Lee and Grossman (2000). The
14-
goal is to choose a point to minimize a convex quadratic function over a set of
13+
The "circles" GDP example problem originating in Lee and Grossman (2000). The
14+
goal is to choose a point to minimize a convex quadratic function over a set of
1515
disjoint hyperspheres.
1616
"""
1717

examples/gdp/farm_layout/farm_layout.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
"""
1313
Farm layout example from Sawaya (2006). The goal is to determine optimal placements and dimensions for farm
14-
plots of specified areas to minimize the perimeter of a minimal enclosing fence. This is a GDP problem with
15-
some hyperbolic constraints to establish consistency of areas with length and width. The FLay05 and FLay06
16-
instances may take some time to solve; the others should be fast. Note that the Sawaya paper contains a
17-
little bit of nonclarity: it references "height" variables which do not exist - we use "length" for the x-axis
14+
plots of specified areas to minimize the perimeter of a minimal enclosing fence. This is a GDP problem with
15+
some hyperbolic constraints to establish consistency of areas with length and width. The FLay05 and FLay06
16+
instances may take some time to solve; the others should be fast. Note that the Sawaya paper contains a
17+
little bit of nonclarity: it references "height" variables which do not exist - we use "length" for the x-axis
1818
and "width" on the y-axis, and it also is unclear on the way the coordinates define the rectangles; we have
1919
decided that they are on the bottom-left and adapted the disjunction constraints to match.
2020
"""

examples/gdp/nine_process/small_process.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
# This software is distributed under the 3-clause BSD License.
1010
# ___________________________________________________________________________
1111

12-
"""Small process synthesis-inspired toy GDP example.
13-
14-
"""
12+
"""Small process synthesis-inspired toy GDP example."""
1513

1614
from pyomo.core import ConcreteModel, RangeSet, Var, Constraint, Objective
1715
from pyomo.core.expr.current import exp, log, sqrt

examples/gdp/small_lit/basic_step.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
# This software is distributed under the 3-clause BSD License.
1010
# ___________________________________________________________________________
1111

12-
""" Example from Section 3.2 in paper of Pseudo Basic Steps
12+
"""Example from Section 3.2 in paper of Pseudo Basic Steps
1313
1414
Ref:
15-
Pseudo basic steps: bound improvement guarantees from Lagrangian
15+
Pseudo basic steps: bound improvement guarantees from Lagrangian
1616
decomposition in convex disjunctive programming
1717
Papageorgiou and Trespalacios, 2017
1818

examples/pyomo/columngeneration/cutting_stock.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
Bradley, S.P., A.C. Hax, and T.L. Magnanti. 1977. Applied Mathematical Programming,
1717
Addison-Wesley, Reading, MA. Available: http://web.mit.edu/15.053/www/AMP.htm.
1818
19-
Data from https://en.wikipedia.org/wiki/Cutting_stock_problem
19+
Data from https://en.wikipedia.org/wiki/Cutting_stock_problem
2020
'''
2121

2222
import pyomo.environ as pyo

examples/pyomo/sos/sos2_piecewise.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
# ___________________________________________________________________________
1111

1212
"""
13-
This example shows how to represent a piecewise function using
13+
This example shows how to represent a piecewise function using
1414
Pyomo's built SOSConstraint component. The function is defined as:
1515
1616
/ 3x-2 , 1 <= x <= 2
17-
f(x) = |
17+
f(x) = |
1818
\ 5x-6 , 2 <= x <= 3
1919
"""
2020

pyomo/common/tests/test_config.py

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def _display(obj, *args):
8888

8989
class GlobalClass(object):
9090
"test class for test_known_types"
91+
9192
pass
9293

9394

pyomo/contrib/community_detection/event_log.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# This software is distributed under the 3-clause BSD License.
1010
# ___________________________________________________________________________
1111

12-
""" Logger function for community_graph.py """
12+
"""Logger function for community_graph.py"""
1313

1414
from logging import getLogger
1515
from pyomo.core import Constraint, Objective, Var

pyomo/contrib/incidence_analysis/config.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
# rights in this software.
99
# This software is distributed under the 3-clause BSD License.
1010
# ___________________________________________________________________________
11-
"""Configuration options for incidence graph generation
12-
"""
11+
"""Configuration options for incidence graph generation"""
1312

1413
import enum
1514
from pyomo.common.config import ConfigDict, ConfigValue, InEnum

pyomo/contrib/incidence_analysis/incidence.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
# rights in this software.
99
# This software is distributed under the 3-clause BSD License.
1010
# ___________________________________________________________________________
11-
"""Functionality for identifying variables that participate in expressions
12-
"""
11+
"""Functionality for identifying variables that participate in expressions"""
1312

1413
from contextlib import nullcontext
1514

pyomo/contrib/incidence_analysis/visualize.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
# rights in this software.
99
# This software is distributed under the 3-clause BSD License.
1010
# ___________________________________________________________________________
11-
"""Module for visualizing results of incidence graph or matrix analysis
12-
13-
"""
11+
"""Module for visualizing results of incidence graph or matrix analysis"""
1412
from pyomo.contrib.incidence_analysis.config import IncidenceOrder
1513
from pyomo.contrib.incidence_analysis.interface import (
1614
IncidenceGraphInterface,

pyomo/contrib/mindtpy/tests/MINLP4_simple.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# ___________________________________________________________________________
1111

1212
# -*- coding: utf-8 -*-
13-
""" Example 1 in Paper 'Using regularization and second order information in outer approximation for convex MINLP'
13+
"""Example 1 in Paper 'Using regularization and second order information in outer approximation for convex MINLP'
1414
1515
The expected optimal solution value is -56.981.
1616

pyomo/contrib/mindtpy/tests/constraint_qualification_example.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# ___________________________________________________________________________
1111

1212
# -*- coding: utf-8 -*-
13-
""" Example of constraint qualification.
13+
"""Example of constraint qualification.
1414
1515
The expected optimal solution value is 3.
1616

pyomo/contrib/mindtpy/tests/online_doc_example.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# This software is distributed under the 3-clause BSD License.
1010
# ___________________________________________________________________________
1111

12-
""" Example in the online doc.
12+
"""Example in the online doc.
1313
1414
The expected optimal solution value is 2.438447187191098.
1515

pyomo/contrib/parmest/examples/reaction_kinetics/simple_reaction_parmest_example.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# rights in this software.
99
# This software is distributed under the 3-clause BSD License.
1010
# ___________________________________________________________________________
11-
'''
11+
'''
1212
Example from Y. Bard, "Nonlinear Parameter Estimation", (pg. 124)
1313
1414
This example shows:

pyomo/contrib/parmest/examples/rooney_biegler/rooney_biegler.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# ___________________________________________________________________________
1111

1212
"""
13-
Rooney Biegler model, based on Rooney, W. C. and Biegler, L. T. (2001). Design for
14-
model parameter uncertainty using nonlinear confidence regions. AIChE Journal,
13+
Rooney Biegler model, based on Rooney, W. C. and Biegler, L. T. (2001). Design for
14+
model parameter uncertainty using nonlinear confidence regions. AIChE Journal,
1515
47(8), 1794-1804.
1616
"""
1717

pyomo/contrib/parmest/examples/semibatch/parallel_example.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# ___________________________________________________________________________
1111

1212
"""
13-
The following script can be used to run semibatch parameter estimation in
13+
The following script can be used to run semibatch parameter estimation in
1414
parallel and save results to files for later analysis and graphics.
1515
Example command: mpiexec -n 4 python parallel_example.py
1616
"""

pyomo/contrib/parmest/examples/semibatch/semibatch.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
# This software is distributed under the 3-clause BSD License.
1010
# ___________________________________________________________________________
1111
"""
12-
Semibatch model, based on Nicholson et al. (2018). pyomo.dae: A modeling and
12+
Semibatch model, based on Nicholson et al. (2018). pyomo.dae: A modeling and
1313
automatic discretization framework for optimization with di
14-
erential and
14+
erential and
1515
algebraic equations. Mathematical Programming Computation, 10(2), 187-223.
1616
"""
1717
import json

pyomo/contrib/sensitivity_toolbox/examples/rooney_biegler.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
# at the URL "https://github.com/IDAES/idaes-pse".
2323
##############################################################################
2424
"""
25-
Rooney Biegler model, based on Rooney, W. C. and Biegler, L. T. (2001). Design for
26-
model parameter uncertainty using nonlinear confidence regions. AIChE Journal,
25+
Rooney Biegler model, based on Rooney, W. C. and Biegler, L. T. (2001). Design for
26+
model parameter uncertainty using nonlinear confidence regions. AIChE Journal,
2727
47(8), 1794-1804.
2828
"""
2929
from pyomo.common.dependencies import pandas as pd

pyomo/contrib/sensitivity_toolbox/tests/test_k_aug_interface.py

-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
# This software is distributed under the 3-clause BSD License.
2121
# ____________________________________________________________________________
2222

23-
"""
24-
"""
2523
import os
2624
import pyomo.common.unittest as unittest
2725
from io import StringIO

pyomo/contrib/viewer/qt.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# ___________________________________________________________________________
2222

2323
"""
24-
Try to import PySide6, which is the current official Qt 6 Python interface. Then,
24+
Try to import PySide6, which is the current official Qt 6 Python interface. Then,
2525
try PyQt5 if that doesn't work. If no compatible Qt Python interface is found,
2626
use some dummy classes to allow some testing.
2727
"""

pyomo/contrib/viewer/tests/test_qt.py

+7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
"""
2424
UI Tests
2525
"""
26+
# The pytest-qt plugin can generate exceptions / core dumps when it is
27+
# run in a terminal (without an active X11 screen). Setting the
28+
# QT_QPA_PLATFORM environment variable *before* initializing Qt can work
29+
# around this error (see https://stackoverflow.com/a/74719383):
30+
import os
31+
32+
os.environ['QT_QPA_PLATFORM'] = 'offscreen'
2633

2734
from pyomo.environ import (
2835
ConcreteModel,

pyomo/solvers/plugins/solvers/mosek_direct.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ def _warm_start(self):
10681068
for pyomo_var, mosek_var in self._pyomo_var_to_solver_var_map.items():
10691069
if pyomo_var.value is not None:
10701070
self._solver_model.putxxslice(
1071-
self._whichsol, mosek_var, mosek_var + 1, [(pyomo_var.value)]
1071+
self._whichsol, mosek_var, mosek_var + 1, [pyomo_var.value]
10721072
)
10731073

10741074
if (self._version[0] > 9) & (self._whichsol == mosek.soltype.itg):

pyomo/solvers/tests/piecewise_linear/problems/concave_multi_vararray1.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| 7x+12 , -4 <= x <= -3
1515
| 5x+6 , -3 <= x <= -2
1616
| 3x+2 , -2 <= x <= -1
17-
f(x) = | 1 , -1 <= x <= 1
17+
f(x) = | 1 , -1 <= x <= 1
1818
| -3x+2 , 1 <= x <= 2
1919
| -5x+6 , 2 <= x <= 3
2020
\ -7x+12, 3 <= x <= 4

pyomo/solvers/tests/piecewise_linear/problems/concave_multi_vararray2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| 7x+12 , -4 <= x <= -3
1515
| 5x+6 , -3 <= x <= -2
1616
| 3x+2 , -2 <= x <= -1
17-
f(x) = | 1 , -1 <= x <= 1
17+
f(x) = | 1 , -1 <= x <= 1
1818
| -3x+2 , 1 <= x <= 2
1919
| -5x+6 , 2 <= x <= 3
2020
\ -7x+12, 3 <= x <= 4

pyomo/solvers/tests/piecewise_linear/problems/concave_var.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| 7x+12 , -4 <= x <= -3
1515
| 5x+6 , -3 <= x <= -2
1616
| 3x+2 , -2 <= x <= -1
17-
f(x) = | 1 , -1 <= x <= 1
17+
f(x) = | 1 , -1 <= x <= 1
1818
| -3x+2 , 1 <= x <= 2
1919
| -5x+6 , 2 <= x <= 3
2020
\ -7x+12, 3 <= x <= 4

pyomo/solvers/tests/piecewise_linear/problems/concave_vararray.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| 7x+12 , -4 <= x <= -3
1515
| 5x+6 , -3 <= x <= -2
1616
| 3x+2 , -2 <= x <= -1
17-
f(x) = | 1 , -1 <= x <= 1
17+
f(x) = | 1 , -1 <= x <= 1
1818
| -3x+2 , 1 <= x <= 2
1919
| -5x+6 , 2 <= x <= 3
2020
\ -7x+12, 3 <= x <= 4

pyomo/solvers/tests/piecewise_linear/problems/convex_multi_vararray1.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| -7x-12, -4 <= x <= -3
1515
| -5x-6 , -3 <= x <= -2
1616
| -3x-2 , -2 <= x <= -1
17-
f(x) = | 1 , -1 <= x <= 1
17+
f(x) = | 1 , -1 <= x <= 1
1818
| 3x-2 , 1 <= x <= 2
1919
| 5x-6 , 2 <= x <= 3
2020
\ 7x-12 , 3 <= x <= 4

pyomo/solvers/tests/piecewise_linear/problems/convex_multi_vararray2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| -7x-12, -4 <= x <= -3
1515
| -5x-6 , -3 <= x <= -2
1616
| -3x-2 , -2 <= x <= -1
17-
f(x) = | 1 , -1 <= x <= 1
17+
f(x) = | 1 , -1 <= x <= 1
1818
| 3x-2 , 1 <= x <= 2
1919
| 5x-6 , 2 <= x <= 3
2020
\ 7x-12 , 3 <= x <= 4

pyomo/solvers/tests/piecewise_linear/problems/convex_var.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| -7x-12, -4 <= x <= -3
1515
| -5x-6 , -3 <= x <= -2
1616
| -3x-2 , -2 <= x <= -1
17-
f(x) = | 1 , -1 <= x <= 1
17+
f(x) = | 1 , -1 <= x <= 1
1818
| 3x-2 , 1 <= x <= 2
1919
| 5x-6 , 2 <= x <= 3
2020
\ 7x-12 , 3 <= x <= 4

pyomo/solvers/tests/piecewise_linear/problems/convex_vararray.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| -7x-12, -4 <= x <= -3
1515
| -5x-6 , -3 <= x <= -2
1616
| -3x-2 , -2 <= x <= -1
17-
f(x) = | 1 , -1 <= x <= 1
17+
f(x) = | 1 , -1 <= x <= 1
1818
| 3x-2 , 1 <= x <= 2
1919
| 5x-6 , 2 <= x <= 3
2020
\ 7x-12 , 3 <= x <= 4

pyomo/util/check_units.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# __________________________________________________________________________
1111
#
1212
#
13-
""" Pyomo Units Checking Module
13+
"""Pyomo Units Checking Module
1414
This module has some helpful methods to support checking units on Pyomo
1515
module objects.
1616
"""

0 commit comments

Comments
 (0)