Physical measurement & uncertainty evaluation library for MoonBit
| Package | Purpose |
|---|---|
| src/measure | Facade API for common measurement workflows |
| src/types | Quantities, instruments, uncertainty components, and shared records |
| src/uncertainty | Propagation, Monte Carlo simulation, and effective degrees of freedom |
| src/regression | Linear, weighted, polynomial, and confidence-band fitting |
| src/matrix | Checked dense linear algebra and decompositions |
| src/interpolation | One-dimensional, grid, spline, and barycentric interpolation |
| src/statistics | Summaries, robust statistics, covariance, and model metrics |
| src/calibration | Instrument response calibration and diagnostics |
| src/units | SI dimensions, unit parsing, and conversions |
| src/sigfig | Significant-figure rounding and formatted results |
| src/exporter | Markdown, LaTeX, and HTML report tables |
let readings = [5.01, 5.02, 5.00, 5.03]
let result = @measure.measure_sample(
"Voltage",
readings,
resolution=0.01,
unit="V",
)
println(@measure.format_result(result))let reference = [0.0, 10.0, 20.0]
let observed = [0.0, 10.5, 19.0]
let curve = @calibration.CalibrationCurve::fit(reference, observed).unwrap()
let corrected = curve.correct(10.5).unwrap()
let quality = curve.diagnostics(0.75).unwrap()let model = @calibration.PolynomialCalibration::fit(
[0.0, 1.0, 2.0, 3.0],
[1.0, 2.1, 5.2, 10.3],
2,
).unwrap()
let predicted = model.predict(1.5)moon add wjyupl/measure@0.1.2moon fmt --check
moon info
moon check --deny-warn
moon test --deny-warnmoon check --target all --deny-warn
moon test --target all --deny-warnpowershell -NoProfile -ExecutionPolicy Bypass -File .\tools\run-benchmarks.ps1 -Runs 5moonbit-measure/
├── .github/workflows/check.yml # cross-platform formatting, checks, tests, coverage
├── cmd/benchmarks/ # deterministic native benchmark workload
├── docs/ # reproducibility and benchmark records
├── src/ # library packages and tests
├── tools/ # local benchmark scripts
├── LICENSE # Apache License 2.0
├── moon.mod # MoonBit module metadata
└── README.mdInstall
Download zipPhysical measurement & uncertainty evaluation library for MoonBit