kaishi.core.pipeline_component
¶
Class definition for pipeline components.
Module Contents¶
-
class
kaishi.core.pipeline_component.
PipelineComponent
¶ Base class for pipeline components.
-
__str__
(self)¶
-
__repr__
(self)¶
-
configure
(self)¶ Method to configure via named arguments. Defaults to no configurations, unless inherited and overridden.
-
applies_to
(self, target_criteria)¶ Limit data files that the component applies to via regex.
- Parameters
target_criteria – list or string containing a regex to denote files that this component applies to
-
get_target_indexes
(self, dataset)¶ Get target indexes of a dataset based on criteria set using the applies_to() method
- Parameters
dataset (initialized kaishi dataset object (e.g.
kaishi.core.dataset.FileDatset
)) – dataset to inspect- Returns
list of indexes
- Return type
list of int
-
_is_valid_target_int
(self, target)¶ Check if an index is a valid integer type.
- Parameters
target (int (or similar, e.g. np.int32)) – target to verify
- Returns
flag indicating if the target is a valid integer type
- Return type
bool
-
_is_valid_target_str
(self, target)¶ Check if an index is a valid string type.
- Parameters
target (int (or similar)) – target to verify
- Returns
flag indicating if the target is a valid string type
- Return type
bool
-