engforge.system_reference

Module to define the Ref class and utility methods for working with it.

Ref’s are designed to create adhoc links between the systems & components of the system, and their properties. This is useful for creating optimization problems, and for creating dynamic links between the state and properties of the system. Care must be used on the component objects changing of state, the recommened procedure is to copy your base system to prevent hysterisis and other issues, then push/pop X values through the optimization methods and change state upon success

Ref.component can be a Component,System or dictionary for referencing via keyword. Ref.key can be a string or a callable, if callable the ref will be evaluated as the result of the callable (allow_set=False), this renders the component unused, and disables the ability to set the value of the reference.

Functions

eval_ref

maybe_attr_inst

returns the ref if is one otherwise convert it, otherwise returns the value

maybe_ref

returns the value of a ref if it is a ref, otherwise returns the value

refset_get

refset_input

change a set of refs with a dictionary of values.

scale_val

Classes

Ref

A way to create portable references to system's and their component's properties, ref can also take a key to a zero argument function which will be evald.

RefLog

Initialize a filter.