1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Rust-backed reductions for NumPy arrays (plain + NaN-aware).
//!
//! The kernel modules (`finite`, `parallel`, `reducers_1d`, `axis`) are pure
//! Rust with no PyO3/NumPy dependency. The PyO3 extension (`reducers._core`) is
//! compiled only with the `python` / `extension-module` feature.
//!
//! # Rust usage
//!
//! ```
//! use reducers::{reducers_1d, ScanPolicy};
//!
//! let v = [1.0_f64, 2.0, f64::NAN, 4.0];
//! // NaN-aware mean (np.nanmean parity: skip NaN, keep inf):
//! assert_eq!(reducers_1d::mean(&v, ScanPolicy::SkipNan), 7.0 / 3.0);
//! // Plain mean propagates NaN (np.mean):
//! assert!(reducers_1d::mean(&v, ScanPolicy::AllValues).is_nan());
//! // Finite-only (ignore inf too):
//! let w = [1.0_f64, f64::INFINITY, 3.0];
//! assert_eq!(reducers_1d::mean(&w, ScanPolicy::SkipNonFinite), 2.0);
//! ```
pub use ;
use pymodule;