Skip to content

Commit

Permalink
Merge pull request #1 from bknueven/pynumero-remove-fixed-variables-c…
Browse files Browse the repository at this point in the history
…heck

Removing redundant check and adding test
  • Loading branch information
carldlaird committed Nov 11, 2021
2 parents 74acde0 + 2db46e1 commit 5863edc
Show file tree
Hide file tree
Showing 142 changed files with 5,426 additions and 2,358 deletions.
1 change: 1 addition & 0 deletions doc/OnlineDocs/library_reference/solvers/index.rst
Expand Up @@ -7,3 +7,4 @@ Solver Interfaces
gams.rst
cplex_persistent.rst
gurobi_persistent.rst
xpress_persistent.rst
@@ -0,0 +1,7 @@
XpressPersistent
================

.. autoclass:: pyomo.solvers.plugins.solvers.xpress_persistent.XpressPersistent
:members:
:inherited-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions doc/OnlineDocs/modeling_extensions/gdp/modeling.rst
Expand Up @@ -254,7 +254,7 @@ Here, we demonstrate this capability with a toy example:

>>> # Before solve, Boolean vars have no value
>>> Reference(m.d[:].indicator_var).display()
IndexedBooleanVar : Size=4, Index=s
IndexedBooleanVar : Size=4, Index=s, ReferenceTo=d[:].indicator_var
Key : Value : Fixed : Stale
1 : None : False : True
2 : None : False : True
Expand All @@ -265,7 +265,7 @@ Here, we demonstrate this capability with a toy example:
>>> # based on the algebraic model results
>>> run_data = SolverFactory('glpk').solve(m)
>>> Reference(m.d[:].indicator_var).display()
IndexedBooleanVar : Size=4, Index=s
IndexedBooleanVar : Size=4, Index=s, ReferenceTo=d[:].indicator_var
Key : Value : Fixed : Stale
1 : True : False : False
2 : False : False : False
Expand Down
6 changes: 3 additions & 3 deletions doc/OnlineDocs/related_packages.rst
Expand Up @@ -44,14 +44,14 @@ Domain-Specific Applications
+==========================+=========================================================+=============================================+
| Chama | https://github.com/sandialabs/chama | Sensor placement optimization |
+--------------------------+---------------------------------------------------------+---------------------------------------------+
| Egret | https://github.com/grid-parity-exchange/egret | Formulation and solution of Unit Commitment|
| Egret | https://github.com/grid-parity-exchange/egret | Formulation and solution of unit commitment|
| | | and optimal power flow problems |
+--------------------------+---------------------------------------------------------+---------------------------------------------+
| IDAES | https://github.com/idaes/idaes-pse | Institute for the Design of Advanced |
| | | Energy Systems |
+--------------------------+---------------------------------------------------------+---------------------------------------------+
| Prescient | https://github.com/grid-parity-exchange/prescient | Parallel solution of structured |
| | | NLPs. |
| Prescient | https://github.com/grid-parity-exchange/prescient | Production Cost Model for power systems |
| | | simulation and analysis |
+--------------------------+---------------------------------------------------------+---------------------------------------------+
| PyPSA | https://github.com/pypsa/pypsa | Python for Power system Analysis |
+--------------------------+---------------------------------------------------------+---------------------------------------------+
Expand Down
3 changes: 3 additions & 0 deletions examples/pyomobook/test_book_examples.py
Expand Up @@ -58,6 +58,7 @@
'test_dae_ch_run_path_constraint_tester': ['ipopt'],

