Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deciphon_intervals-0.1.1.tar.gz (2.3 kB view hashes)

Uploaded Source

Built Distribution

deciphon_intervals-0.1.1-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page