eradiate.scenes.core.SceneElement#

class eradiate.scenes.core.SceneElement(id=None)[source]#

Bases: ABC

Abstract base class for all scene elements.

Parameters:

id (str, optional) – Identifier of the current scene element.

Fields:

id (str or None) – Identifier of the current scene element.

Warning

All subclasses must have a hash, thus eq must be False (see attrs docs on hashing for a complete explanation). This is required in order to make it possible to use caching decorators on instance methods.

Notes

The default implementation of __attrs_post_init__() executes the update() method.

abstract traverse(callback)[source]#

Traverse this scene element and collect kernel dictionary template and parameter update map contributions.

Parameters:

callback (SceneTraversal) – Callback data structure storing the collected data.

update()[source]#

Enforce internal state consistency. This method should be called when fields are modified. It is automatically called as a post-init step.

property params#
Returns:

dict[str, UpdateParameter] or None – A dictionary mapping parameter paths, consisting of dot-separated strings, to a corresponding update protocol.