Skip to content

Feature: domains

Tobias Hangleiter requested to merge feature/domains into master

New module domains implements classes to represent parameter domains.

Main features are

  • in-testing
  • next_[largest,smallest,closest] methods that return numbers from the domain next largest/smallest/closest to a test value
  • & composition, which returns a domain that is least inclusive out of the two operands (similar to set.intersection)

Could also imagine | composition (similar to set.union).

Implemented so far are

  • DiscreteInterval: basically like range(start, stop).
  • ContinuousInterval: same except not limited to ints.
  • ReciprocalDiscreteInterval: a floating numerator divided by a discrete interval.
  • BoundedSet: Subclass of frozenset with bounds.

Merge request reports