firecrown.updatable.UpdatableCollection#

class firecrown.updatable.UpdatableCollection(iterable=None)[source]#

Bases: UserList[T], Generic[T]

Class that represents a collection of updatable objects.

UpdatableCollection is a list of Updatable objects and is itself supports update() and reset() (although it does not inherit from Updatable).

Every item in an UpdatableCollection must itself be Updatable. Calling update() on the collection results in every item in the collection being updated.

Parameters:

iterable (Optional[Iterable[TypeVar(T, bound= Updatable)]]) –

Public Methods:

__init__([iterable])

Initialize the UpdatableCollection from the supplied iterable.

update(params)

Update self by calling update() on each contained item.

is_updated()

Returns whether this updatable has been updated.

reset()

Resets self by calling reset() on each contained item.

required_parameters()

Return a RequiredParameters object.

get_derived_parameters()

Get all derived parameters if any.

append(item)

Append the given item to self.

__setitem__(key, value)

Set self[key] to value; raise TypeError if Value is not Updatable.

Inherited from UserList

__init__([initlist])

__repr__()

Return repr(self).

__lt__(other)

Return self<value.

__le__(other)

Return self<=value.

__eq__(other)

Return self==value.

__gt__(other)

Return self>value.

__ge__(other)

Return self>=value.

__contains__(item)

__len__()

__getitem__(i)

__setitem__(i, item)

__delitem__(i)

__add__(other)

__radd__(other)

__iadd__(other)

__mul__(n)

__rmul__(n)

__imul__(n)

__copy__()

append(item)

S.append(value) -- append value to the end of the sequence

insert(i, item)

S.insert(index, value) -- insert value before index

pop([index])

Raise IndexError if list is empty or index is out of range.

remove(item)

S.remove(value) -- remove first occurrence of value.

clear()

copy()

count(value)

index(value, [start, [stop]])

Raises ValueError if the value is not present.

reverse()

S.reverse() -- reverse IN PLACE

sort(*args, **kwds)

extend(other)

S.extend(iterable) -- extend sequence by appending elements from the iterable

Inherited from MutableSequence

__setitem__(index, value)

__delitem__(index)

insert(index, value)

S.insert(index, value) -- insert value before index

append(value)

S.append(value) -- append value to the end of the sequence

clear()

reverse()

S.reverse() -- reverse IN PLACE

extend(values)

S.extend(iterable) -- extend sequence by appending elements from the iterable

pop([index])

Raise IndexError if list is empty or index is out of range.

remove(value)

S.remove(value) -- remove first occurrence of value.

__iadd__(values)

Inherited from Sequence

__getitem__(index)

__iter__()

__contains__(value)

__reversed__()

index(value, [start, [stop]])

Raises ValueError if the value is not present.

count(value)

Inherited from Reversible

__reversed__()

__subclasshook__(C)

Abstract classes can override this to customize issubclass().

Inherited from Collection

__subclasshook__(C)

Abstract classes can override this to customize issubclass().

Inherited from Sized

__len__()

__subclasshook__(C)

Abstract classes can override this to customize issubclass().

Inherited from Iterable

__iter__()

__subclasshook__(C)

Abstract classes can override this to customize issubclass().

__class_getitem__

Inherited from Container

__contains__(x)

__subclasshook__(C)

Abstract classes can override this to customize issubclass().

__class_getitem__

Inherited from Generic

__class_getitem__(params)

Parameterizes a generic class.

__init_subclass__(*args, **kwargs)

This method is called when a class is subclassed.

Private Methods:

Inherited from UserList

_UserList__cast(other)


__setitem__(key, value)[source]#

Set self[key] to value; raise TypeError if Value is not Updatable.

append(item)[source]#

Append the given item to self.

If the item is not Updatable a TypeError is raised.

Parameters:

item (TypeVar(T, bound= Updatable)) – new item to be appended to the list

Return type:

None

final get_derived_parameters()[source]#

Get all derived parameters if any.

Return type:

None | DerivedParameterCollection

is_updated()[source]#

Returns whether this updatable has been updated.

Return True if the object is currently updated, and False if not. A default-constructed Updatable has not been updated. After update, but before reset, has been called the object is updated. After reset has been called, the object is not currently updated.

Return type:

bool

final required_parameters()[source]#

Return a RequiredParameters object.

The RequiredParameters object is formed by concatenating the RequiredParameters of each contained item.

Return type:

RequiredParameters

final reset()[source]#

Resets self by calling reset() on each contained item.

Return type:

None

final update(params)[source]#

Update self by calling update() on each contained item.

Parameters:

params (ParamsMap) – new parameter values

Return type:

None