pyxc.core.loader
Module Contents
Classes
An abstract base class for data loaders. |
|
An abstract base class for data loaders. |
|
An abstract base class for data loaders. |
- class pyxc.core.loader.DataLoaderBase(container: Type[pyxc.core.container.Container2D], data: numpy.typing.ArrayLike)[source]
Bases:
abc.ABCAn abstract base class for data loaders.
Initializes a container with preprocessed data and returns the container when called. Works with a Layer object. Subclasses should implement the
prepmethod to specify the preprocessing of data.- Parameters:
- container
Container2D The container class to be initialized with the preprocessed data.
- dataarray_like
The raw data to be preprocessed.
- container
- Attributes:
- container
Container2D The container that was initialized with the preprocessed data.
- container
- abstract prep(data)[source]
Process the provided data.
This method should be implemented in subclasses to specify the preprocessing steps.
- Parameters:
- data
any The raw data to be preprocessed.
- data
- Returns:
- x_raw:
np.ndarray 1-dimensional numpy array with shape of (n, ).
- y_raw:
np.ndarray 1-dimensional numpy array with shape of (n, ).
- data:
np.ndarray Structured array with proper column names.
- x_raw:
- class pyxc.core.loader.ImageLoader(container: Type[pyxc.core.container.Container2D], data: numpy.typing.ArrayLike)[source]
Bases:
DataLoaderBaseAn abstract base class for data loaders.
Initializes a container with preprocessed data and returns the container when called. Works with a Layer object. Subclasses should implement the
prepmethod to specify the preprocessing of data.- Parameters:
- container
Container2D The container class to be initialized with the preprocessed data.
- dataarray_like
The raw data to be preprocessed.
- container
- Attributes:
- container
Container2D The container that was initialized with the preprocessed data.
- container
- prep(data: numpy.typing.ArrayLike) tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray][source]
Process the provided image data.
Provided dimension of the image data should be 2 or 3. If the dimension is 2, then the image is assumed to be grayscale. If the dimension is 3, then the image is assumed to be multi-channel. The number of channels is not limited.
- class pyxc.core.loader.XYDLoader(container: Type[pyxc.core.container.Container2D], data: numpy.typing.ArrayLike)[source]
Bases:
DataLoaderBaseAn abstract base class for data loaders.
Initializes a container with preprocessed data and returns the container when called. Works with a Layer object. Subclasses should implement the
prepmethod to specify the preprocessing of data.- Parameters:
- container
Container2D The container class to be initialized with the preprocessed data.
- dataarray_like
The raw data to be preprocessed.
- container
- Attributes:
- container
Container2D The container that was initialized with the preprocessed data.
- container
- prep(data: numpy.typing.ArrayLike) tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray][source]
Process the provided XYD data.
- Parameters:
- dataarray_like or
structuredarray The raw XYD data to be preprocessed. The first and second columns should be x- and y-coordinates, and the third and subsequent columns should be data columns.
- dataarray_like or
- Returns:
- x_raw, y_raw, data
tuple The preprocessed XYD data. x_raw and y_raw are the x- and y-coordinates, and data contains the rest of the columns.
- x_raw, y_raw, data