API: vaft.validation
Generated from each module's __all__ by python -m vaft._api_catalog:
282 published objects in 28 modules.
Signatures and summaries are read from the source; nothing here is written by hand.
All API pages
No object matches.
vaft.validation
VAFT’s scientific assessment layer (issue #253).
FAILURE_MODES
data
FAILURE_MODES = ('accepted', 'rejected', 'collapsed', 'boundary_failure', 'axis_failure', 'solver_failure', 'unknown')
PHASES
data
PHASES = ('vacuum', 'ramp_up', 'flat', 'ramp_down', 'unknown')
STAGE_METRICS
data
STAGE_METRICS = <builtins.dict>
STAGE_PRECONDITIONS
data
STAGE_PRECONDITIONS = <builtins.dict>
STAGE_VALIDATION_PLOTS
dataDeprecated
STAGE_VALIDATION_PLOTS = <builtins.dict>
Deprecated: vaft.validation.STAGE_VALIDATION_PLOTS moved to vaft.database.production_qa (issue #338): it is stage-QA artifact policy, not scientific validation. Import it from there.
vaft.validation.applicability
Approximation applicability: whether a model’s orderings hold for a state (#1639 A, #1628).
APPLICABILITY_STATUSES
data
APPLICABILITY_STATUSES = ('SUPPORTED', 'OUTSIDE', 'UNASSESSED', 'NOT_APPLICABLE')
ApproximationContract
class
source
ApproximationContract(name: str, physical_model: str, assumptions: tuple[OrderingAssumption, ...], references: tuple[str, ...] = (), limitations: tuple[str, ...] = (), applies_to: Mapping[str, tuple] = <factory>) -> None
The orderings one model or approximation relies on, with where they come from.
6 fields
name: strphysical_model: strassumptions: tuple[OrderingAssumption, ...]references: tuple[str, ...]limitations: tuple[str, ...]applies_to: Mapping[str, tuple]
as_evidence
function
source
as_evidence(result: ContractEvaluation, *, key: str | None = None)
Place a contract result on the applicability credibility axis.
AssumptionResult
class
source
AssumptionResult(quantity: str, value: float, margin: float, status: str, reason: str = '') -> None
One assumption evaluated on one state.
5 fields
quantity: strvalue: floatmargin: floatstatus: strreason: str
ContractEvaluation
class
source
ContractEvaluation(contract: str, status: str, assumptions: tuple[AssumptionResult, ...], limiting: str | None, reason: str = '') -> None
A contract evaluated on one state: every assumption, then the composition.
evaluate_contract
function
source
evaluate_contract(contract: ApproximationContract, state: Any) -> ContractEvaluation
Evaluate every assumption of contract on one state.
evaluate_population
function
source
evaluate_population(contract: ApproximationContract, table: Any, *, keep: Sequence[str] = ()) -> Any
Evaluate contract on every row of a table; one output row per input row.
ordering_margin
function
source
ordering_margin(value: Any, ordering: str, threshold: float = 1.0) -> float
Decades by which value satisfies an ordering against threshold.
OrderingAssumption
class
source
OrderingAssumption(quantity: str, ordering: str, scale: str, scope: str = 'global', threshold: float = 1.0, threshold_source: str = '', meaning: str = '') -> None
One asymptotic assumption a model makes: quantity is small or large.
7 fields
quantity: strordering: strscale: strscope: strthreshold: floatthreshold_source: strmeaning: str
ORDERINGS
data
ORDERINGS = ('small', 'large')
SCOPES
data
SCOPES = ('global', 'local', 'profile', 'edge', 'time_history', 'event', 'mode')
successive_discrepancy
function
source
successive_discrepancy(values: Iterable[Any], *, reference: Any = None) -> list[float]
Relative change of an observable along a model or representation hierarchy.
summarize_population
function
source
summarize_population(evaluated: Any, contract: ApproximationContract) -> dict[str, Any]
Population-level applicability of one contract from evaluate_population output.
vaft.validation.channel_decision
The per-channel, per-slice decision an equilibrium code consumes (issue #296).
ChannelDecision
class
source
ChannelDecision(kind: str, index: int, name: str, state: np.ndarray, weight_factor: np.ndarray, value: np.ndarray | None = None, uncertainty: np.ndarray | None = None, provenance: str = 'measured', reasons: tuple[str, ...] = ()) -> None
One channel’s decision on the consumer’s time grid.
9 fields · 5 members
ChannelDecisions
class
source
ChannelDecisions(times: np.ndarray, entries: Mapping[tuple[str, int], ChannelDecision] = <factory>) -> None
Every submitted channel’s decision on one time grid.
2 fields · 6 members
times: np.ndarrayentries: Mapping[tuple[str, int], ChannelDecision]getmethod sourceindicesmethod sourcestate_atmethod sourcereplacedmethod — A new container with these decisions swapped in (same grid). sourcesummarymethod — Channel-slice counts per state, per kind. sourceas_dictmethod source
decision_from_codes
function
source
decision_from_codes(kind: str, index: int, name: str, codes: np.ndarray | None, n_slices: int, *, min_validity: int, suspect_code: int, suspect_weight_factor: float | None = None, reasons: Iterable[str] = ()) -> ChannelDecision
A decision from per-slice validity codes.
MISSING
data
MISSING = 3
missing_decision
function
source
missing_decision(kind: str, index: int, name: str, n_slices: int) -> ChannelDecision
PROVENANCE_MEASURED
data
PROVENANCE_MEASURED = 'measured'
REASON_CONDEMNED
data
REASON_CONDEMNED = 'condemned_whole_record'
REASON_MANUAL_LIST
data
REASON_MANUAL_LIST = 'manual_exclusion_list'
REASON_NO_SIGNAL
data
REASON_NO_SIGNAL = 'no_signal'
REASON_PROJECTED_VALIDITY
data
REASON_PROJECTED_VALIDITY = 'projected_validity'
RECOVERED
data
RECOVERED = 4
REJECTED
data
REJECTED = 2
rejected_decision
function
source
rejected_decision(kind: str, index: int, name: str, n_slices: int, *, reason: str | Iterable[str]) -> ChannelDecision
state_name
function
source
state_name(code: int) -> str
STATE_NAMES
data
STATE_NAMES = ('usable', 'suspect', 'rejected', 'missing', 'recovered')
SUSPECT
data
SUSPECT = 1
USABLE
data
USABLE = 0
usable_decision
function
source
usable_decision(kind: str, index: int, name: str, n_slices: int, *, reasons: Iterable[str] = ()) -> ChannelDecision
weight_factor_for
function
source
weight_factor_for(state: np.ndarray, *, suspect_weight_factor: float = 1.0) -> np.ndarray
The deterministic state -> weight-factor mapping.
vaft.validation.credibility
The credibility taxonomy: which question a piece of evidence answers (issue #1639).
AXES
data
AXES = ('source_evidence', 'transformation', 'inference', 'applicability', 'numerical', 'independent_validation')
CATEGORY_AXES
data
CATEGORY_AXES = <builtins.mappingproxy>
CHECK_AXES
data
CHECK_AXES = <builtins.mappingproxy>
compose
function
source
compose(evidence: Iterable[Evidence]) -> dict[str, ValidationStatus]
One status per axis that has evidence, never one status overall.
COST_CLASSES
data
COST_CLASSES = ('cheap', 'moderate', 'expensive')
CRITERIA_AXES
data
CRITERIA_AXES = <builtins.mappingproxy>
DIAMAGNETIC_CHECKS
data
DIAMAGNETIC_CHECKS = ('physical_validity.diamagnetic_flux', 'independent_validation.diamagnetic_energy', 'independent_validation.virial_me...
Evidence
class
source
Evidence(axis: str, key: str, status: ValidationStatus, metrics: Mapping[str, Any] = <factory>, reasons: tuple[str, ...] = (), cost: str = 'cheap', role: str | None = None) -> None
One assessment’s conclusion, placed on one credibility axis.
7 fields · 1 members
axis: strkey: strstatus: ValidationStatusmetrics: Mapping[str, Any]reasons: tuple[str, ...]cost: strrole: str | Noneas_dictmethod — Plain, JSON-ready fields; a non-finite number becomesNone. source
evidence_from_efit_criteria
function
source
evidence_from_efit_criteria(evaluation: Mapping[str, Any], *, used_for_inference: Iterable[str] = ()) -> tuple[Evidence, ...]
Pilot A: the #891/#1331 study criteria (version 2) on the credibility axes.
evidence_from_equilibrium_report
function
source
evidence_from_equilibrium_report(report: Mapping[str, Any], *, used_for_inference: Iterable[str] = ()) -> tuple[Evidence, ...]
Pilot A: vaft.validation.validate_equilibrium on the credibility axes.
EVIDENCE_ROLES
data
EVIDENCE_ROLES = ('used_for_inference', 'independent_validation', 'available_not_used', 'rejected', 'assumed', 'inferred')
vaft.validation.efit_channels
The acceptance policy that decides which magnetic channels EFIT may use (issue #296).
condemned_channels
function
source
condemned_channels(source: Any, *, nbprobe: int) -> set[int]
Legacy-style combined zero-based indexes of channels condemned outright.
decide_efit_channels
function
source
decide_efit_channels(source: Any, times: Any, *, nbprobe: int | None = None, manual_rejections: Iterable[int] = (), min_validity: int = 0, suspect_weight_factor: float | None = None, suspects: Mapping[tuple[str, int], str] | None = None, kinds: Iterable[str] = ('b_field_pol_probe', 'flux_loop')) -> ChannelDecisions
Decide every EFIT-facing magnetics channel at every slice of times.
EFIT_KINDS
data
EFIT_KINDS = ('b_field_pol_probe', 'flux_loop')
efit_probe_count
function
source
efit_probe_count(source: Any) -> int
The number of B-pol probes EFIT’s geometry represents.
EFIT_QUANTITY
data
EFIT_QUANTITY = <builtins.dict>
split_manual_rejections
function
source
split_manual_rejections(manual: Iterable[int], *, nbprobe: int) -> dict[tuple[str, int], int]
Combined one-based indexes -> (kind, index).
vaft.validation.equilibrium
The unified equilibrium validation report (issue #72; #253 §13-§16).
aggregate_status
function
source
aggregate_status(statuses: Iterable[ValidationStatus | str]) -> ValidationStatus
Summarize several statuses without collapsing the undecided ones.
EQUILIBRIUM_CATEGORIES
data
EQUILIBRIUM_CATEGORIES = ('verification', 'diagnostic_fit', 'physical_validity', 'independent_validation')
status_summary
function
source
status_summary(report: Mapping[str, Any]) -> dict[str, ValidationStatus]
One ValidationStatus per category present in report.
thomson_pressure_samples
function
source
thomson_pressure_samples(equilibrium: Any, time_slice: int, diagnostics: Any, *, tolerance: float | None = None) -> dict[str, Any]
The Thomson channels of one slice, placed on its flux surfaces.
validate_equilibrium
function
source
validate_equilibrium(equilibrium: Any, *, diagnostics: Any | None = None, kinetic_profiles: Any | None = None, checks: Iterable[str] = ('verification', 'diagnostic_fit', 'physical_validity', 'independent_validation'), time_slice: int | Sequence[int] | None = None) -> dict[str, Any]
The unified equilibrium validation report (#72).
Also exported as vaft.validation.validate_equilibrium.
validate_independent
function
source
validate_independent(equilibrium: Any, *, time_slice: int, kinetic_profiles: Any | None = None, diagnostics: Any | None = None) -> dict[str, dict[str, Any]]
Agreement with measurements the reconstruction never used, one slice (#72 §4).
validate_magnetic_fit
function
source
validate_magnetic_fit(equilibrium: Any, *, time_slice: int) -> dict[str, dict[str, Any]]
Constraint-fit assessment for one slice, per check (#72 §2, #69).
validate_physical
function
source
validate_physical(equilibrium: Any, *, time_slice: int, diagnostics: Any | None = None) -> dict[str, dict[str, Any]]
Force-balance and plausibility checks for one slice (#72 §3).
verify_continuity
function
source
verify_continuity(equilibrium: Any, *, time_slice: int | Sequence[int] | None = None) -> dict[str, Any]
Time-slice continuity across the selected slices (#72 §1).
verify_convention
function
source
verify_convention(equilibrium: Any, *, time_slice: int) -> dict[str, Any]
COCOS sign relations for one slice, via vaft.process.cocos.validate_cocos.
verify_convergence
function
source
verify_convergence(equilibrium: Any, *, time_slice: int) -> dict[str, Any]
The solver’s own convergence evidence for one slice (#70).
verify_structure
function
source
verify_structure(equilibrium: Any, *, time_slice: int) -> dict[str, Any]
Numerical and structural checks for one slice (#72 §1).
vaft.validation.equilibrium_cohorts
What failed, in which operating regime (issue #76).
cohort_rows
function
source
cohort_rows(outcomes: Iterable[SliceOutcome]) -> list[dict[str, Any]]
One flat record per slice, every column of _COLUMNS.
CohortJoin
class
source
CohortJoin(outcomes: tuple[SliceOutcome, ...], unmatched_log_times: tuple[int, ...]) -> None
The joined slices, and every way the join was incomplete.
Also exported as vaft.validation.CohortJoin.
2 fields
outcomes: tuple[SliceOutcome, ...]unmatched_log_times: tuple[int, ...]
FAILURE_MODES
data
FAILURE_MODES = ('accepted', 'rejected', 'collapsed', 'boundary_failure', 'axis_failure', 'solver_failure', 'unknown')
join_regime_and_termination
function
source
join_regime_and_termination(ods: Any, slices: Sequence[Mapping[str, Any]], *, policy=None, slice_statuses: Sequence[Mapping[str, Any]] | None = None, shot: int | None = None, source: str = 'unknown', **evidence: Any) -> CohortJoin
Put each reconstruction slice’s regime beside how EFIT ended it.
Also exported as vaft.validation.join_regime_and_termination.
representative_cases
function
source
representative_cases(outcomes: Iterable[SliceOutcome], *, group_by: Sequence[str] = ('phase',), per_cohort: int = 1) -> dict[str, dict[str, list[dict[str, Any]]]]
Deterministic example slices per cohort: successes and failures.
SliceOutcome
class
source
SliceOutcome(time: float, regime: RegimeLabels, termination: Mapping[str, Any] | None, mode: str, quality: str = 'unknown', shot: int | None = None, source: str = 'unknown') -> None
One slice: the regime it was in, and what became of it.
Also exported as vaft.validation.SliceOutcome.
7 fields · 11 members
time: floatregime: RegimeLabelstermination: Mapping[str, Any] | Nonemode: strquality: strshot: int | Nonesource: strphaseproperty sourcetopologyproperty sourcecurrent_binproperty sourcerate_binproperty sourceeraproperty sourceeventproperty sourcesucceededproperty — Whether the slice is a usable reconstruction. sourcesolver_routinesproperty sourcewarning_routinesproperty sourcefailure_codesproperty sourceas_dictmethod — A JSON-safe record carrying both halves and their inputs. source
summarize_by_cohort
function
source
summarize_by_cohort(outcomes: Iterable[SliceOutcome], *, group_by: Sequence[str] = ('phase',)) -> dict[str, Any]
Outcome counts per cohort, plus what each cohort’s failures blame.
Also exported as vaft.validation.summarize_by_cohort.
write_cohort_table
function
source
write_cohort_table(rows: Sequence[Mapping[str, Any]], path: str | Path, *, policy=None) -> Path
Write the joined table as CSV or Parquet (by suffix), with its rule.
vaft.validation.equilibrium_quality
Equilibrium-quality cohorts: why a reconstruction is good, admissible or unreconstructible (#1644).
ADMISSIBILITY_RULES
data
ADMISSIBILITY_RULES = <builtins.tuple>
COHORTS
data
COHORTS = ('good', 'admissible', 'unreconstructible')
CONFINEMENT_RULES
data
CONFINEMENT_RULES = ('finite', 'ip_min', 'dwdt_fraction', 'ip_change_per_tau')
CRITERIA_PATH
data
CRITERIA_PATH = <pathlib.PosixPath>
CROSSWALK
data
CROSSWALK = <builtins.tuple>
efit_evidence_columns
function
source
efit_evidence_columns(ods: Any, time_slice: int, *, diagnostics: Any = None, kinetic_profiles: Any = None) -> dict[str, Any]
The vaft.omas.efit_quality and generic-validation columns of one equilibrium slice.
Also exported as vaft.validation.efit_evidence_columns.
equilibrium_quality_confinement_funnel
function
source
equilibrium_quality_confinement_funnel(confinement_table, *, quality_column: str = 'efit_quality', rules: Sequence[str] = ('finite', 'ip_min', 'dwdt_fraction', 'ip_change_per_tau')) -> dict[str, Any]
Equilibrium quality × confinement acceptance (#1644 §9), per quality cohort.
equilibrium_quality_constraint_points
function
source
equilibrium_quality_constraint_points(ods: Any, time_slice: int) -> list[dict[str, Any]]
Every constraint channel of one slice: measured, reconstructed and normalised residual.
equilibrium_quality_crosswalk
function
source
equilibrium_quality_crosswalk(table) -> list[dict[str, Any]]
Generic validation status × study verdict, per paired concept, where both exist.
Also exported as vaft.validation.equilibrium_quality_crosswalk.
equilibrium_quality_failure_census
function
source
equilibrium_quality_failure_census(table) -> dict[str, Any]
The rule × cohort matrix (status fractions) and a failure Pareto per cohort.
Also exported as vaft.validation.equilibrium_quality_failure_census.
equilibrium_quality_summary
function
source
equilibrium_quality_summary(table) -> dict[str, Any]
Slice counts per cohort, and Thomson consistency within each.
Also exported as vaft.validation.equilibrium_quality_summary.
equilibrium_quality_table
function
source
equilibrium_quality_table(records: Iterable[Mapping[str, Any]], *, criteria: ModuleType | None = None, evidence: Callable[[Mapping[str, Any]], Mapping[str, Any] | None] | None = None)
One row per (shot, time, setting): raw metrics, verdicts and the study classification.
Also exported as vaft.validation.equilibrium_quality_table.
FIT_QUALITY_RULES
data
FIT_QUALITY_RULES = ('rule_convergence', 'rule_pressure_nonnegative', 'rule_beta_p_positive', 'rule_w_positive', 'rule_q95', 'rule_ip_rat...
load_study_criteria
function
source
load_study_criteria(path: str | Path | None = None) -> ModuleType
The #891/#1331 study criteria module: the shipped one, or a caller’s file loaded from path.
MEASUREMENT_RULES
data
MEASUREMENT_RULES = <builtins.tuple>
read_equilibrium_quality_table
function
source
read_equilibrium_quality_table(source: Any) -> Any
A cohort table written with DataFrame.to_csv read back as equilibrium_quality_table made it.
REPRESENTATIVE_CASES
data
REPRESENTATIVE_CASES = ('good_consistent', 'good_inconsistent', 'admissible_only', 'unreconstructible')
ROUTINE_SETTING
data
ROUTINE_SETTING = 'routine'
RULE_COLUMNS
data
RULE_COLUMNS = ('rule_convergence', 'rule_pressure_nonnegative', 'rule_beta_p_positive', 'rule_w_positive', 'rule_q95', 'rule_ip_rat...
select_representative_cases
function
source
select_representative_cases(table) -> list[dict[str, Any]]
Deterministic representative slices for the four #1644 cases, with why each was chosen.
slice_cohorts
function
source
slice_cohorts(table) -> Any
One row per slice: its label and, for the census, the row of its best setting.
STATUSES
data
STATUSES = ('pass', 'fail', 'indeterminate', 'not_available')
TEXT_COLUMNS
data
TEXT_COLUMNS = ('good_settings', 'admissible_settings', 'consistent_settings', 'inconsistent_settings', 'failure_reasons')
TYPICALITY_METRICS
data
TYPICALITY_METRICS = ('probe_reduced_chi2', 'loop_reduced_chi2', 'gs_residual', 'virial_log_ratio')
vaft.validation.equilibrium_regime
Which operating regime each reconstructed slice belongs to (issue #76).
classify_equilibrium_regime
function
source
classify_equilibrium_regime(ods: Any, *, time_index: int, policy: EquilibriumRegimePolicy | None = None, **evidence: Any) -> RegimeLabels
Label one slice, by classifying the discharge and taking that slice.
Also exported as vaft.validation.classify_equilibrium_regime.
classify_equilibrium_regimes
function
source
classify_equilibrium_regimes(ods: Any, *, policy: EquilibriumRegimePolicy | None = None, era: str | None = None, passive_current: tuple[Sequence[float], Sequence[float]] | None = None, events: Sequence[tuple[float, float, str]] | None = None, limloc: Mapping[int, str] | None = None) -> tuple[RegimeLabels, ...]
Label every slice of one reconstruction.
Also exported as vaft.validation.classify_equilibrium_regimes.
PHASES
data
PHASES = ('vacuum', 'ramp_up', 'flat', 'ramp_down', 'unknown')
RegimeLabels
class
source
RegimeLabels(time: float, phase: str, topology: str, current: float | None, current_rate: float | None, fraction_of_peak: float | None, limloc: str | None, rule: str, reasons: tuple[str, ...] = (), current_bin: str = 'unknown', magnitude_rate: float | None = None, rate_bin: str = 'unknown', era: str = 'unknown', event: str = 'unknown', eddy_current: float | None = None, eddy_fraction: float | None = None, version: int = 1) -> None
One slice’s cohort membership, and the evidence that put it there.
Also exported as vaft.validation.RegimeLabels.
17 fields · 1 members
time: floatphase: strtopology: strcurrent: float | Nonecurrent_rate: float | Nonefraction_of_peak: float | Nonelimloc: str | Nonerule: strreasons: tuple[str, ...]current_bin: strmagnitude_rate: float | Nonerate_bin: strera: strevent: streddy_current: float | Noneeddy_fraction: float | Noneversion: intas_dictmethod — A JSON-safe record; the inputs travel with the label. source
vaft.validation.flux_loop_assessment
Per-loop evidence for EFIT flux-loop channel selection (issue #295, step 1).
assess_flux_loops
function
source
assess_flux_loops(qualities: Iterable[Any], residual_rows: Sequence[Mapping[str, Any]] | None, *, window: tuple[float, float] | None, nbprobe: int, time: np.ndarray | None = None, projected: Mapping[int, ValidityRecord] | None = None, field_codes: Sequence[int | None] | None = None, policy: FluxLoopPolicy | None = None) -> tuple[FluxLoopAssessment, ...]
Combine intrinsic quality and model agreement into one record per loop.
flux_loop_evidence
function
source
flux_loop_evidence(ods: Any, *, policy: FluxLoopPolicy | None = None, window: tuple[float, float] | None = None, benchmark: bool = True, nbprobe: int | None = None) -> dict[str, Any]
Assemble the flux-loop evidence for one processed ODS.
FluxLoopAssessment
class
source
FluxLoopAssessment(index: int, name: str, field_code: int | None, combined_index_one_based: int, state: str, reasons: tuple[str, ...], source_validity: Mapping[str, Any], model_agreement: Mapping[str, Any] | None, window: tuple[float, float] | None, policy: Mapping[str, Any] = <factory>) -> None
One loop’s evidence and the state the policy derives from it.
10 fields · 1 members
index: intname: strfield_code: int | Nonecombined_index_one_based: intstate: strreasons: tuple[str, ...]source_validity: Mapping[str, Any]model_agreement: Mapping[str, Any] | Nonewindow: tuple[float, float] | Nonepolicy: Mapping[str, Any]as_dictmethod source
FluxLoopPolicy
class
source
FluxLoopPolicy(min_valid_fraction_in_window: float = 0.0, max_normalized_residual: float | None = None, min_correlation: float | None = None, min_wall_authority_to_score: float = 0.1, reject_on_model_disagreement: bool = False) -> None
The thresholds that turn evidence into a state. All of them are policy (#253 §7) and every record repeats the values it was judged under.
5 fields · 1 members
min_valid_fraction_in_window: floatmax_normalized_residual: float | Nonemin_correlation: float | Nonemin_wall_authority_to_score: floatreject_on_model_disagreement: boolas_dictmethod source
manual_exclusion_index
function
source
manual_exclusion_index(index: int, nbprobe: int) -> int
The one-based combined index the routine broken list uses for a loop.
NOT_AVAILABLE
data
NOT_AVAILABLE = 'not_available'
REJECT_FOR_EFIT
data
REJECT_FOR_EFIT = 'reject_for_efit'
STATES
data
STATES = ('usable', 'suspect', 'reject_for_efit', 'not_available')
SUSPECT
data
SUSPECT = 'suspect'
USABLE
data
USABLE = 'usable'
vaft.validation.imas
Adapter between validation evidence and native IMAS/OMAS status fields (issue #253).
is_condemned_channel
function
source
is_condemned_channel(source: Any, base: str, *, min_validity: int = 0) -> bool
Whether base was assessed and has no usable sample anywhere.
is_usable_channel
function
source
is_usable_channel(source: Any, base: str, *, times: np.ndarray | None = None, min_validity: int = 0, default: bool = True) -> bool
Whether base has any usable sample at all, or any of times.
read_convergence_result
function
source
read_convergence_result(source: Any, *, time_slice: int) -> dict[str, Any] | None
equilibrium.time_slice[i].convergence.result – a solver’s own verdict.
read_output_flag
function
source
read_output_flag(source: Any, ids: str = 'equilibrium', *, time_slice: int | None = None) -> Any
<ids>.code.output_flag – an external code’s execution status.
read_validity
function
source
read_validity(source: Any, base: str) -> int | None
<base>.validity, or None when the node carries none.
read_validity_record
function
source
read_validity_record(source: Any, base: str) -> ValidityRecord
The validity nodes of base, extracted and uninterpreted.
read_validity_timed
function
source
read_validity_timed(source: Any, base: str) -> np.ndarray | None
<base>.validity_timed as an integer array, or None when absent.
resolve_signal_time
function
source
resolve_signal_time(source: Any, base: str) -> np.ndarray | None
The time coordinate of the signal node at base.
resolve_signal_waveform
function
source
resolve_signal_waveform(source: Any, base: str) -> tuple[np.ndarray, np.ndarray] | None
(time, data) of the signal node at base, or None.
signal_label
function
source
signal_label(source: Any, base: str, fallback: str) -> str
The channel’s name, else its identifier, else fallback.
signal_matches_root_time
function
source
signal_matches_root_time(source: Any, base: str) -> bool
Whether base holds a waveform the length of its IDS root time.
valid_fraction
function
source
valid_fraction(source: Any, base: str, *, times: np.ndarray | None = None, window: np.ndarray | None = None, min_validity: int = 0, default: bool = True) -> float
Fraction of the samples in window that base declares usable.
validity_codes
function
source
validity_codes(source: Any, base: str, *, times: np.ndarray | None = None) -> np.ndarray | None
Validity codes for the node at base, per sample.
validity_mask
function
source
validity_mask(source: Any, base: str, *, times: np.ndarray | None = None, min_validity: int = 0, default: bool = True) -> np.ndarray
Which samples of base a consumer accepting min_validity may use.
write_validity
function
source
write_validity(source: Any, base: str, timed: Iterable[int], *, scalar: int | None = None) -> int
Project a per-sample assessment into base’s native validity nodes.
vaft.validation.kinetic_population
Population V&V of the kinetic-state atlas: input contract, evidence tables, summaries (#1835).
assemble_kinetic_population
function
source
assemble_kinetic_population(state: Any, profiles: Any, virial: Any = None, *, manifest: Optional[Mapping[str, Any]] = None, schemas: Optional[Mapping[str, Mapping[str, Any]]] = None, strict: bool = False) -> KineticPopulation
Join the atlas state, profile and virial tables under the population contract.
EVIDENCE_STATUSES
data
EVIDENCE_STATUSES = ('available', 'unavailable', 'failed')
ISSUE_COLUMNS
data
ISSUE_COLUMNS = ('scope', 'shot', 'time_efit_s', 'efit_lineage', 'check', 'status', 'detail')
KineticPopulation
class
source
KineticPopulation(population: Any, profiles: Any, issues: Any, provenance: Mapping[str, Any] = <factory>) -> None
The checked population: the joined state table, its profiles, and every finding.
4 fields · 1 members
population: Anyprofiles: Anyissues: Anyprovenance: Mapping[str, Any]failedproperty — True when any finding has statusfail. source
population_evidence_summary
function
source
population_evidence_summary(population: KineticPopulation, *, by: Sequence[str] = ('efit_lineage',))
Counts and quartiles of every evidence quantity, by lineage (or by) and validation role.
PopulationContractError
class
source
The atlas tables break the population contract (duplicate keys, missing columns, or a strict failure).
pressure_evidence
function
source
pressure_evidence(population: KineticPopulation)
One row per (state, pressure ratio): value, support, validation role and status.
PRESSURE_RATIOS
data
PRESSURE_RATIOS = <builtins.dict>
read_kinetic_population
function
source
read_kinetic_population(atlas: str | Path, *, virial: Any = None, strict: bool = False) -> KineticPopulation
Read an atlas directory (v1/state.csv, profiles.csv, MANIFEST.json, schema/) and assemble it.
STATE_KEY
data
STATE_KEY = ('shot', 'time_efit_s', 'efit_lineage')
validation_role
function
source
validation_role(lineage: str) -> str
The validation role of an EFIT lineage; raises for an unknown one.
VALIDATION_ROLES
data
VALIDATION_ROLES = <builtins.dict>
virial_evidence
function
source
virial_evidence(population: KineticPopulation)
One row per (state, virial quantity): value, family, the study verdict, validation role and status.
VIRIAL_QUANTITIES
data
VIRIAL_QUANTITIES = <builtins.dict>
vaft.validation.kinetic_state
Kinetic state of a reconstructed slice: Thomson against EFIT pressure (#1430).
CONTRACT_VERSION
data
CONTRACT_VERSION = '1'
core_profiles_electron_pressure
function
source
core_profiles_electron_pressure(profiles: Any, *, time_s: float, tolerance_s: float | None = None) -> dict[str, Any]
p_e = e n_e T_e of the core_profiles slice at time_s, on its rho_tor_norm.
core_profiles_grid_on_slice
function
source
core_profiles_grid_on_slice(coordinate: Mapping[str, Any], profile: Mapping[str, Any], *, tolerance: float = 0.02) -> dict[str, Any]
Place a core_profiles grid on the equilibrium slice it was written on.
default_tolerance
function
source
default_tolerance(times: np.ndarray) -> float
Half the median cadence, at least 1 ms – the rule vaft.validation uses.
GRID_RHO_TOLERANCE
data
GRID_RHO_TOLERANCE = 0.02
infer_ti_pressure_partition
functionDeprecated usage
source
infer_ti_pressure_partition(*args: Any, **kwargs: Any) -> dict[str, Any]
Moved to vaft.process.kinetic_closure.infer_ti_pressure_partition (#1842).
integrated_pressure_ratio
function
source
integrated_pressure_ratio(equilibrium: Any, index: int, rho_tor_norm: np.ndarray, p_e: np.ndarray, *, psi_norm_span: tuple[float, float] | None = None) -> dict[str, Any]
int p_EFIT dV / int p_e dV over a flux span of one slice.
ion_composition
function
source
ion_composition(z_eff: float = 2.0, impurity: str = 'C') -> dict[str, Any]
Ion species and densities per electron from a Z_eff closure.
LINEAGES
data
LINEAGES = ('magnetics', 'electron_kinetic')
match_thomson_pressure
function
source
match_thomson_pressure(equilibrium: Any, thomson: Any, *, time_s: float, slice_tolerance_s: float | None = None, ts_tolerance_s: float | None = None) -> dict[str, Any]
Thomson electron pressure against the EFIT pressure of the slice at time_s.
pressure_sigma
function
source
pressure_sigma(pressure: np.ndarray, neighbours: Sequence[np.ndarray] = (), *, floor: float = 0.17) -> tuple[np.ndarray, str]
The EFIT pressure uncertainty: ensemble spread with a model-form floor.
QUALITIES
data
QUALITIES = ('good', 'admissible')
rho_tor_norm_of
function
source
rho_tor_norm_of(ods: Any, index: int) -> dict[str, Any]
The slice’s (psi_norm, rho_tor_norm) profile pair, or why there is none.
slice_at_time
function
source
slice_at_time(ods: Any, time_s: float, *, ids: str = 'equilibrium', tolerance_s: float | None = None) -> tuple[int, float]
The ids slice nearest time_s, as (index, signed offset).
state_time
function
source
state_time(time_s: float) -> float
A slice time as it appears in the state key: seconds, to 1e-4 s.
vaft.validation.magnetics
Magnetics signal-quality validation (issue #189).
array_contradiction_fractions_of
function
source
array_contradiction_fractions_of(heights: Sequence[float], waveforms: np.ndarray, *, floor: float, sigma: float, min_scored: float, min_witnesses: int = 3, scale: str = 'witness') -> tuple[np.ndarray, np.ndarray]
Per-probe fraction of scorable samples over sigma, and the mask of those samples.
array_contradiction_scores
function
source
array_contradiction_scores(heights: Sequence[float], waveforms: np.ndarray, *, floor: float = 0.0, min_witnesses: int = 3) -> np.ndarray
Robust-z of each probe’s departure from its two nearest neighbours, per sample.
array_departure_ratios
function
source
array_departure_ratios(heights: Sequence[float], waveforms: np.ndarray, *, floor: float = 0.0) -> np.ndarray
Each probe’s departure from its neighbours as a multiple of the array’s own amplitude.
attribute_array_contradictions
function
source
attribute_array_contradictions(heights: Sequence[float], waveforms: np.ndarray, *, floor: float, sigma: float, fraction: float, min_members: int, min_scored: float, min_witnesses: int = 3, scale: str = 'witness') -> list[dict[str, Any]]
Which probes of one array contradict it, attributed by leave-one-out.
channel_node
function
source
channel_node(kind: str, index: int, quantity: str) -> str
The IDS node one channel’s processed quantity lives at.
ChannelQuality
class
source
ChannelQuality(kind: str, index: int, name: str, quantity: str, unit: str, status: ValidationStatus, validity: int, validity_timed: np.ndarray, valid_fraction: float, metrics: Mapping[str, float] = <factory>, events: tuple[QualityEvent, ...] = (), reason: str = '') -> None
The signal-quality assessment of one magnetic channel.
12 fields · 1 members
kind: strindex: intname: strquantity: strunit: strstatus: ValidationStatusvalidity: intvalidity_timed: np.ndarrayvalid_fraction: floatmetrics: Mapping[str, float]events: tuple[QualityEvent, ...]reason: strprojectableproperty — Whether there is a per-sample assessment to write into the IDS. source
implausible_magnitude
function
source
implausible_magnitude(amplitude: float, ceiling: float | None) -> bool
Whether a record’s amplitude exceeds an absolute physical ceiling.
magnetics_quality_metrics
function
source
magnetics_quality_metrics(source: Any, report: Iterable[ChannelQuality], *, config: MagneticsQualityConfig | None = None) -> dict[str, Any]
The diagnostics-stage magnetics block for a stage manifest (#189 req 4).
MagneticsQualityConfig
class
source
MagneticsQualityConfig(baseline_fraction: float = 0.2, min_constant_run: int = 16, significance_floor: float = 0.01, spike_sigma: float = 8.0, max_spike_samples: int = 3, offset_jump_sigma: float = 10.0, coherence_window: float = 0.0005, coherent_jump_fraction: float = 0.3, max_plausible_amplitude: Mapping[str, float] = <factory>, population_peak_factor: float | None = 4.0, array_departure_factor: float | None = 1.0, array_contradiction_fraction: float = 0.3, min_array_members: int = 7, array_min_scored: float = 0.5, array_amplitude_floor: float = 0.01) -> None
Detector thresholds, carried into the report as provenance.
15 fields
baseline_fraction: floatmin_constant_run: intsignificance_floor: floatspike_sigma: floatmax_spike_samples: intoffset_jump_sigma: floatcoherence_window: floatcoherent_jump_fraction: floatmax_plausible_amplitude: Mapping[str, float]population_peak_factor: float | Nonearray_departure_factor: float | Nonearray_contradiction_fraction: floatmin_array_members: intarray_min_scored: floatarray_amplitude_floor: float
population_peak_outliers
function
source
population_peak_outliers(amplitudes: Mapping[Any, float], factor: float | None) -> set[Any]
The members whose amplitude dwarfs the family’s median amplitude.
population_peak_ratios
function
source
population_peak_ratios(amplitudes: Mapping[Any, float]) -> dict[Any, float]
Each member’s amplitude as a multiple of its family’s median amplitude.
project_validity
function
source
project_validity(source: Any, report: Iterable[ChannelQuality]) -> dict[str, int]
Write a report’s per-sample assessment into the native validity nodes.
QualityEvent
class
source
QualityEvent(reason: str, start: float, end: float, samples: int, validity: int) -> None
One contiguous stretch of a waveform that a detector objected to.
5 fields · 1 members
reason: strstart: floatend: floatsamples: intvalidity: intas_dictmethod source
QUANTITY_BY_KIND
data
QUANTITY_BY_KIND = <builtins.dict>
recorded_faults_for
function
source
recorded_faults_for(source: Any) -> dict[tuple[str, int], str]
The channels recorded as broken for the pulse source describes.
unusable_channels_at
function
source
unusable_channels_at(source: Any, times: np.ndarray | Sequence[float], *, min_validity: int = 0, kinds: Iterable[str] = ('b_field_pol_probe', 'flux_loop')) -> dict[tuple[str, int], np.ndarray]
Which channels a consumer must not use at each instant in times.
validate_magnetics_signals
function
source
validate_magnetics_signals(source: Any, *, config: MagneticsQualityConfig | None = None, kinds: Iterable[str] = ('b_field_pol_probe', 'flux_loop'), known_faults: Mapping[tuple[str, int], str] | None | object = 'from_pulse') -> tuple[ChannelQuality, ...]
Assess every equilibrium magnetics channel’s processed waveform.
vaft.validation.ml
Bind supplied ML metrics and owner-defined criteria to credibility evidence.
build_ml_report
function
source
build_ml_report(model, evaluation, dataset, split, criteria, *, protocol)
Bind numerical evaluation to declared identities and criteria.
MetricCriterion
class
source
MetricCriterion(metric: str, axis: str, unit: str, provider: str, source: str, revision: str, lower: float | None = None, upper: float | None = None) -> None
Versioned owner-defined bounds; units/provider/source remain explicit.
8 fields
metric: straxis: strunit: strprovider: strsource: strrevision: strlower: float | Noneupper: float | None
ml_report_evidence
function
source
ml_report_evidence(report, model, evaluation, dataset, split, criteria, *, protocol, expected_report_sha256)
Verify a report against trusted inputs and emit existing per-axis Evidence.
vaft.validation.model
The shared vocabulary of the validation layer (issue #253).
CATEGORIES
data
CATEGORIES = ('verification', 'source_validity', 'diagnostic_fit', 'physical_validity', 'independent_validation')
Also exported as vaft.validation.CATEGORIES.
SEVERITIES
data
SEVERITIES = ('error', 'warning')
ValidationIssue
class
source
ValidationIssue(severity: str, code: str, field: str, message: str) -> None
One specific objection to a datum or a result.
Also exported as vaft.data.ValidationIssue, vaft.data.equilibrium.ValidationIssue.
4 fields
severity: strcode: strfield: strmessage: str
ValidationReport
class
source
ValidationReport(issues: tuple[ValidationIssue, ...] = ()) -> None
The findings from one assessment, in the order they were made.
Also exported as vaft.data.ValidationReport, vaft.data.equilibrium.ValidationReport.
ValidationStatus
class
source
What one assessment concluded.
Also exported as vaft.validation.ValidationStatus.
5 fields
PASS: 'pass'WARN: 'warn'FAIL: 'fail'INDETERMINATE: 'indeterminate'NOT_AVAILABLE: 'not_available'
vaft.validation.model_contracts
Which ordering contracts a calculation consumes, from its plasma formalism (#1823).
adapter_mode
function
source
adapter_mode(key: str) -> AdapterMode
The mode "<adapter>:<mode>"; KeyError lists the known ones.
ADAPTER_MODES
data
ADAPTER_MODES = <vaft.validation.model_contracts._Modes>
AdapterMode
class
source
AdapterMode(adapter: str, mode: str, family: str, formalism: Any, audit: str, note: str = '', transport_coupled: bool = False) -> None
A scientifically distinct mode of one code adapter, with its formalism.
advisory_ordering_check
function
source
advisory_ordering_check(formalism, state: Mapping[str, Any], points: Any = None, *, key: Optional[str] = None, transport_coupled: bool = False) -> Tuple[Tuple[AdvisoryResult, ...], Tuple[str, ...]]
Evaluate the contracts a run’s formalism consumes on that run’s input.
AdvisoryResult
class
source
AdvisoryResult(use: ContractUse, evaluation: ContractEvaluation, counts: Mapping[str, int], point: Optional[int], evidence: Any) -> None
One contract evaluated on a run’s input.
5 fields · 1 members
use: ContractUseevaluation: ContractEvaluationcounts: Mapping[str, int]point: Optional[int]evidence: Anyas_dictmethod source
contracts_for
function
source
contracts_for(formalism, *, transport_coupled: bool = False) -> Tuple[Tuple[ContractUse, ...], Tuple[str, ...]]
The contracts a formalism consumes, and why any part of it maps to none.
ContractUse
class
source
ContractUse(contract: str, role: str) -> None
One contract a calculation consumes, and the role it plays there (ROLES).
2 fields
contract: strrole: str
ordering_provenance
function
source
ordering_provenance(formalism, state: Optional[Mapping[str, Any]] = None, points: Any = None, *, transport_coupled: bool = False, notes: Sequence[str] = ()) -> Optional[Dict[str, Any]]
The advisory ordering check of one run, as a JSON-ready provenance record (#1823).
ROLES
data
ROLES = ('governing', 'outer_solution', 'layer_solution', 'fluid_part', 'kinetic_response', 'closure', 'inherited', 'transpor...
safe_ordering_provenance
function
source
safe_ordering_provenance(formalism, state: Optional[Mapping[str, Any]] = None, points: Any = None, **kwargs) -> Optional[Dict[str, Any]]
ordering_provenance that never raises: an advisory record must not cost a run its result.
vaft.validation.neoclassical
Compare the analytic neoclassical models against a drift-kinetic solve.
bootstrap_models
function
source
bootstrap_models(ods: Any, *, models: Sequence[str] = ('sauter', 'redl'), include_stored: bool = True, time_slice: Optional[int] = None, solver_charge: Optional[float] = None, solver_ion_fraction: Optional[float] = None, **options: Any) -> dict[str, Any]
Evaluate each analytic model on ods, alongside whatever it already stores.
input_readiness
function
source
input_readiness(ods: Any, *, time: Optional[float] = None, time_index: Optional[int] = None, rho_max: Optional[float] = 0.95, z_eff: Optional[float] = None, ion_index: int = 0, minimum_points: int = 8) -> dict[str, Any]
Whether this ODS is a kinetic state NEO can be run on, and what is missing.
METRICS
data
METRICS = ('integrated_relative_difference', 'rms_over_peak', 'peak_relative_difference')
model_agreement
function
source
model_agreement(comparison: Mapping[str, Any], tolerances: Mapping[str, float]) -> dict[str, Any]
Apply the caller’s tolerances to a comparison, and echo them back.
model_comparison
function
source
model_comparison(models: Mapping[str, Any], *, reference: str = 'neo') -> dict[str, Any]
Measure how far each series sits from reference. Numbers only, no status.
REQUIREMENTS
data
REQUIREMENTS = ('convertible', 'ion_temperature', 'effective_charge', 'radial_extent')
vaft.validation.orderings
Ordering contracts of the reduced plasma models (#1627 phase C).
contract
function
source
contract(name: str) -> ApproximationContract
The registered contract name; KeyError lists the known ones.
CONTRACTS
data
CONTRACTS = <builtins.dict>
GROUPS
data
GROUPS = ('foundational', 'global', 'profile', 'perturbation', 'layer', 'time_history')
margin_label
function
source
margin_label(margin: float) -> str
The MARGIN_LABELS band of an ordering margin in decades; "unassessed" for NaN.
MARGIN_LABELS
data
MARGIN_LABELS = <builtins.tuple>
ORDERING_QUANTITIES
data
ORDERING_QUANTITIES = <builtins.dict>
ORDERING_SPACES
data
ORDERING_SPACES = <builtins.dict>
ordering_threshold
function
source
ordering_threshold(quantity: str) -> float
The threshold every contract that uses quantity orders it against (order unity unless sourced).
OrderingQuantity
class
source
OrderingQuantity(definition: str, scale: str, scope: str, group: str, kernels: Tuple[str, ...]) -> None
What a state column means: its definition, scale, scope, group and the kernels that compute it.
5 fields
definition: strscale: strscope: strgroup: strkernels: Tuple[str, ...]
OrderingSpace
class
source
OrderingSpace(name: str, x: str, y: str, title: str, x_reading: Tuple[str, str], y_reading: Tuple[str, str]) -> None
Two ordering quantities read together, and what each side of each means.
6 fields
name: strx: stry: strtitle: strx_reading: Tuple[str, str]y_reading: Tuple[str, str]
required_ordering
function
source
required_ordering(quantity: str) -> str
"small" or "large": the side every contract that uses quantity requires.
SYMBOLS
data
SYMBOLS = <builtins.dict>
vaft.validation.perturbation_phase
The verdict on a toroidal phase audit (D-06).
GPEC_COIL_FIELD
data
GPEC_COIL_FIELD = <vaft.validation.perturbation_phase.PhaseAuditCriteria>
phase_convention_verdict
function
source
phase_convention_verdict(audit, *, criteria: PhaseAuditCriteria) -> PhaseConventionVerdict
Decide whether a phase audit settled which reconstruction a file belongs to.
PhaseAuditCriteria
class
source
PhaseAuditCriteria(separation_ratio: float, relative_norm: float, name: str = '') -> None
What a toroidal phase audit has to achieve before it settles anything.
3 fields
separation_ratio: floatrelative_norm: floatname: str
PhaseConventionVerdict
class
source
PhaseConventionVerdict(status: ValidationStatus, convention: str | None, reason: str) -> None
What one phase audit settled, if anything.
3 fields
status: ValidationStatusconvention: str | Nonereason: str
vaft.validation.plasma_current
Is the plasma-current Rogowski recording a current at all? (#1373, #1543)
assess_plasma_rogowski
function
source
assess_plasma_rogowski(time: np.ndarray, current: np.ndarray, config: PlasmaCurrentQualityConfig | None = None) -> PlasmaCurrentQuality
Judge a calibrated plasma-current Rogowski record over its full span.
PlasmaCurrentQuality
class
source
PlasmaCurrentQuality(validity: int, reason: str, metrics: dict[str, float] = <factory>) -> None
3 fields · 1 members
validity: intreason: strmetrics: dict[str, float]as_dictmethod source
PlasmaCurrentQualityConfig
class
source
PlasmaCurrentQualityConfig(quiet_windows: tuple[tuple[float, float], ...] = ((0.0, 0.2), (0.45, 1.0)), reference_window: tuple[float, float] = (0.2, 0.24), max_off_discharge_p2p: float = 120000.0, min_quiet_samples: int = 1000) -> None
Where the record must be quiet, and how quiet.
4 fields
quiet_windows: tuple[tuple[float, float], ...]reference_window: tuple[float, float]max_off_discharge_p2p: floatmin_quiet_samples: int
vaft.validation.registry
Stable, machine-readable metadata for named validation checks (#253 §5, #72).
CHECKS
data
CHECKS = <builtins.dict>
checks_in
function
source
checks_in(category: str) -> tuple[CheckSpec, ...]
Every registered check of one category, in report order.
CheckSpec
class
source
CheckSpec(key: str, category: str, unit: str, provider: str, method: str, measure: str = 'rule', tolerance: tuple[float, float] | None = None) -> None
What is stable about one check, independent of any particular result.
7 fields
key: strcategory: strunit: strprovider: strmethod: strmeasure: strtolerance: tuple[float, float] | None
describe
function
source
describe(key: str) -> CheckSpec
The registry entry for key ("<category>.<check>").
MEASURES
data
MEASURES = <builtins.dict>
vaft.validation.sensitivity
Sensitivity, linearization and uncertainty evidence, interpreted (issue #1642).
as_evidence
function
source
as_evidence(result: Mapping[str, Any], *, key: str, axis: str | None = None, cost: str = 'moderate')
A graded comparison as vaft.validation.credibility.Evidence.
compare_jacobians
function
source
compare_jacobians(reference: Jacobian, candidate: Jacobian, *, output_scale: Sequence[float] | None = None, tolerance: tuple[float, float] | None = None, allow_mixed: bool = False) -> dict[str, Any]
One derivative validated against another of different provenance.
compare_linear_to_monte_carlo
function
source
compare_linear_to_monte_carlo(linear_covariance: np.ndarray, sampled: Mapping[str, Any], *, outputs: Sequence[str] | None = None, tolerance: tuple[float, float] | None = None) -> dict[str, Any]
The linear J Sigma J^T against a sampled covariance (#1642 s16).
Jacobian
class
source
Jacobian(provenance: str, kind: str, perturbation: str, inputs: tuple[str, ...], outputs: tuple[str, ...], matrix: np.ndarray | None = None, jvp: Callable[[np.ndarray], np.ndarray] | None = None, source: str = '') -> None
A derivative with its provenance: an explicit matrix or a matrix-free product.
8 fields · 3 members
provenance: strkind: strperturbation: strinputs: tuple[str, ...]outputs: tuple[str, ...]matrix: np.ndarray | Nonejvp: Callable[[np.ndarray], np.ndarray] | Nonesource: strshapeproperty sourceapplymethod —J vwhichever representation this holds. sourcedensemethod — The explicit matrix, assembled column by column fromjvpif need be. source
JACOBIAN_KINDS
data
JACOBIAN_KINDS = ('forward', 'observation', 'governing_operator')
MIN_SCAN_MEMBERS
data
MIN_SCAN_MEMBERS = 3
PERTURBATIONS
data
PERTURBATIONS = ('physical', 'numerical')
PROVENANCES
data
PROVENANCES = ('native', 'finite_difference', 'autodiff', 'analytic')
scan_evidence
function
source
scan_evidence(report: Mapping[str, Any], *, key: str = 'efit_sensitivity.model_form') -> Any
A targeted-scan ensemble report as model-form evidence on the inference axis.
vaft.validation.stability
Verification of linear MHD stability results: DCON, RDCON and STRIDE (issue #142).
Q_AT_PSIEDGE_ATOL
data
Q_AT_PSIEDGE_ATOL = 0.0001
SELF_CONSISTENCY_RTOL
data
SELF_CONSISTENCY_RTOL = 0.2
STABILITY_CHECKS
data
STABILITY_CHECKS = <builtins.dict>
SURFACE_IDENTITY_ATOL
data
SURFACE_IDENTITY_ATOL = 1e-06
SURFACE_MATCH_PSI_ATOL
data
SURFACE_MATCH_PSI_ATOL = 0.001
validate_stability
function
source
validate_stability(*, dcon: Any = None, dcon_check: Any = None, matching: Any = None, matching_check: Any = None) -> dict[str, Any]
Verify one stability case; returns a JSON-serializable report.
vaft.validation.stage_evidence
Per-stage validation evidence for the FileDB pipeline (issues #139, #338).
STAGE_METRICS
data
STAGE_METRICS = <builtins.dict>
Also exported as vaft.database.production_qa.STAGE_METRICS.
STAGE_PRECONDITIONS
data
STAGE_PRECONDITIONS = <builtins.dict>
Also exported as vaft.database.production_qa.STAGE_PRECONDITIONS.
vaft.validation.vacuum_benchmark
Plasma-free magnetic-response benchmark for the VEST wall model (issue #190).
aggregate_benchmark
function
source
aggregate_benchmark(cases: Iterable[Mapping[str, Any]]) -> dict[str, Any]
Residual structure across cases, channels, excitations and machine eras.
ARRAY_CONTRADICTION_FLOOR
data
ARRAY_CONTRADICTION_FLOOR = 0.01
ARRAY_CONTRADICTION_FRACTION
data
ARRAY_CONTRADICTION_FRACTION = 0.05
array_contradiction_fractions
function
source
array_contradiction_fractions(channels: Iterable[Any], window: tuple[float, float], *, sigma: float = 20.0, min_members: int = 7, exclude: Iterable[str] = ()) -> dict[str, float]
Fraction of its scorable samples each probe contradicts its array for.
ARRAY_CONTRADICTION_MIN_SCORED
data
ARRAY_CONTRADICTION_MIN_SCORED = 0.5
ARRAY_CONTRADICTION_SIGMA
data
ARRAY_CONTRADICTION_SIGMA = 20.0
array_contradictions
function
source
array_contradictions(channels: Iterable[Any], window: tuple[float, float], *, sigma: float = 20.0, fraction: float = 0.05, min_members: int = 7) -> list[dict[str, Any]]
Probes that contradict their own array over the plasma-free window.
BENCHMARK_CASE_SCHEMA
data
BENCHMARK_CASE_SCHEMA = 5
benchmark_wall_currents
function
source
benchmark_wall_currents(ods: Any, *, resistance_scale: float = 1.0, calibration: 'WallResistanceCalibration | None' = None, dt_sub: float = 5e-05) -> Any
Re-solve the passive-wall currents driven by measured PF currents alone.
BenchmarkError
class
source
Raised when a shot cannot supply a usable plasma-free benchmark case.
coil_drive_check
function
source
coil_drive_check(ods: Any, window: tuple[float, float]) -> dict[str, Any]
Whether the coils drove the vessel inside window at all.
DEFAULT_HISTORY_TIME_CONSTANTS
data
DEFAULT_HISTORY_TIME_CONSTANTS = 3.0
MIN_ARRAY_MEMBERS
data
MIN_ARRAY_MEMBERS = 7
MIN_COIL_DRIVE_FRACTION
data
MIN_COIL_DRIVE_FRACTION = 0.1
MIN_WITNESSES
data
MIN_WITNESSES = 3
PLASMA_FREE_EVIDENCE_SCHEMA
data
PLASMA_FREE_EVIDENCE_SCHEMA = 4
plasma_free_interval
function
source
plasma_free_interval(ods: Any, *, reference_fraction: float = 0.2) -> PlasmaFreeInterval
The interval of a shot over which no plasma contributes, with evidence.
PlasmaFreeInterval
class
source
The plasma-free stretch of one shot, with the evidence for it.
run_benchmark_case
function
source
run_benchmark_case(ods: Any, *, shot: int | None = None, machine_era: str | None = None, window: tuple[float, float] | None = None, per_family: int | None = None, resistance_scale: float = 1.0, calibration: 'WallResistanceCalibration | None' = None, dt_sub: float = 5e-05, n_tau: float = 3.0, min_samples: int = 2) -> dict[str, Any]
Evaluate one plasma-free case: PF-only wall solve, then measured vs model.
solver_history_check
function
source
solver_history_check(ods: Any, validation_start: float, *, n_tau: float = 3.0, time_constants: np.ndarray | None = None) -> dict[str, Any]
Whether the solver has forgotten its assumed initial state by validation_start.
wall_time_constants
function
source
wall_time_constants(ods: Any) -> np.ndarray
The passive structure’s L/R decay times, slowest first.
vaft.validation.validity
What a datum’s validity nodes mean, stated once (issue #424).
aggregate_validity
function
source
aggregate_validity(timed: Iterable[int]) -> int
The scalar validity summarizing a time-resolved one: worst state wins.
Also exported as vaft.validation.imas.aggregate_validity.
codes_at
function
source
codes_at(record: ValidityRecord, *, times: Any | None = None) -> np.ndarray | None
The record’s validity code per sample.
is_condemned
function
source
is_condemned(record: ValidityRecord, *, min_validity: int = 0) -> bool
Assessed, and no usable sample anywhere.
is_usable
function
source
is_usable(record: ValidityRecord, *, times: Any | None = None, min_validity: int = 0, default: bool = True) -> bool
Whether any sample at all – or any of times – reaches the floor.
record_from_mask
function
source
record_from_mask(scalar: int | None, mask: Any | None) -> ValidityRecord
A record for a consumer that holds a boolean usable-sample mask.
usable_fraction
function
source
usable_fraction(record: ValidityRecord, *, times: Any | None = None, window: Any | None = None, min_validity: int = 0, default: bool = True) -> float
Fraction of the samples in window the record declares usable.
usable_mask
function
source
usable_mask(record: ValidityRecord, *, times: Any | None = None, min_validity: int = 0, default: bool = True) -> np.ndarray
Which samples a consumer accepting min_validity may use.
VALIDITY_CERTIFIED
data
VALIDITY_CERTIFIED = 1
Also exported as vaft.validation.imas.VALIDITY_CERTIFIED.
VALIDITY_INVALID
data
VALIDITY_INVALID = -2
Also exported as vaft.validation.imas.VALIDITY_INVALID.
VALIDITY_MEANINGS
data
VALIDITY_MEANINGS = <builtins.dict>
Also exported as vaft.validation.imas.VALIDITY_MEANINGS.
VALIDITY_SUSPECT
data
VALIDITY_SUSPECT = -1
Also exported as vaft.validation.imas.VALIDITY_SUSPECT.
VALIDITY_VALID
data
VALIDITY_VALID = 0
Also exported as vaft.validation.imas.VALIDITY_VALID.
ValidityRecord
class
source
ValidityRecord(scalar: int | None, timed: np.ndarray | None, time: np.ndarray | None) -> None
What a datum’s validity nodes say – extracted, not yet interpreted.
3 fields · 1 members
scalar: int | Nonetimed: np.ndarray | Nonetime: np.ndarray | Noneassessedproperty — Whether anything has said what this datum’s validity is. source
vaft.validation.wall_reduction
Reduced-wall order study: full versus reduced wall, and both versus the measured magnetics (vaft #494, VEST-Tokamak/vfit#10).
DEFAULT_ORDERS
data
DEFAULT_ORDERS = (1, 2, 4, 8, 16, 19, 32, 64, 128, 256)
DEFAULT_RULES
data
DEFAULT_RULES = ('tau', 'drive_gain', 'output_weight', 'uniform', 'moments')
drive_set
function
source
drive_set(system: Mapping[str, Any], kinds: Sequence[str] = ('shot', 'single_coil', 'step')) -> dict[str, np.ndarray]
Source waveforms the reduced wall is tested under, (n_times, n_coils) each.
experimental_comparison
function
source
experimental_comparison(ods: Any, selections: Mapping[str, Any], *, window: tuple[float, float] | None = None, per_family: int | None = None, min_wall_authority: float | None = None, dt_sub: float = 5e-05, **system_options: Any) -> dict[str, Any]
The #190 benchmark for the full wall and for reduced walls, side by side.
find_plasma_free_shots
function
source
find_plasma_free_shots(shots: Iterable[int], *, max_plasma_current: float = 5000.0, min_coil_current: float = 1000.0, raw_source: Any = None, loaders: Mapping[str, Any] | None = None) -> list[dict[str, Any]]
Classify shots by whether they can serve as PF-only benchmark cases.
observation_set
function
source
observation_set(ods: Any, *, n_coils: int | None = None, per_family: int | None = None, window: tuple[float, float] | None = None, ring_shrink: float = 0.85, ring_points: int = 64, grid_shape: tuple[int, int] = (25, 33)) -> dict[str, Any]
Wall-column response matrices at every observation the study scores.
order_convergence
function
source
order_convergence(ods_or_system: Any, *, rules: Sequence[str] = ('tau', 'drive_gain', 'output_weight', 'uniform', 'moments'), orders: Sequence[int] = (1, 2, 4, 8, 16, 19, 32, 64, 128, 256), drives: Sequence[str] = ('shot', 'single_coil', 'step'), observation: Mapping[str, Any] | None = None, scores_drive: str = 'shot', dt_sub: float = 5e-05, **system_options: Any) -> list[dict[str, Any]]
Full-versus-reduced response error for every (rule, order, drive).
representation_order
function
source
representation_order(rows: Iterable[Mapping[str, Any]], tolerances: Mapping[str, float], *, drive: str = 'shot') -> dict[str, Any]
The smallest retained order meeting tolerances – per rule, per metric and jointly.
wall_system
function
source
wall_system(ods: Any, *, remap_em_coupling: bool = False, gap_factor: float | None = None, **basis_options: Any) -> dict[str, Any]
The wall matrices, the eigenbasis and the shot’s PF drive, once.
WallReductionError
class
source
The ODS or the requested study cannot be evaluated as asked.