ump_spec.rules.intervals
module ump-spec
Interval helpers: envelopes, widening, width labels, imputed bands, audit level min (G-AUD-01).
Functions
Section titled “Functions”z_for_level
Section titled “z_for_level”function
def z_for_level(level: float) -> floatSource: packages/ump-spec/src/ump_spec/rules/intervals.py, line 23
envelope
Section titled “envelope”function
def envelope(intervals: Iterable[Interval], *, level: float | None = None) -> IntervalSmallest interval covering every input (used for assumed alignments and dependence). level is
the declared level to report (spec §5 rule 4: the envelope keeps the declared level); without it the
highest input level is reported.
Source: packages/ump-spec/src/ump_spec/rules/intervals.py, line 27
function
def widen(interval: Interval, factor: float, center: float | None = None) -> IntervalScale each side’s distance from center (default midpoint) by factor.
Source: packages/ump-spec/src/ump_spec/rules/intervals.py, line 38
widen_beyond
Section titled “widen_beyond”function
def widen_beyond(interval: Interval, value: float, factor: float = 2.0) -> IntervalG-SCN-03: interval doubled beyond seen spend (around the point value).
Source: packages/ump-spec/src/ump_spec/rules/intervals.py, line 45
impute_band
Section titled “impute_band”function
def impute_band( value: float, rel_half_width: float = DEFAULT_IMPUTED_REL_HALF_WIDTH, level: float = 0.9, library_sd: float | None = None,) -> IntervalG-UNC-01 imputation: from the library spread (sd on the value scale) if known, else a proposed tier-default relative band.
Source: packages/ump-spec/src/ump_spec/rules/intervals.py, line 50
relative_width
Section titled “relative_width”function
def relative_width(value: float, interval: Interval) -> floatSource: packages/ump-spec/src/ump_spec/rules/intervals.py, line 61
width_label
Section titled “width_label”function
def width_label(value: float, interval: Interval) -> strnarrow (<= .35), moderate (<= .70), wide; relative to |value|. Cut points proposed.
Source: packages/ump-spec/src/ump_spec/rules/intervals.py, line 67
audit_level_min
Section titled “audit_level_min”function
def audit_level_min(levels: Iterable[int]) -> intG-AUD-01: an artifact’s audit level is the lowest of its inputs (1 if no inputs known).
Source: packages/ump-spec/src/ump_spec/rules/intervals.py, line 77
Constants
Section titled “Constants”| Name | Type | Value | Description |
|---|---|---|---|
WIDTH_CUTS | dict[str, float] | {'narrow': 0.35, 'moderate': 0.7} | Relative width cut points, proposed (UI convention, not from a study). |
WIDTH_CUTS_PROPOSED | True | ||
DEFAULT_IMPUTED_REL_HALF_WIDTH | 0.5 | Proposed tier-default band when no uncertainty and no library spread exist (G-UNC-01). | |
DEFAULT_UNDECLARED_WIDEN | 1.5 | Proposed widening factor for an assumed estimand field with no registered alternatives (spec §5 rule 4, method imputed). Mirrors envelope.widen_factor in registries/source_types.yaml, which rules.estimands.widen_factor reads (with a per-source override); kept for callers that widen later. |