Skip to main content

Fast allotaxonometer computation powered by Rust

Project description

allotax

Python bindings for allotax-core — fast allotaxonometer computation powered by Rust via PyO3.

Install

pip install allotax

Usage

import allotax

sys1 = {"types": ["word_a", "word_b", "word_c"], "counts": [100.0, 50.0, 25.0]}
sys2 = {"types": ["word_b", "word_c", "word_d"], "counts": [80.0, 40.0, 20.0]}

# Single alpha — lean display result
result = allotax.compute_allotax(sys1, sys2, alpha=1.0)
# result keys: normalization, delta_sum, diamond_counts, max_delta_loss, wordshift, balance, alpha

# Multiple alphas at once (shared combElems step, Rayon-parallelized)
result = allotax.compute_allotax_multi_alpha(sys1, sys2, alphas=[0.5, 1.0, float("inf")])
# result keys: balance, alpha_results

# Full intermediate data (for custom downstream processing)
result = allotax.compute_allotax_full(sys1, sys2, alpha=1.0)
result = allotax.compute_allotax_multi_alpha_full(sys1, sys2, alphas=[0.5, 1.0])

API

Function Returns
compute_allotax(sys1, sys2, alpha, wordshift_limit=200) Lean display dict for a single α
compute_allotax_full(sys1, sys2, alpha) Full intermediate result for a single α
compute_allotax_multi_alpha(sys1, sys2, alphas, wordshift_limit=200) Lean display dict for multiple α values
compute_allotax_multi_alpha_full(sys1, sys2, alphas) Full intermediate result for multiple α values
rank_turbulence_divergence(ranks1, ranks2, counts1, counts2, alpha) RTD only (pre-combined data)

Input systems are plain dicts with "types" (list of str) and "counts" (list of float).

References

Gallagher et al. (2021). Generalized word shift graphs. EPJ Data Science, 10(1), 4.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

allotax-0.2.0-cp313-cp313-manylinux_2_34_x86_64.whl (339.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

allotax-0.2.0-cp311-cp311-manylinux_2_34_x86_64.whl (339.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

File details

Details for the file allotax-0.2.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for allotax-0.2.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 097113619eec84e828c7af1df68701d6c762c79edaae266437a3a8139025e0b3
MD5 43fa82ec86f1bd3611083bee8cbe2fae
BLAKE2b-256 f6b32d9d14621f5c78c8d3fd8f668f914c2737213632586109179c7a7a7dd97a

See more details on using hashes here.

File details

Details for the file allotax-0.2.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for allotax-0.2.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 dab73e6072b2aa350429fd2628adb90a3b319ad71cc74cbe25de04b7e7c93971
MD5 c893f15d0407b4f8a983fabea27dbc1e
BLAKE2b-256 637353a4cfef1e9655a744c3ffd11992a997aa3ad4d3ef483738cb7615e0e6f2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page