takes care of the limits/norm_range objects
logic for init (for converting tuples):
needs limits tuple and dims tuple (to specify which limits belong to which dims)
0-dim: number of dims (number of variables)
1-dim: (even length tuples), (lower, upper, lower, upper,...)
if only one-dimensional:
1-dim becomes 0-dim
Logic:
None equals to "any", e.g. (None, None) means any lower and upper limit. Get's converted internally to ANY_LOWER, ANY_UPPER
if dims is not given, Error is thrown except Range.FULL is given, which implies that all dimensions occur in the limits (so e.g. len(limits) = 4 -> dims = (0, 1, 2, 3))
therefore dims is always specified
n_dims is only specified if Range.FULL was given as dimension. Otherwise None.
Stable output: get_boundaries() returns lower, upper boundaries. These can be a list of tuples and define the boundaries uniquely. Other methods and additions etc may change things in the future.
Why implement:
reduces logic that would be applied in a lot of places (iteration etc.)
a way to easily handles special things (infinities?) and be able to change the logic of them
Expected methods:
deal with things like: n_dims, has_infinites, etc.
Usage: autoconvert tuples from outside and use internally (as commonly done with such objects like, ranges, indexes etc.)
@mayou36 commented on Mon Oct 15 2018
Range class
takes care of the limits/norm_range objects logic for init (for converting tuples):
needs limits tuple and dims tuple (to specify which limits belong to which dims)
0-dim: number of dims (number of variables)
1-dim: (even length tuples), (lower, upper, lower, upper,...) if only one-dimensional:
1-dim becomes 0-dim
Logic:
Stable output:
get_boundaries()
returns lower, upper boundaries. These can be a list of tuples and define the boundaries uniquely. Other methods and additions etc may change things in the future.Why implement:
Expected methods: deal with things like: n_dims, has_infinites, etc.
Usage: autoconvert tuples from outside and use internally (as commonly done with such objects like, ranges, indexes etc.)