spines.parameters.store

Parameter storage module.

class spines.parameters.store.ParameterStore[source]

Bases: collections.abc.MutableMapping

Helper class for managing collections of Parameters.

add(parameter: Type[spines.parameters.base.Parameter]) → None[source]

Add a Parameter specification to this store

Parameters

option (Parameter) – Parameter specification to add to this parameter store.

Raises

ParameterExistsError – If a parameter option with the same name already exists.

copy(deep: bool = False) → Type[spines.parameters.store.ParameterStore][source]

Returns a copy of this parameter store object.

Parameters

deep (bool, optional) – Whether or not to do deep-copying of this stores contents.

Returns

Copied parameter store object.

Return type

ParameterStore

final

Whethor or not this set of parameters is finalized.

Type

bool

finalize() → None[source]

Finalizes the parameters stored

Raises

MissingParameterException – If a required parameter is not set.

parameters

Copy of the current set of parameters.

Type

dict

remove(name: str) → spines.parameters.base.Parameter[source]

Removes a Parameter specification

Parameters

name (str) – Name of the Parameter to remove.

Returns

The removed Parameter specified.

Return type

Parameter

Raises

KeyError – If the given name does not exist.

reset() → None[source]

Clears all of the parameters and options stored.

valid

Whether or not this is a fully valid set of parameters.

Type

bool

values

Copy of the current set of parameter values.

Type

dict

spines.parameters.store.state_changed(func)[source]

Decorator indicating a function which changes the state

Parameters

func (callable) – The function to wrap.

Returns

The wrapped function.

Return type

callable