mechmat.core package

Submodules

mechmat.core.chainable module

class mechmat.core.chainable.Chainable(**kwargs)[source]

Bases: object

” A linked attribute class

Link a Linked attribute against another Linked attribute.

Args:

attr (str): Attribute name transform: The function which provides the transform. **kwargs: the transform function keywords where the value is either a str (if the attribute can be obtained

from the own instance) or a tuple containing the other instance and attribute name.

linked_transforms(attr)[source]
set_guard(attr, unit=None, rng=None, doc=None)[source]

Set the guard descriptor unit and range, this is usually set in the __init__() function

Args:

attr (str): The guard attribute to be set unit (ureg.Unit): The unit in which guarded inputs are to be converted rng (tuple, list, np.array): The range [low, high] against which to test doc (str): dosctring

class mechmat.core.chainable.Guarded[source]

Bases: object

Descriptor guarding Linked attributes

static cite_value(value)[source]
static in_range(value, rng)[source]

is value in specified range

Args:

value: value to be tested rng: tuple or list to be tested against

Returns:

true when in range otherwise false

class mechmat.core.chainable.Message[source]

Bases: set

Linked Message

mechmat.core.errors module

exception mechmat.core.errors.OutOfRangeError(value, rng, property)[source]

Bases: ValueError

Raised when trying to set an out-of-range value

Module contents