pyomo icon indicating copy to clipboard operation
pyomo copied to clipboard

[PEP]: Global Pyomo Config File

Open mrmundt opened this issue 11 months ago • 2 comments

Summary

We have been having discussions in our weekly dev calls about introducing a "global config file" feature that would allow users to save their preferred/default configurations.

Rationale

We do not currently have any feature to allow users to "save" their common configuration options. We think this would be a quality of life update.

Description

Users can make their own configuration file and pass it into Pyomo, which will use any option in the config file rather than built-in defaults (e.g., could change the default solver to ipopt or sense to maximize; can pass in options that they regularly prefer such as tee=True).

Additional information

mrmundt avatar Mar 24 '25 14:03 mrmundt

It would also make sense as part of this to create a doc page that contains a list of pre-defined defaults such as:

  • Default solver: glpk (really? why?)
  • Sets: ordered = True
  • Objectives: sense = minimize
  • Suffixes: LOCAL; FLOAT
  • Expressions: algebraic form string representation
  • What are the defaults for var domains and bounds? They aren't documented at all
  • Ditto for Params / Constraints / SOS: is there anything important to note about defaults here?

mrmundt avatar Mar 24 '25 14:03 mrmundt

This is a good thing to do! Regarding your questions:

  • The default Var domain is Reals, with lb and ub both None.
  • The default Param domain is currently Any, though that's deprecated--the plan is for it to be Reals. And the default value is None. (For the record, we deprecated in 5.6.9 and said we were going to make the change in or after 6.0, so we could actually do it...)

emma58 avatar Mar 24 '25 15:03 emma58