Skip to main content

No project description provided

Reason this release was yanked:

Bug when adding in full tree

Project description

SumTree

This module contains a SumTree implementation in Rust with Python wrappers. Speedup is around 10x in comparison to an equivalent full Python implementation.

Check the project on github: https://github.com/yamoling/sumtree

Usage

Initialisation

from sumtree import SumTree
st = SumTree(1024)
st.add(10)
print(st.total)     # 10
print(len(st))      # 1
print(st.capacity)  # 1024

Sampling data

from sumtree import SumTree
st = SumTree(1024)
for i in range(1024):
    st.add(i)
index, value = st.get(500)
print(index, value)  # 32, 32.0

Building and testing the package

virtualenv venv
source venv/bin/activate
pip install maturin
maturin develop --release

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

sumtree-0.1.2.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

sumtree-0.1.2-cp38-cp38-manylinux_2_28_x86_64.whl (197.5 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.28+ x86-64

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