# gdp_ch
'test_gdp_ch_pyomo_gdp_uc_sh': ['glpk'],
'test_gdp_ch_pyomo_scont': ['glpk'],
'test_gdp_ch_pyomo_scont2': ['glpk'],
'test_gdp_ch_scont_script': ['glpk'],
Expand Down Expand Up @@ -386,6 +387,8 @@ def compare_files(out_file, base_file, abstol, reltol,
else:
extra = out_filtered
n = index_of_base_i_in_out
if n == float('inf'):
n = None
extra_terms = extra[i:n]
try:
assert len(extra_terms) % 3 == 0
Expand Down
36 changes: 23 additions & 13 deletions pyomo/contrib/gdpopt/GDPopt.py
Expand Up @@ -57,7 +57,8 @@
doc='The GDPopt decomposition-based '
'Generalized Disjunctive Programming (GDP) solver')
class GDPoptSolver(object):
"""Decomposition solver for Generalized Disjunctive Programming (GDP) problems.
"""Decomposition solver for Generalized Disjunctive Programming (GDP)
problems.
The GDPopt (Generalized Disjunctive Programming optimizer) solver applies a
variety of decomposition-based approaches to solve Generalized Disjunctive
Expand All @@ -71,8 +72,8 @@ class GDPoptSolver(object):
- Partial surrogate cuts [pending]
- Generalized Bender decomposition [pending]
This solver implementation was developed by Carnegie Mellon University in the
research group of Ignacio Grossmann.
This solver implementation was developed by Carnegie Mellon University in
the research group of Ignacio Grossmann.
For nonconvex problems, LOA may not report rigorous lower/upper bounds.
Expand Down Expand Up @@ -179,14 +180,22 @@ def _log_solver_intro_message(self, config):
config.nlp_solver_args.display(ostream=nlp_args_output)
config.minlp_solver_args.display(ostream=minlp_args_output)
config.local_minlp_solver_args.display(ostream=lminlp_args_output)
mip_args_text = indent(mip_args_output.getvalue().rstrip(), prefix=" " * 2 + " - ")
nlp_args_text = indent(nlp_args_output.getvalue().rstrip(), prefix=" " * 2 + " - ")
minlp_args_text = indent(minlp_args_output.getvalue().rstrip(), prefix=" " * 2 + " - ")
lminlp_args_text = indent(lminlp_args_output.getvalue().rstrip(), prefix=" " * 2 + " - ")
mip_args_text = "" if len(mip_args_text.strip()) == 0 else "\n" + mip_args_text
nlp_args_text = "" if len(nlp_args_text.strip()) == 0 else "\n" + nlp_args_text
minlp_args_text = "" if len(minlp_args_text.strip()) == 0 else "\n" + minlp_args_text
lminlp_args_text = "" if len(lminlp_args_text.strip()) == 0 else "\n" + lminlp_args_text
mip_args_text = indent(mip_args_output.getvalue().rstrip(), prefix=" " *
2 + " - ")
nlp_args_text = indent(nlp_args_output.getvalue().rstrip(), prefix=" " *
2 + " - ")
minlp_args_text = indent(minlp_args_output.getvalue().rstrip(),
prefix=" " * 2 + " - ")
lminlp_args_text = indent(lminlp_args_output.getvalue().rstrip(),
prefix=" " * 2 + " - ")
mip_args_text = "" if len(mip_args_text.strip()) == 0 else \
"\n" + mip_args_text
nlp_args_text = "" if len(nlp_args_text.strip()) == 0 else \
"\n" + nlp_args_text
minlp_args_text = "" if len(minlp_args_text.strip()) == 0 else \
"\n" + minlp_args_text
lminlp_args_text = "" if len(lminlp_args_text.strip()) == 0 else \
"\n" + lminlp_args_text
config.logger.info(
"""
Subsolvers:
Expand All @@ -209,7 +218,7 @@ def _log_solver_intro_message(self, config):
If you use this software, you may cite the following:
- Implementation:
Chen, Q; Johnson, ES; Siirola, JD; Grossmann, IE.
Pyomo.GDP: Disjunctive Models in Python.
Pyomo.GDP: Disjunctive Models in Python.
Proc. of the 13th Intl. Symposium on Process Systems Eng.
San Diego, 2018.
""".strip()
Expand All @@ -227,7 +236,8 @@ def _log_solver_intro_message(self, config):
to_cite_text += """
- GLOA algorithm:
Lee, S; Grossmann, IE.
A Global Optimization Algorithm for Nonconvex Generalized Disjunctive Programming and Applications to Process Systems.
A Global Optimization Algorithm for Nonconvex Generalized Disjunctive
Programming and Applications to Process Systems.
Comp. and Chem. Eng. 2001, 25, 1675-1697.
DOI: 10.1016/S0098-1354(01)00732-3.
""".strip()
Expand Down

0 comments on commit 5863edc

Please sign in to comment.