8.2.5. Pipeline#

Provide imports for pipeline sub-package.

class junifer.pipeline.PipelineStepMixin#

Mixin class for a pipeline step.

fit_transform(input, **kwargs)#

Fit and transform.

Parameters:
inputdict

The Junifer Data object.

**kwargsdict

Extra keyword arguments passed to the concrete class’ _fit_transform().

Returns:
dict

The processed output of the pipeline step.

get_output_type(input_type)#

Get output type.

Parameters:
input_typestr

The data type input to the marker.

Returns:
str

The storage type output by the marker.

validate(input)#

Validate the the pipeline step.

Parameters:
inputlist of str

The input to the pipeline step.

Returns:
list of str

The output of the pipeline step.

Raises:
ValueError

If the pipeline step object is missing dependencies required for its working or if the input does not have the required data.

validate_input(input)#

Validate the input to the pipeline step.

Parameters:
inputlist of str

The input to the pipeline step. The list must contain the available Junifer Data dictionary keys.

Raises:
ValueError

If the input does not have the required data.

class junifer.pipeline.UpdateMetaMixin#

Mixin class for updating meta.

update_meta(input, step_name)#

Update metadata.

Parameters:
inputdict

The data object to update.

step_namestr

The name of the pipeline step.

8.2.6. Registry#

Provide functions for registry.

junifer.pipeline.registry.build(step, name, baseclass, init_params=None)#

Ensure that the given object is an instance of the given class.

Parameters:
stepstr

Name of the step.

namestr

Name of the function.

baseclassclass

Class to be checked against.

init_parmsdict, optional

Parameters to pass to the base class constructor (default None).

Returns:
object

An instance of the given base class.

Raises:
ValueError

If the created object with the given name is not an instance of the base class.

junifer.pipeline.registry.get_class(step, name)#

Get the class of the registered function for a given step.

Parameters:
stepstr

Name of the step.

namestr

Name of the function.

Returns:
class

Registered function class.

junifer.pipeline.registry.get_step_names(step)#

Get the names of the registered functions for a given step.

Parameters:
stepstr

Name of the step.

Returns:
list

List of registered function names.

junifer.pipeline.registry.register(step, name, klass)#

Register a function to be used in a pipeline step.

Parameters:
stepstr

Name of the step.

namestr

Name of the function.

klassclass

Class to be registered.