Skip to content

[PEP] Evaluate / rework pyomo.environ #3884

@mrmundt

Description

@mrmundt

Summary

We currently import a lot of symbols into pyomo.environ and then recommend to folks that they do import pyomo.environ as pyo. We aren't sure if this is what we should do moving forward.

Rationale

There were some choices that made sense in the past about namespaces that may not make sense anymore.

Description

  • All components promoted to "pyomo core" should be imported in pyomo.environ
    • DAE, GDP, etc.
    • Do an audit of pyomo.environ as part of this
    • "from pyomo.environ import DerivativeVar" vs. "from pyomo.environ.dae import DerivativeVar" vs. "import pyomo.environ as pyo; m.d = pyo.dae.DerivativeVar()"
  • Get rid of "pyomo.environ" entirely?? Auto register the plugins when pyomo is imported. "import pyomo as pyo" and leave pyomo.environ as an alias

Metadata

Metadata

Assignees

No one assigned

    Labels

    PEPpyomo7This is a label for issues targeted for the next major release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions