pyxc.core.layer_manager

Module Contents

Classes

LayerRegistry

Manages layer objects in an ordered dictionary for easy access and operation.

class pyxc.core.layer_manager.LayerRegistry[source]

Bases: collections.OrderedDict

Manages layer objects in an ordered dictionary for easy access and operation.

register(layer_object: Type[pyxc.core.layer.Layer], desired_name: str | None = None)[source]

Register a Layer object in the LayerRegistry.

The registered layer can be accessed iteratively and be manipulated using other LayerRegistry methods.

Parameters:
layer_objectLayer

Layer object to be registered.

desired_namestr, optional

Desired name of the layer. If not specified, the default name will be assigned.

Raises:
KeyError

If the layer is already registered.

ValueError

If the desired name is already occupied.

broadcast(action: str, *args, **kwargs) NoReturn[source]

Perform a specified action on all registered layers.

This function can be used to apply any method supported by the Layer class to all registered layers.

Parameters:
actionstr

Action to be performed on all registered layers.

*args

Arguments to be passed on the action.

**kwargs

Keyword arguments to be passed on the action.

scan(*desired_properties) dict[source]

Get specified properties from all registered Layer objects.

This function can be used to access any property supported by the Layer class from all registered layers.

Parameters:
*desired_propertiesstr

Properties to be accessed from all registered layers.

abstract static status_update(during_operation: str, after_completion: str = 'idle')[source]

Update the status of the LayerRegistry. Currently not implemented.

Parameters:
during_operationstr

The status during an operation.

after_completionstr

The status after the operation is completed.

request_deletion(layer_object: pyxc.core.layer.Layer) NoReturn[source]

Delete a registered layer from the LayerRegistry.

Parameters:
layer_objectLayer

Layer object to be deleted.

Raises:
KeyError

If the layer is not found in the LayerRegistry.