Miscellaneous Utility Methods#
Other Utility Methods#
This library also contains a number of other utility methods that do not fall under another category.
- idaes.core.util.misc.add_object_reference(self, local_name, remote_object)[source]#
Method to create a reference in the local model to a remote Pyomo object. This method should only be used where Pyomo Reference objects are not suitable (such as for referencing scalar Pyomo objects where the None index is undesirable).
- Parameters:
local_name – name to use for local reference (str)
remote_object – object to make a reference to
- Returns:
None
- idaes.core.util.misc.extract_data(data_dict)[source]#
General method that returns a rule to extract data from a python dictionary. This method allows the param block to have a database for a parameter but extract a subset of this data to initialize a Pyomo param object.
- idaes.core.util.misc.set_param_from_config(b, param, config=None, index=None)[source]#
Utility method to set parameter value from a config block. This allows for converting units if required. This method directly sets the value of the parameter.
This method supports three forms for defining the parameter value:
1. a 2-tuple of the form (value, units) where units are the units that the value are defined in 2. a float where the float is assumed to be the value of the parameter value in the base units of the property package 3. a Python Class which has a get_parameter_value method which will return a 2-tuple of (value, units) based on a lookup of the parameter name
- Parameters:
defined (b - block on which parameter and config block are)
arg (param - name of parameter as str. Used to find param and config)
object (units - units of param)
- (index) – unset, assumes b.config.
- – property may have multiple parameters associated with it.
- Returns:
None