generic package¶
Submodules¶
generic.interval_generic_builder module¶
A utility to provide a “builder” interface for intervals, interval sets etc. The actual class used to instantiate the interval* once completed is passed when instantiating the builder: so, this “interface” can offer a standard syntax yet result in the creation of intervals, interval sets and also other types of intervalsets (e.g. enriched with metrics and so on).
Note: contrary to the ‘utils’ generic tools, this one is able to create both intervals* and intervalsets* (depending on how initialized).
- class generic.interval_generic_builder.IntervalGenericBuilder(interval_class=None, interval_set_class=None)[source]¶
Bases:
objectA builder for some kind of intervals. An instance of this class supports a [] and () syntax for specifying the first peg, an action which creates another object that waits for a “completion” call with () or [] and eventually results in creation of an interval*.
generic.interval_generic_utils module¶
A class containing the “interface” for creation of intervals*, (not ‘sets’). Like for the IntervalSetGenericUtils, the actual class to instantiate is set per-instance, so this serves as a generic class template.
- class generic.interval_generic_utils.IntervalGenericUtils(interval_class)[source]¶
Bases:
objectAn “interval utils” class. Instances of this, properly initialized with the name of the interval class to create, are able to produce several ‘standard’ intervals such as “all”, “open set” and so on.
- from_dict(input_dict)[source]¶
Using the information in the interval class, convert a dict (supposedly generate from an interval of this same type) back into an interval. This function takes care of injecting decoders to the lower-level (i.e. peg-level) from_dict function invocations.
generic.interval_set_generic_utils module¶
A class containing the “interface” for creation ex-novo of intervalsets*, with the key feature that the actual class to instantiate when creating these is set upon creation of the IntervalSetGenericUtils instance. In this way, a “utils” object can be spawned by IntervalSets or analogous classes and with a common set of methods an “utils” creates intervalsets of the appropriate type.
- class generic.interval_set_generic_utils.IntervalSetGenericUtils(interval_set_class)[source]¶
Bases:
objectAn “interval set utils” class. Instances are able to use the provided ‘name of an interval set class’ and create standard out-of-the-box intervals.
- from_dict(input_dict)[source]¶
Extract an instance of this interval set from a dict, using the provided serializability settings (including checking dict metadata match).