Skip to content

property_mixin

PropertyMixin

Utility class for adding property setters to a class. This adds functionality for set_property and set_properties to classes.

A property is passed as a pair containing the property name and its value. The property name is looked up in the class attributes. If it is found, its setter method will be called with the new value.

Note

This class is not meant to be used directly. Only inherit from this base class.

set_properties(*args, **kwargs)

Call setter methods of properties by either passing a dictionary of properties or each property seperately as a keyword argument

Returns:

Type Description
Self

self

set_property(key, value)

Set a single property. The function first checks if graph has said property, if it does not, a warning is logged.

Parameters:

Name Type Description Default
key str

the property name

required
value Object

the property value (usually a float)

required

Returns:

Type Description
Self

self