3.1.2.2. opengate.base
¶
3.1.2.2.1. Module Contents¶
3.1.2.2.1.1. Classes¶
3.1.2.2.1.2. Functions¶
|
Digest the class's user_infos and store the augmented class |
|
|
|
|
|
Add user_info defaults as properties to class if not yet present. |
|
Return a property that stores the user_info item in a |
|
|
|
|
|
Convenience function to avoid redundant code. |
Walk recursively across entries of user_info and convert to appropriate structure. |
|
|
|
|
|
|
|
|
Utility function to retrieve the options associated with a user info given the class name, |
Function to (re-)create an object derived from GateObject based on a dictionary. |
- opengate.base.process_cls(cls)[source]¶
Digest the class’s user_infos and store the augmented class in a dictionary inside the meta class which handles the class creation. Note: type(cls) yields the meta class MetaUserInfo or MetaUserInfoSingleton, depending on the class in question (e.g. GateObject, GateObjectSingleton).
- opengate.base.add_properties_to_class(cls, user_info_defaults)[source]¶
Add user_info defaults as properties to class if not yet present.
- opengate.base._make_property(property_name, options=None, container_dict=None)[source]¶
Return a property that stores the user_info item in a dictionary which is an attribute of the object (self).
- opengate.base.attach_methods(GateObjectClass)[source]¶
Convenience function to avoid redundant code. Can be used to add common methods to classes that differ otherwise, e.g. GateObject and GateObjectSingleton.
- class opengate.base.DynamicGateObject[source]¶
Bases:
GateObject
- _add_dynamic_parametrisation_to_userinfo(params, name)[source]¶
This base class implementation only acts as a setter. Classes inheriting from this class should implement an add_dynamic_parametrisation() method which actually does something with the parameters and then call super().add_dynamic_parametrisation(). Inheriting classes should avoid calling this method directly.
- opengate.base.recursive_userinfo_to_dict(obj)[source]¶
Walk recursively across entries of user_info and convert to appropriate structure. Dictionary-like structures are mapped to dictionary and walked across recursively. List-like structures are mapped to lists and walked across recursively. GateObject-like objects are converted through their to_dictionary() method. All other input (presumably common data types including numpy structures) is left untouched.