IDAES / idaes-pse

The IDAES Process Systems Engineering Framework
https://idaes-pse.readthedocs.io/
Other
216 stars 234 forks source link

Remove need for "default" argument when declaring models with config arguments #729

Closed andrewlee94 closed 2 years ago

andrewlee94 commented 2 years ago

It would be good to remove the need for the default argument when creating instances of IDAES mdoels. Currently, this argument is used to separate the IDAES-specific arguments (that go to the config block) from the Pyomo-specific arguments (that are used during object construction).

@jsiirola suggested that we should be able to set up an API to retrieve the expected arguments from the Pyomo objects so that we could explicitly separate these from the IDAES config arguments without the need for default.

jsiirola commented 2 years ago

@eslickj, @andrewlee94 and I worked on this this morning. We think we have a solution, but it requires pyomo/pyomo#2471

eslickj commented 2 years ago

As part of this we may want to document which keyword arguments are reserved by Block or ProcessBlock. For ProcessBlock, default (for now), initialize, and idx_map are already taken. I guess the documentation would be subject to change, so we'd either need to auto generate it or check in on it periodically. Hopfully the keyword arguments are not highly desirable model initialization arguments and things people are not likely to use anyway.

We could also run a check on this and raise an exception it there is a conflict.