river-data-core
Shared library for the river-data platform: sync protocol, control plane types, and data toolbox.
Features
client— sync service HTTP client (reqwest)server— sync control plane handlers (axum, sea-orm)toolbox— RIVER lab data toolset
Toolbox
Rust implementations of calculation functions originally written in R. Each function is tested against the original R output using 12,500+ bulk random cases to ensure numerical equivalency.
Running tests
Regenerating R fixtures
Produces tests/fixtures/golden_values.json. Deterministic output via set.seed(42). Requires R >= 4.0 and jsonlite.
Verifying R reference integrity
Proves each file in r_reference/functions/ is a byte-exact copy of the portal source.
Adding a new function
To port an R function to Rust, add the original R code as a new file in r_reference/functions/ with source attribution, add test cases to r_reference/generate_fixtures.R, and submit a PR to @evanjt.