Skip to main content

fdars_core/
dim.rs

1//! Dimensionality selector shared by the unified depth/fdata dispatchers.
2//!
3//! Several depth measures and `fdata::mean` historically shipped `_1d` / `_2d`
4//! variants where the `_2d` path was a thin shim that simply forwarded to the
5//! `_1d` primitive (the 2D computation never diverged from the 1D one — both
6//! iterate the flattened column-major grid identically). The unified
7//! dispatchers take an explicit [`Dim`] argument so callers get one ergonomic
8//! `name(…, dim)` entry point, while the redundant `_2d` shims are retired via
9//! `#[deprecated]`.
10//!
11//! The enum is `#[non_exhaustive]` so future dimensionalities (or a genuinely
12//! divergent 2D path) can be added without a breaking change.
13
14/// Dimensionality selector for the unified depth/fdata dispatchers.
15///
16/// Both arms currently forward to the same `_1d` primitive because the `_2d`
17/// path never diverged; the `dim` argument makes caller intent explicit and
18/// gives a single future seam should a real 2D specialization ever be needed.
19#[derive(Debug, Clone, Copy, PartialEq, Eq)]
20#[non_exhaustive]
21pub enum Dim {
22    /// 1D functional data (curves).
23    One,
24    /// 2D functional data (surfaces, flattened column-major).
25    Two,
26}