-
Notifications
You must be signed in to change notification settings - Fork 2
Limits, Coordinates, Spaces and MultiSpace
Spaces serve the purpose to define the obs, axes and maybe the limits. It should support:
- obs and axes
- arbitrary limits and rectangular shape
- combinations of obs/axes
- multiple, independent limits added together
There are four objects which are used to build the above:
This object holds the obs and axes and takes care of all the ordering. It can sort an array, it can return a Coordinates
object with new (or reshuffled) axes.
It is usually not exposed to the user.
A limit object holds rectangular limits and a limits function (which can be arbitrary) that simply returns if a point is inside or not. It knows about its dimensionality (e.g. the number of observables) but not about obs or axes and cannot be reordered. It should be as small as possible, e.g. if a Limit
holds only rectangular limits, it should be split up into single Limits
holding one dimension each.
It is usually not exposed to the user.
To organize and combine the above we need two more objects that handle the two "dimensions": multiple limits with the same observables (addition) and limits with different observables (multidimensional, product).
This object handles multiple observables. It contains a dict with a mapping of obs/axes to limits (a space is also a Limit). It can be reordered by obs, axes (delegation to Coordinates) including retrieving subspaces.
Having multiple, independent limits with the same observables is handled by MultiSpace
. It simply contains multiple spaces and allows to iterate over them.