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.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b653a0599e8cb7c32b0a26b0516a46b6d5334425b75b3c25762b69384de2b578 |
|
MD5 | b6db389e4dc445e1cda42c837e6bb510 |
|
BLAKE2b-256 | 977477d05e91581b2c85a8f1fa604be18c40b0f7e74daeab49774dfa14225efa |