Skip to main content

Implementation of the RangeList datastructure in python.

Project description

Build Status

pyrangelist

Hello Jerry

This is my work for the take home interview. I'm not a JS guy. But if Jerry wants to take data science seriously, I will help you build the best infrastructure for it.

The package has 100% test coverage and has 10/10 pylint score, and it is stress-tested with 100k random add/remove operations.

Intstallation

pip install pyrangelist

Developer guide

Intall

python setup.py develop

As customary, pinned requirements are in the requirements.txt.

Test

python -m pytest

About

This version uses intervaltree library under the hood. A more efficient implementation would be a modified B-tree structure that would keep ranges as values, as well as keep the minimum and maximum value of the subtree for each edge. This would allow deletion and addition to be O(long(n) + m), where n is the number of ranges currently stored and m is the number of ranges that the new range overlaps with. However, from the task description it didn't seem like you guys were looking for maximum efficiency, so I focused my efforts elsewhere. The current implementation is sub-optimal: O(long(n) * m)

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

pyrangelist-0.1.2.tar.gz (8.6 kB view hashes)

Uploaded Source

Built Distribution

pyrangelist-0.1.2-py3-none-any.whl (9.8 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