LoaderAbstract#
- class LoaderAbstract(params=None, **kwargs)#
Bases:
Generic[T_Source,T_Data],ModuleAbstract class of Loader plugin.
The Loader is tasked with opening the data into Python. It may run post-processing if defined by the user.
- Parameters:
params (t.Any | None)
- __weakref__#
list of weak references to the object
- get_data(*, source=None, ignore_postprocess=False, load_kwargs=None, **kwargs)#
Load data and run post-processing.
The actual loading is done by
load_data_concrete()that can be overwritten by subclasses.Tries to run the method
postprocessof the parent dataset. If it raises NotImplementedError, postprocess will be ignored.- Parameters:
source (T_Source | Sequence[T_Source] | None) – Source location of the data to load. If left to None,
get_source()is used.ignore_postprocess (bool) – If True, do not apply postprocessing. Default is False.
load_kwargs (Mapping[str, Any] | None) – Arguments passed to function loading data.
kwargs – Arguments passed to the postprocessing function.
- Return type:
- load_data_concrete(source, **kwargs)#
Load the data from datafiles.
This method should be implemented in subclasses to account for different format, libraries, etc.