Register¶
- class pathsim.utils.register.Register(size=None, mapping=None, dtype=<class 'numpy.float64'>)[source]¶
Bases:
objectThis class is a intended to be used for the inputs and outputs of blocks.
Its basic functionality is similar to a dict but with some additional methods and implemented as a numpy array for fast data transfer.
The core functionality is that values can be added dynamically and the size of the register doesnt have to be specified. It also implements some methods to interact with numpy arrays and to streamline convergence checks.
- Parameters:
- _data¶
internal numpy array that holds the values
- Type:
np.ndarray
- resize(size)[source]¶
Resize the internal data array to accommodate more entries.
Creates a new zero-filled array instead of in-place resize to avoid numpy ValueError when other references to the array exist (e.g., from fancy indexing in PortReference).
- Parameters:
size (int) – new size for the internal data array