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
//! Sample construction policies.
//!
//! Distinct from `antecedent_counterfactual::AbductionMissingPolicy` (abduction).
//!
//! SPDX-License-Identifier: MIT OR Apache-2.0
/// How missing values (validity bits) affect row selection.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Default)]
pub enum MissingPolicy {
/// Drop any row where a requested column is invalid.
#[default]
CompleteCase,
/// Fail if any requested column has an invalid value in a candidate row.
ErrorOnMissing,
}
/// How the optional analysis mask is applied.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Default)]
pub enum MaskPolicy {
/// Intersect the analysis mask with complete-case / validity filtering.
#[default]
Honor,
/// Ignore the analysis mask (still apply missingness policy).
Ignore,
}
/// How observation weights are exposed on the prepared sample.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Default)]
pub enum WeightPolicy {
/// Use storage weights when present; otherwise unit weights.
#[default]
Honor,
/// Always use unit weights.
Unit,
/// Ignore weights entirely (`PreparedSample.weights` is `None`).
Ignore,
}