Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional packages coinbrew, mibs, pao, pyomo #36404

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented Oct 5, 2023

@xuluze

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

@xuluze
Copy link
Contributor

xuluze commented Oct 5, 2023

pao depends on module pyutilib.

sage: from pao.pyomo import *
...
ModuleNotFoundError: No module named 'pyutilib'

I can run the simple example with some deprecation warning:

sage: import pyomo.environ as pe
xxx/mambaforge/envs/sage-mibs/lib/python3.11/site-packages/pyutilib/misc/import_file.py:11: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
  import imp
sage: from pao.pyomo import *
WARNING: DEPRECATED: add_docstring_list is deprecated.  Please use the
@document_kwargs_from_configdict() decorator.  (deprecated in 6.6.0) (called
from xxx/mambaforge/envs/sage-mibs/lib/python3.11/site-
packages/pao/common/solver.py:189)
sage: M = pe.ConcreteModel()
sage: M.x = pe.Var(bounds=(0,None))
....: M.y = pe.Var(bounds=(0,None))
sage: M.o = pe.Objective(expr=M.x - 4*M.y)
WARNING: Dynamically registering the following numeric type:
        sage.rings.integer.Integer
    Dynamic registration is supported for convenience, but there are known
    limitations to this approach.  We recommend explicitly registering numeric
    types using RegisterNumericType() or RegisterIntegerType().
sage: M.L = SubModel(fixed=M.x)
sage: M.L.o = pe.Objective(expr=M.y)
sage: M.L.c1 = pe.Constraint(expr=   -M.x -   M.y <= -3)
sage: M.L.c2 = pe.Constraint(expr= -2*M.x +   M.y <=  0)
sage: M.L.c3 = pe.Constraint(expr=  2*M.x +   M.y <= 12)
sage: M.L.c4 = pe.Constraint(expr=  3*M.x - 2*M.y <=  4)
sage: with Solver('pao.pyomo.FA') as solver: results = solver.solve(M)
sage: print(M.x.value)
4.0
sage: print(M.y.value)
4.0

If I replace it with Solver('pao.pyomo.MIBS'), it just output 0.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 5, 2023

I think this may be the same as:

Copy link

Documentation preview for this PR (built with commit 4f76fb8; changes) is ready! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants