base package¶
Submodules¶
base.base_domain_metric module¶
Metric specification for an interval/set.
- class base.base_domain_metric.BaseDomainMetric[source]¶
Bases:
objectAbstract class for creating ‘metric’ static classes, which prescribe how to deal with the concept of interval “length” and their summations.
- static subtracter(val1, val2)[source]¶
How to subtract two ends of an interval (peg values) to get its ‘extension’.
- zero = Ellipsis¶
base.base_interval module¶
A single interval with a begin and and end, either open or closed at its ends.
- class base.base_interval.BaseInterval(begin, end)[source]¶
Bases:
objectA single uninterrupted interval over the domain field: [a,b] or (a,b) or (a,b] or [a,b) defined by two IntervalPeg objects. It can span to infinities.
Concrete classes must provide builder() and utils() in a standard way (see the real-interval case) and, if desired, define metric and serializability properties as well.
- contains(value)[source]¶
Test whether a value belongs to the interval.
Infinities are allowed as ‘value’ argument, but never belong.
- extension()[source]¶
If a metric is defined for this interval type, use it to compute this interval’s ‘extension’.
- intervals()[source]¶
Return an ‘iterable’ over a single element, this interval. This is only to enable quick-syntax for those IntervalSet set-wise operations whereby the second operand is a puny Interval.
- metric = None¶
- serializing_class = None¶
- serializing_version = None¶
- value_decoder = None¶
- value_encoder = None¶
base.base_interval_set module¶
Any set over the domain, defined by a finite number of intervals.
- class base.base_interval_set.BaseIntervalSet(intervals)[source]¶
Bases:
objectAny portion of the “continuous line” that is the domain (such as the reals + infinities), defined by an arbitrary (finite) number of intervals.
Any concrete implementation has to provide: a builder() and a utils() (in a pretty standard way, see e.g. the reference “real*” implementation), as well as to give the name of the class representing the individual intervals this set is made of. Moreover, serializing signature data can be provided (if so desired and if serializability is supported by the underlying interval implementation).
- contains(value)[source]¶
Test whether a value belongs to the set.
Conventionally, infinities do not belong to any interval set.
- extension()[source]¶
If a metric is defined for this interval type, use it to compute this interval set’s (overall) ‘extension’.
- interval_class = None¶
- serializing_class = None¶
- serializing_version = None¶