Skip to main content

A package for performing operations on numeric sets

Project description

Operations on Sets of Numeric Intervals

This package allows you to perform all operations on sets of numeric intervals. NumericSet class has all methods of Python set data structure as well as many additional ones. Intervals class has all basic methods to work with numeric intervals.

Usage example

Import classes from the main module of the package into your Python script.

from numeric_sets.main import Interval, NumericSet

main.main()

Feel free to perform any operation!

myset_1 = NumericSet()

myset_1.add(Interval(2, 4, True, True))  # [2, 4]
myset_1.add(Interval(5, 7))  # (5, 7)
myset_1.add(Interval(8, 10, is_end_inclusive=True))  # (8, 10]

myset_2 = NumericSet()

myset_2.add(Interval(2, 5))  # (2, 5)
myset_2.add(Interval(6, 9))  # (6, 9)

union = myset_1.union(
    myset_2)  # [2, 5) + (5, 10]

Meta

Dmytro Yaroshevych – dyaroshevych@gmail.com

Distributed under the MIT license. See LICENSE for more information.

https://github.com/dyaroshevych/numeric_sets

Contributing

  1. Fork it (https://github.com/dyaroshevych/numeric_sets/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

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

numeric_sets_dyaroshevych-0.0.1.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

numeric_sets_dyaroshevych-0.0.1-py3-none-any.whl (6.3 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