GSEGUtils.base_arrays
See BaseArrays for background motivation.
Provides a class with builtin functionality of:
Interaction like a Numpy array
Pydantic level automatic validation on class and attributes
Simplistic class and attribute definition like dataclasses
- class GSEGUtils.base_arrays.BaseArray
-
Subclassable array supporting all shapes and numeric/boolean dtypes.
- Parameters:
arr (ArrayT) – Input array data
- property base: bool'>)] | None
Returns the base array if the array is a view, otherwise None
- Return type:
ArrayT | None
- view(dtype=None, _type=None)
Return a view of the underlying array
- copy(array=None, *, deep=True, update=None, **kwargs)
Creates a copy of this object.
Also supports deep / shallow copies and overriding update of attributes via the update dictionary paramter.
- Parameters:
- Return type:
Self
- class GSEGUtils.base_arrays.NumericMixins
Bases:
BaseArraySubclassable array type with Python built-in numerical and logical operators
- Parameters:
arr (ArrayT) – Input array data
- class GSEGUtils.base_arrays.FixedLengthArray
Bases:
NumericMixinsClass supporting sample, reduce, extract and mask funcs for row-based data
E.g., vectors or coordinate sets
- Parameters:
arr (ArrayT) – Input array data
- create_mask(selection)
Converts a basic or advanced numpy index to a boolean vector mask that corresponds to the row indices
- Parameters:
selection (IndexLike)
- Return type:
- class GSEGUtils.base_arrays.BaseVector
Bases:
FixedLengthArrayShape validated 1D array
- Parameters:
arr (ArrayT) – Input array data
- class GSEGUtils.base_arrays.HomogeneousArray
Bases:
FixedLengthArrayHelper class for homogeneous coordinate creation
- Parameters:
arr (ArrayT) – Input array data
- class GSEGUtils.base_arrays.ArrayNx2
Bases:
HomogeneousArrayShape validated Nx2 array
- Parameters:
arr (ArrayT) – Input array data
Helper class for homogeneous coordinate creation
- Parameters:
arr (ArrayT) – Input array data
- arr: Array_Nx2_T
Contains the raw numpy ndarray data
- class GSEGUtils.base_arrays.ArrayNx3
Bases:
HomogeneousArrayShape validated Nx3 array
- Parameters:
arr (ArrayT) – Input array data
Helper class for homogeneous coordinate creation
- Parameters:
arr (ArrayT) – Input array data
- arr: Array_Nx3_Float_T
Contains the raw numpy ndarray data