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 Distribution

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

allotax-0.2.1-cp311-cp311-manylinux_2_34_x86_64.whl (339.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

File details

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

File metadata

File hashes

Hashes for allotax-0.2.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3c91a6e79bbf979ab9ba9ba14a07c8242008b273a68819dcab01a07b5be1caab
MD5 6e7d235a9cf233ae55bef75653d1c34f
BLAKE2b-256 75826116bcb28c04219dd7d51435a3eb94dbecec409a017f1db8a9332592985f

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