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.3.1-cp311-cp311-manylinux_2_34_x86_64.whl (353.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

File details

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

File metadata

File hashes

Hashes for allotax-0.3.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 dffa1e7da309d24db07276b476bfa9175e2e1df33275cf0e0f2f88a5e0868b02
MD5 432e2af063432d41b3469ba31cfacd09
BLAKE2b-256 4a8b9bfd177bb9fb8120fda53b5ddd16558f3bba73543145f08326c6cc347295

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