An interval set utility library.
With poetry:
poetry add intervalpy
Or with pip:
pip3 install intervalpy
Have a look at the documentation.
Basic usage:
from intervalpy import Interval
# Create a set [0, 10), i.e. a set satisfying: >= 0, < 10.
digits = Interval(0, 10, end_open=True)
# Get the set (10, ∞), i.e. a set satisfying: > 10
ten_and_up = digits.get_gt()
# Get the set [0, ∞), i.e. a set satisfying: >= 0
positive_numbers = digits.get_gte()
# Perform set comparison
assert ten_and_up.is_subset_of(positive_numbers)
# Equality is by value
assert positive_numbers.intersection(Interval.lt(10)) == digits
The module pdoc3 is used to automatically generate documentation. To update the documentation:
- Install
pdoc3
if needed withpip3 install pdoc3
. - Navigate to project root and install dependencies:
poetry install
. - Generate documetation files with:
pdoc3 -o docs --html durationpy
. - The new files will be in
docs/durationpy
. Move them todocs/
and replace existing files.