Skip to content

RIVER-EPFL/river-data-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

cargo test --features toolbox                        # all tests (unit + golden)
cargo test --features toolbox --test toolbox_golden   # golden value tests only
cargo test --features toolbox --lib                   # unit tests only

Regenerating R fixtures

Rscript r_reference/generate_fixtures.R

Produces tests/fixtures/golden_values.json. Deterministic output via set.seed(42). Requires R >= 4.0 and jsonlite.

Verifying R reference integrity

Rscript r_reference/verify_integrity.R <path_to_calculation_functions.R>

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.

About

Common types & traits for the in the river-data platform

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors