Expand description
NumPy .npy file I/O.
This module provides functions to read and write NumPy .npy files,
enabling interoperability with Python-based analysis tools.
§Example
ⓘ
use pedalkernel_validate::npy;
// Write test output
let output = vec![0.1, 0.2, 0.3, 0.4, 0.5];
npy::write_f64("output.npy", &output).unwrap();
// Read reference data
let reference = npy::read_f64("golden.npy").unwrap();
// Check if a file exists
if npy::exists("reference.npy") {
// Load and compare
}§Python Interoperability
Files written by this module can be loaded in Python:
import numpy as np
data = np.load("output.npy")And Python-generated files can be read:
import numpy as np
golden = np.sin(np.linspace(0, 2*np.pi, 1000))
np.save("golden.npy", golden)