ContainerOfArray

class PlasmaCalcs.tools.iterables.ContainerOfArray(arr)

Bases: Container

a numpy-array-like container.

Methods

enumerate([idx])

iterate through i in idx, yielding (i, self[i]) pairs.

new_empty([fill])

return a new array of the same shape as self, filled with the value fill.

size([idx])

return the number of objects in the container, or in idx if provided.

_enumerate_all()

iterate through all objs in self, yielding (i, self[i]) pairs.

_size_all()

the number of objects in this container.

Attributes

dtype

alias to self.data.dtype

ndim

alias to self.data.ndim

shape

alias to self.data.shape

_enumerate_all()

iterate through all objs in self, yielding (i, self[i]) pairs.

_size_all()

the number of objects in this container. == self.data.size

property dtype

alias to self.data.dtype

enumerate(idx=None)

iterate through i in idx, yielding (i, self[i]) pairs.

If idx is None, iterate through all objs in self (see self._enumerate_all).
property ndim

alias to self.data.ndim

new_empty(fill=UNSET)

return a new array of the same shape as self, filled with the value fill.

property shape

alias to self.data.shape

size(idx=None)

return the number of objects in the container, or in idx if provided.