It helps to model the Python and R intervals seamlessly.
Project description
deciphon-intervals
It helps to model the two primary interval definitions in the programming realm: 0-start, half-open interval (aka Python interval), and 1-start, fully-closed interval (aka R interval).
Example
from deciphon_intervals import PyInterval, RInterval, Interval
x = [1, 2, 4, 8]
print(x[PyInterval(start=1, stop=3).slice])
print(x[RInterval(start=2, stop=3).slice])
# [2, 4]
# [2, 4]
interval: Interval = RInterval(start=2, stop=3)
print(interval.py)
print(interval.r)
# PyInterval(start=1, stop=3)
# RInterval(start=2, stop=3)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for deciphon_intervals-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b21404d2d32cae137b62d89f3b8169515eaaa74c9012136dfe9a855e3a27490d |
|
MD5 | b7f7aff6b7f2354501e68d5599e3055a |
|
BLAKE2b-256 | a17973db8d10d671599f7ab1944c8fc0cee395e8aa97c63c97c1e252a9f13c2d |