-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvalidation_models.py
More file actions
146 lines (121 loc) · 3.21 KB
/
Copy pathvalidation_models.py
File metadata and controls
146 lines (121 loc) · 3.21 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
from __future__ import annotations
from dataclasses import dataclass
from pathlib import Path
from typing import Any
@dataclass(frozen=True)
class ExpectedRangeRecord:
kind: str
minimum: float | None
maximum: float | None
@dataclass(frozen=True)
class MetricSpecRecord:
platform: str
mode: str
group_key: str
metric_key: str
label: str
unit: str
aggregation_scope: str
normalization_basis: str
validation_level: str
comparison_class: str
default_tolerance_abs: float | None
default_tolerance_rel: float | None
expected_range: ExpectedRangeRecord
clinical_readiness: str
known_noncomparability: tuple[str, ...]
comparable_to: tuple[str, ...]
assumptions: tuple[str, ...]
exclusions: tuple[str, ...]
@dataclass(frozen=True)
class MetricGroupRecord:
group_key: str
platform: str
label: str
description: str
metric_keys: tuple[str, ...]
@dataclass(frozen=True)
class ValidationProfileRecord:
profile_key: str
description: str
exact_abs_default: float
exact_rel_default: float
require_reference_exact_green: bool
include_association_only_in_core_gate: bool
group_keys: tuple[str, ...]
@dataclass(frozen=True)
class ComparatorSampleRecord:
case_id: str
comparator_value: float | int | str | None
notes: str
@dataclass(frozen=True)
class ComparatorMappingRecord:
platform: str
internal_metric: str
comparator: str
comparator_metric: str
relationship: str
samples: tuple[ComparatorSampleRecord, ...]
notes: str
@dataclass(frozen=True)
class ToleranceOverrideRecord:
absolute: float | None
relative: float | None
skip: bool
reason: str
@dataclass(frozen=True)
class ReferenceCaseProvenanceRecord:
source_kind: str
version: str
notes: str
@dataclass(frozen=True)
class ExpectedMetricsProvenanceRecord:
schema_version: int
formula_version: str
case_id: str
domain: str
mode: str
source_checksum: str
expected_metrics_checksum: str
generated_at: str
@dataclass(frozen=True)
class ReferenceCaseRecord:
case_id: str
source_path: str
domain: str
device_or_tps: str
expected_mode: str
case_class: str
expected_metrics_source: str
expected_metrics_path: Path
expected_metrics: dict[str, float | int | str | None]
tolerance_overrides: dict[str, ToleranceOverrideRecord]
checksum: str
provenance: ReferenceCaseProvenanceRecord
notes: str
expected_formula_version: str | None = None
expected_metrics_provenance: ExpectedMetricsProvenanceRecord | None = None
expected_supported: bool = True
@dataclass(frozen=True)
class ValidationCaseResult:
source_path: str
domain: str
mode: str
supported: bool
reason: str
metadata: dict[str, Any]
metrics: dict[str, float | int | str | None]
warnings: tuple[str, ...]
__all__ = [
"ComparatorMappingRecord",
"ComparatorSampleRecord",
"ExpectedRangeRecord",
"ExpectedMetricsProvenanceRecord",
"MetricGroupRecord",
"MetricSpecRecord",
"ReferenceCaseProvenanceRecord",
"ReferenceCaseRecord",
"ToleranceOverrideRecord",
"ValidationCaseResult",
"ValidationProfileRecord",
]