Incompatibility between set_scaling_from_default()
and generic reaction parameter data #1364
Description
While experimenting with using the set_scaling_from_default()
method to add scaling to a model that includes a reactor, I observed the following AttributeError:
AttributeError: 'ScalarBlock' object has no attribute 'get_default_scaling'
I ran set_scaling_from_default
on my entire model, so it descended into every block in turn. Tracing the error back to its source, it appears that the problem is in how the GenericReactionParameterData
class instantiates the individual reaction blocks, named "reaction_{idx}".
These reaction blocks are created as generic Pyomo Block objects, which does not have the get_default_scaling
method defined. Instead, they should be created as ProcessBaseBlock objects, or something derived from that.
Looks like an easy 3-line fix: 2 lines to update the imports and 1 line to change the pyomo Block to an idaes ProcessBaseBlock. Happy to submit a PR if needed.