Splitable

Splitable#

class Splitable(*args, **kwargs)#

Bases: Protocol[T]

Protocol for a source module that can split data into multiple sources.

A number of parameters can be left unfixed() which results in multiple files (for instance, if we do not “fix” the parameter year, we can have files for any year we want).

It must also implement a get_filename() method that returns a filename when given a specific set of values.

The idea is that a module can split data according to the parameters that are left unfixed (example by year), once the data is split we find the associated filename for each year and we then write to files.

The protocol is generic and allows for any type of source.

get_filename(**fixes)#

Return a filename corresponding to this set of values.

This must also take into account values that are already specified in the data-manager parameters (that are not present in the fixes argument).

Parameters:

fixes (Any)

Return type:

T

property unfixed: Iterable[T]#

Iterable of parameters that are not fixed.

This must take into account the values that are specified (or not) in the data-manager parameters.