An interval package for Python.
Project description
=======
Pyinter
=======
..
|latestversion| |downloads| |masterstatus| |mastercover| |issuecount|
..
Pyinter is a small and simple library written in Python for performing interval and discontinous range arithmetic.
.. code-block:: pycon
>>> pyinter.openclosed(1.1, 12)
(1.1, 12]
>>> discontinous_range = pyinter.IntervalSet([pyinter.closedopen(5, 10), pyinter.closed(22, 23)])
>>> discontinous_range
IntervalSet([5, 10), [22, 23])
>>> 7 in discontinous_range
True
>>> 10 in discontinous_range
False # This isn't in the range as it is an open interval which doesn't include its end points
Features
--------
- interval objects which can be
- unioned
- intersected
- easily constructed using helper functions: *open, closed, openclosed and closedopen*
- interval sets which can be
- unioned
- intersected
Installation
------------
To install Pyinter, simply:
.. code-block:: bash
$ pip install pyinter
Or, if you absolutely must:
.. code-block:: bash
$ easy_install pyinter
But I'm told you really shouldn't do that.
Documentation
-------------
Documentation is available at http://pyinter.readthedocs.org.
Contribute
----------
Contributions or suggestions for improvements are welcome.
.. |masterstatus| image:: http://img.shields.io/travis/intiocean/pyinter/master.svg?style=flat
:target: https://travis-ci.org/intiocean/pyinter
:alt: Release Build Status
.. |developstatus| image:: http://img.shields.io/travis/intiocean/pyinter/develop.svg?style=flat
:target: https://travis-ci.org/intiocean/pyinter
:alt: Development Build Status
.. |latestversion| image:: http://img.shields.io/pypi/v/pyinter.svg?style=flat
:target: https://pypi.python.org/pypi/pyinter
:alt: Latest Version
.. |downloads| image:: http://img.shields.io/pypi/dw/pyinter.svg?style=flat
:target: https://pypi.python.org/pypi/pyinter
:alt: Downloads per Week
.. |mastercover| image:: http://img.shields.io/coveralls/intiocean/pyinter/master.svg?style=flat
:target: https://travis-ci.org/intiocean/pyinter
:alt: Release Test Coverage
.. |developcover| image:: http://img.shields.io/coveralls/intiocean/pyinter/develop.svg?style=flat
:target: https://travis-ci.org/intiocean/pyinter
:alt: Development Test Coverage
.. |issuecount| image:: http://img.shields.io/github/issues/intiocean/pyinter.svg?style=flat
:target: https://github.com/intiocean/pyinter/issues
:alt: Github Issues
.. :changelog:
Release History
---------------
0.1.7 (2014-05-11)
++++++++++++++++++
- Fix `|` and `&` in the documentation.
- Implement subtraction of `Interval`'s and `IntervalSet`'s
- Add method `empty()` to detect empty `Interval` objects.
- Fix, each infinity should always equal itself.
0.1.6 (2014-05-11)
++++++++++++++++++
- Add a complement function
- Fix bug with using & and | for `union()` and `intersection()`
- Increase test coverage!
0.1.5 (2013-12-13)
++++++++++++++++++
- Fix the `__all__` list so that you can `from pyinter import *`.
- Change classes to new style classes (inheriting from object)
- Added an `add()` function to the `IntervalSet` class. This will add (union) an Interval inplace. (similarly to `set().add()`)
- The optional iterable of Interval objects passed when initialising an `IntervalSet` is now added Interval by Interval so that initialising with overlapping intervals works as expected.
0.1.4 (2013-11-16)
++++++++++++++++++
- Fix formatting in HISTORY.rst which was stopping the pypi page rendering it.
0.1.3 (2013-11-16)
++++++++++++++++++
- Removed \*.md from the MANIFEST file as it warns when installing that no files matching \*.md are found.
- Fix allowing an IntervalSet to be initialised with a generator.
0.1.2 (2013-10-12)
++++++++++++++++++
- Fixed the rendering of the README on pypi (hopefully!) by converting it from a .md file to a .rst file.
0.1.1 (2013-10-09)
++++++++++++++++++
- Adding Manifest file to fix the pypi release. This was broken because the README.md was not being included in the source distribution but setup.py had a reference to this file and therefore failed to run.
0.1.0 (2013-07-03)
++++++++++++++++++
- Initial release
Pyinter
=======
..
|latestversion| |downloads| |masterstatus| |mastercover| |issuecount|
..
Pyinter is a small and simple library written in Python for performing interval and discontinous range arithmetic.
.. code-block:: pycon
>>> pyinter.openclosed(1.1, 12)
(1.1, 12]
>>> discontinous_range = pyinter.IntervalSet([pyinter.closedopen(5, 10), pyinter.closed(22, 23)])
>>> discontinous_range
IntervalSet([5, 10), [22, 23])
>>> 7 in discontinous_range
True
>>> 10 in discontinous_range
False # This isn't in the range as it is an open interval which doesn't include its end points
Features
--------
- interval objects which can be
- unioned
- intersected
- easily constructed using helper functions: *open, closed, openclosed and closedopen*
- interval sets which can be
- unioned
- intersected
Installation
------------
To install Pyinter, simply:
.. code-block:: bash
$ pip install pyinter
Or, if you absolutely must:
.. code-block:: bash
$ easy_install pyinter
But I'm told you really shouldn't do that.
Documentation
-------------
Documentation is available at http://pyinter.readthedocs.org.
Contribute
----------
Contributions or suggestions for improvements are welcome.
.. |masterstatus| image:: http://img.shields.io/travis/intiocean/pyinter/master.svg?style=flat
:target: https://travis-ci.org/intiocean/pyinter
:alt: Release Build Status
.. |developstatus| image:: http://img.shields.io/travis/intiocean/pyinter/develop.svg?style=flat
:target: https://travis-ci.org/intiocean/pyinter
:alt: Development Build Status
.. |latestversion| image:: http://img.shields.io/pypi/v/pyinter.svg?style=flat
:target: https://pypi.python.org/pypi/pyinter
:alt: Latest Version
.. |downloads| image:: http://img.shields.io/pypi/dw/pyinter.svg?style=flat
:target: https://pypi.python.org/pypi/pyinter
:alt: Downloads per Week
.. |mastercover| image:: http://img.shields.io/coveralls/intiocean/pyinter/master.svg?style=flat
:target: https://travis-ci.org/intiocean/pyinter
:alt: Release Test Coverage
.. |developcover| image:: http://img.shields.io/coveralls/intiocean/pyinter/develop.svg?style=flat
:target: https://travis-ci.org/intiocean/pyinter
:alt: Development Test Coverage
.. |issuecount| image:: http://img.shields.io/github/issues/intiocean/pyinter.svg?style=flat
:target: https://github.com/intiocean/pyinter/issues
:alt: Github Issues
.. :changelog:
Release History
---------------
0.1.7 (2014-05-11)
++++++++++++++++++
- Fix `|` and `&` in the documentation.
- Implement subtraction of `Interval`'s and `IntervalSet`'s
- Add method `empty()` to detect empty `Interval` objects.
- Fix, each infinity should always equal itself.
0.1.6 (2014-05-11)
++++++++++++++++++
- Add a complement function
- Fix bug with using & and | for `union()` and `intersection()`
- Increase test coverage!
0.1.5 (2013-12-13)
++++++++++++++++++
- Fix the `__all__` list so that you can `from pyinter import *`.
- Change classes to new style classes (inheriting from object)
- Added an `add()` function to the `IntervalSet` class. This will add (union) an Interval inplace. (similarly to `set().add()`)
- The optional iterable of Interval objects passed when initialising an `IntervalSet` is now added Interval by Interval so that initialising with overlapping intervals works as expected.
0.1.4 (2013-11-16)
++++++++++++++++++
- Fix formatting in HISTORY.rst which was stopping the pypi page rendering it.
0.1.3 (2013-11-16)
++++++++++++++++++
- Removed \*.md from the MANIFEST file as it warns when installing that no files matching \*.md are found.
- Fix allowing an IntervalSet to be initialised with a generator.
0.1.2 (2013-10-12)
++++++++++++++++++
- Fixed the rendering of the README on pypi (hopefully!) by converting it from a .md file to a .rst file.
0.1.1 (2013-10-09)
++++++++++++++++++
- Adding Manifest file to fix the pypi release. This was broken because the README.md was not being included in the source distribution but setup.py had a reference to this file and therefore failed to run.
0.1.0 (2013-07-03)
++++++++++++++++++
- Initial release
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
pyinter-0.1.7.tar.gz
(17.9 kB
view hashes)