Name | quicksect JSON |
Version |
0.2.2
JSON |
| download |
home_page | |
Summary | fast, simple interval intersection |
upload_time | 2019-06-04 16:41:36 |
maintainer | |
docs_url | None |
author | Brent Pedersen |
requires_python | |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
Quicksect
=========
.. image:: https://img.shields.io/badge/install%20with-bioconda-brightgreen.png
:target: http://bioconda.github.io/recipes/quicksect/README.html
Description
-----------
Quicksect is a fast python / cython implementation of interval search based on the pure python version in
`bx-python <http://bx-python.trac.bx.psu.edu/>`__
I pulled it out, optimized and converted to cython and James Taylor has incoporated it back into bx-python
with his improvements.
I have brought this project back from the dead because I want a fast, simple, no-dependencies Interval
tree.
License is MIT.
Installation
------------
pip install quicksect
or
conda install -c bioconda quicksect
Use
---
>>> from quicksect import IntervalNode, Interval, IntervalTree
Most common use will be via IntervalTree:
>>> tree = IntervalTree()
>>> tree.add(23, 45)
>>> tree.add(55, 66)
>>> tree.search(46, 47)
[]
>>> tree.search(44, 56)
[Interval(55, 66), Interval(23, 45)]
>>> tree.insert(Interval(88, 444))
>>> res = tree.find(Interval(99, 100))
>>> res
[Interval(88, 444)]
>>> res[0].start, res[0].end
(88, 444)
Thats pretty much everything you need to know about the tree.
Test
----
$ python setup.py test
Low-Level
+++++++++
In some cases, users may want to utilize the lower-level interface that accesses
the nodes of the tree:
>>> inter = IntervalNode(Interval(22, 33))
>>> inter = inter.insert(Interval(44, 55))
>>> inter.intersect(24, 26)
[Interval(22, 33)]
>>> inter.left(Interval(34, 35), n=1)
[Interval(22, 33)]
>>> inter.right(Interval(34, 35), n=1)
[Interval(44, 55)]
Raw data
{
"_id": null,
"home_page": "",
"name": "quicksect",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Brent Pedersen",
"author_email": "bpederse@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/40/ba/a7ec481405e93afcc85b9e051e204d2a32b2f7cad2ae4b6c9fb60e7ecbbe/quicksect-0.2.2.tar.gz",
"platform": "",
"description": "Quicksect\n=========\n\n.. image:: https://img.shields.io/badge/install%20with-bioconda-brightgreen.png\n :target: http://bioconda.github.io/recipes/quicksect/README.html\n\nDescription\n-----------\n\n\nQuicksect is a fast python / cython implementation of interval search based on the pure python version in \n`bx-python <http://bx-python.trac.bx.psu.edu/>`__ \nI pulled it out, optimized and converted to cython and James Taylor has incoporated it back into bx-python\nwith his improvements.\n\nI have brought this project back from the dead because I want a fast, simple, no-dependencies Interval\ntree.\n\n\nLicense is MIT.\n\nInstallation\n------------\n\n pip install quicksect\n\nor\n\n conda install -c bioconda quicksect\n\nUse\n---\n >>> from quicksect import IntervalNode, Interval, IntervalTree\n\nMost common use will be via IntervalTree:\n\n >>> tree = IntervalTree()\n >>> tree.add(23, 45)\n >>> tree.add(55, 66)\n >>> tree.search(46, 47)\n []\n >>> tree.search(44, 56)\n [Interval(55, 66), Interval(23, 45)]\n\n >>> tree.insert(Interval(88, 444))\n >>> res = tree.find(Interval(99, 100))\n >>> res\n [Interval(88, 444)]\n >>> res[0].start, res[0].end\n (88, 444)\n\nThats pretty much everything you need to know about the tree.\n\n\nTest\n----\n\n$ python setup.py test\n\nLow-Level\n+++++++++\n\nIn some cases, users may want to utilize the lower-level interface that accesses\nthe nodes of the tree:\n\n >>> inter = IntervalNode(Interval(22, 33))\n >>> inter = inter.insert(Interval(44, 55))\n >>> inter.intersect(24, 26)\n [Interval(22, 33)]\n\n >>> inter.left(Interval(34, 35), n=1)\n [Interval(22, 33)]\n\n >>> inter.right(Interval(34, 35), n=1)\n [Interval(44, 55)]",
"bugtrack_url": null,
"license": "",
"summary": "fast, simple interval intersection",
"version": "0.2.2",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "40baa7ec481405e93afcc85b9e051e204d2a32b2f7cad2ae4b6c9fb60e7ecbbe",
"md5": "1fb15edbcfba1f1d093e3b1227298db3",
"sha256": "d3e65b55b7f48e6105b11b1e1d6f37ccbf8caecfc7d7db7aba73dfaf6d732a9c"
},
"downloads": -1,
"filename": "quicksect-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "1fb15edbcfba1f1d093e3b1227298db3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 79763,
"upload_time": "2019-06-04T16:41:36",
"upload_time_iso_8601": "2019-06-04T16:41:36.081153Z",
"url": "https://files.pythonhosted.org/packages/40/ba/a7ec481405e93afcc85b9e051e204d2a32b2f7cad2ae4b6c9fb60e7ecbbe/quicksect-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2019-06-04 16:41:36",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "quicksect"
}