Skip to main content

A library for rapid computation of Neuroglancer Precomputed shard hashes.

Project description

Automated Tests PyPI version

shard-computer

Perform accelerated shard hash computation for Neuroglancer Precomputed shards.

import shardcomputer

preshift_bits = 0
shard_bits = 11
minishard_bits = 8

label = 12949142

shard_no = shardcomputer.shard_number(label, preshift_bits, shard_bits, minishard_bits)

# let labels be a uint64 numpy array of labels
# e.g. set(['4d2'])
shard_no_set = shardcomputer.unique_shard_numbers(
	labels, preshift_bits, shard_bits, minishard_bits
)

# Returns shard number -> label list dict
# e.g. {'4d2': [12949142]}
shard_no_to_labels = shardcomputer.assign_labels_to_shards(
	label, preshift_bits, shard_bits, minishard_bits
)

Install

pip install shard-computer

Credits

Thank you to Austin Appleby for placing MurMurhash3 into the public domain.

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

shard-computer-1.1.1.tar.gz (15.5 kB view hashes)

Uploaded source

Built Distributions

shard_computer-1.1.1-cp312-cp312-win32.whl (64.1 kB view hashes)

Uploaded cp312

shard_computer-1.1.1-cp311-cp311-win32.whl (64.3 kB view hashes)

Uploaded cp311

shard_computer-1.1.1-cp310-cp310-win32.whl (63.4 kB view hashes)

Uploaded cp310

shard_computer-1.1.1-cp39-cp39-win_amd64.whl (68.9 kB view hashes)

Uploaded cp39

shard_computer-1.1.1-cp39-cp39-win32.whl (63.5 kB view hashes)

Uploaded cp39

shard_computer-1.1.1-cp38-cp38-win_amd64.whl (69.2 kB view hashes)

Uploaded cp38

shard_computer-1.1.1-cp38-cp38-win32.whl (63.4 kB view hashes)

Uploaded cp38

shard_computer-1.1.1-cp37-cp37m-win32.whl (64.5 kB view hashes)

Uploaded cp37

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