@sdeverywhere/check-core 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1509 -1467
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4849 -5642
- package/dist/index.js.map +1 -1
- package/package.json +3 -5
- package/dist/index.cjs +0 -5898
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -2199
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
type
|
|
3
|
-
type
|
|
4
|
-
type
|
|
5
|
-
type
|
|
6
|
-
|
|
1
|
+
//#region src/_shared/types.d.ts
|
|
2
|
+
export type SourceName = string;
|
|
3
|
+
export type VarId = string;
|
|
4
|
+
export type DatasetKey = string;
|
|
5
|
+
export type Dataset = Map<number, number>;
|
|
6
|
+
export type DatasetMap = Map<DatasetKey, Dataset>;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/_shared/scenario-spec-types.d.ts
|
|
7
9
|
/**
|
|
8
10
|
* Specifies a constant override that will be applied when running the model.
|
|
9
11
|
*
|
|
@@ -11,11 +13,11 @@ type DatasetMap = Map<DatasetKey, Dataset>;
|
|
|
11
13
|
* defined min/max ranges), constant overrides can modify ANY constant in the model
|
|
12
14
|
* when the `customConstants` feature is enabled.
|
|
13
15
|
*/
|
|
14
|
-
interface ConstantOverride {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
export interface ConstantOverride {
|
|
17
|
+
/** The variable ID of the constant to be overridden. */
|
|
18
|
+
varId: VarId;
|
|
19
|
+
/** The new value for the constant. */
|
|
20
|
+
value: number;
|
|
19
21
|
}
|
|
20
22
|
/**
|
|
21
23
|
* Specifies a lookup override that will be applied when running the model.
|
|
@@ -28,101 +30,103 @@ interface ConstantOverride {
|
|
|
28
30
|
* Lookup overrides are only effective when the `customLookups` feature is
|
|
29
31
|
* enabled in the bundle.
|
|
30
32
|
*/
|
|
31
|
-
interface LookupOverride {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
export interface LookupOverride {
|
|
34
|
+
/** The variable ID of the lookup or data variable to be overridden. */
|
|
35
|
+
varId: VarId;
|
|
36
|
+
/**
|
|
37
|
+
* The lookup data as a flat array of (x,y) pairs. If undefined, the lookup
|
|
38
|
+
* data will be reset to the original data.
|
|
39
|
+
*/
|
|
40
|
+
points?: Float64Array;
|
|
39
41
|
}
|
|
40
42
|
/** A unique identifier for the scenario, derived from its input settings. */
|
|
41
|
-
type ScenarioSpecUid = string;
|
|
42
|
-
type InputPosition = 'at-default' | 'at-minimum' | 'at-maximum';
|
|
43
|
-
interface PositionSetting {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
interface ValueSetting {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
type InputSetting = PositionSetting | ValueSetting;
|
|
54
|
-
interface InputSettingsSpec {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
interface AllInputsSpec {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
type ScenarioSpec = InputSettingsSpec | AllInputsSpec;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
43
|
+
export type ScenarioSpecUid = string;
|
|
44
|
+
export type InputPosition = 'at-default' | 'at-minimum' | 'at-maximum';
|
|
45
|
+
export interface PositionSetting {
|
|
46
|
+
kind: 'position';
|
|
47
|
+
inputVarId: VarId;
|
|
48
|
+
position: InputPosition;
|
|
49
|
+
}
|
|
50
|
+
export interface ValueSetting {
|
|
51
|
+
kind: 'value';
|
|
52
|
+
inputVarId: VarId;
|
|
53
|
+
value: number;
|
|
54
|
+
}
|
|
55
|
+
export type InputSetting = PositionSetting | ValueSetting;
|
|
56
|
+
export interface InputSettingsSpec {
|
|
57
|
+
kind: 'input-settings';
|
|
58
|
+
uid: ScenarioSpecUid;
|
|
59
|
+
settings: InputSetting[];
|
|
60
|
+
}
|
|
61
|
+
export interface AllInputsSpec {
|
|
62
|
+
kind: 'all-inputs';
|
|
63
|
+
uid: ScenarioSpecUid;
|
|
64
|
+
position: InputPosition;
|
|
65
|
+
}
|
|
66
|
+
export type ScenarioSpec = InputSettingsSpec | AllInputsSpec;
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/_shared/data-source.d.ts
|
|
69
|
+
export interface DatasetsResult {
|
|
70
|
+
/**
|
|
71
|
+
* The map of datasets for the scenario.
|
|
72
|
+
*/
|
|
73
|
+
datasetMap: DatasetMap;
|
|
74
|
+
/**
|
|
75
|
+
* The number of milliseconds that elapsed when running the model, or undefined if the model
|
|
76
|
+
* wasn't run for this scenario.
|
|
77
|
+
*/
|
|
78
|
+
modelRunTime?: number;
|
|
76
79
|
}
|
|
77
80
|
/**
|
|
78
81
|
* Options for the `getDatasetsForScenario` method.
|
|
79
82
|
*/
|
|
80
|
-
interface GetDatasetsOptions {
|
|
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
|
-
interface DataSource {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
83
|
+
export interface GetDatasetsOptions {
|
|
84
|
+
/**
|
|
85
|
+
* If defined, override the values for the specified constant variables.
|
|
86
|
+
*
|
|
87
|
+
* Unlike input settings (which work with pre-declared input variables), constant
|
|
88
|
+
* overrides can modify ANY constant in the model when the `customConstants` feature
|
|
89
|
+
* is enabled.
|
|
90
|
+
*
|
|
91
|
+
* Note that constant overrides do NOT persist across `getDatasetsForScenario` calls.
|
|
92
|
+
* They must be provided each time you want to override constants.
|
|
93
|
+
*/
|
|
94
|
+
constants?: ConstantOverride[];
|
|
95
|
+
/**
|
|
96
|
+
* If defined, override the data for the specified lookup or data variables.
|
|
97
|
+
*
|
|
98
|
+
* The data provided here will override the default data in the generated model
|
|
99
|
+
* for each variable identified by `varId`. Lookup overrides are only effective
|
|
100
|
+
* when the `customLookups` feature is enabled in the bundle.
|
|
101
|
+
*
|
|
102
|
+
* Note that lookup overrides MAY OR MAY NOT persist across `getDatasetsForScenario`
|
|
103
|
+
* calls, depending on the underlying model/runtime implementation. If you want to
|
|
104
|
+
* ensure that previously-applied lookup overrides do not take effect on subsequent
|
|
105
|
+
* runs, pass an undefined `points` array for the relevant variable to cause the
|
|
106
|
+
* lookup data to be reset to its original data.
|
|
107
|
+
*/
|
|
108
|
+
lookups?: LookupOverride[];
|
|
109
|
+
}
|
|
110
|
+
export interface DataSource {
|
|
111
|
+
/**
|
|
112
|
+
* Return the datasets that result from running the given scenario.
|
|
113
|
+
*
|
|
114
|
+
* @param scenarioSpec The scenario spec that defines the inputs for the model run.
|
|
115
|
+
* @param datasetKeys The keys of the datasets to be fetched.
|
|
116
|
+
* @param options Optional configuration including constant and lookup overrides.
|
|
117
|
+
*/
|
|
118
|
+
getDatasetsForScenario(scenarioSpec: ScenarioSpec, datasetKeys: DatasetKey[], options?: GetDatasetsOptions): Promise<DatasetsResult>;
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/bundle/var-types.d.ts
|
|
118
122
|
/**
|
|
119
123
|
* Holds information about an item related to a variable used in the model.
|
|
120
124
|
* For example, this can be used to attach information about a graph that
|
|
121
125
|
* an output variable is used in, or a slider that controls an input variable.
|
|
122
126
|
*/
|
|
123
127
|
interface RelatedItem {
|
|
124
|
-
|
|
125
|
-
|
|
128
|
+
id: string;
|
|
129
|
+
locationPath: string[];
|
|
126
130
|
}
|
|
127
131
|
/** A unique, stable input identifier. */
|
|
128
132
|
type InputId = string;
|
|
@@ -130,58 +134,58 @@ type InputId = string;
|
|
|
130
134
|
* Holds information about an input variable that is controlled by a continuous range/slider.
|
|
131
135
|
*/
|
|
132
136
|
interface SliderInputVar {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
137
|
+
/** Indicates that this input is controlled by a continuous range/slider. */
|
|
138
|
+
kind: 'slider';
|
|
139
|
+
/**
|
|
140
|
+
* A unique, stable identifier string for this input.
|
|
141
|
+
*
|
|
142
|
+
* This can be used to identify an input variable in a way that is resilient
|
|
143
|
+
* to the variable's name being changed between two versions of the model.
|
|
144
|
+
*
|
|
145
|
+
* For example, if both the "left" and "right" versions of the model have an
|
|
146
|
+
* input with an `inputId` of 2, but the variable is called "Variable 2" in
|
|
147
|
+
* the left and "Variable Two" in the right, the inputs can be correlated and
|
|
148
|
+
* compared despite the different variable names.
|
|
149
|
+
*/
|
|
150
|
+
inputId: InputId;
|
|
151
|
+
/** The variable identifier (typically a simplified/canonical ID, like the form used in SDE). */
|
|
152
|
+
varId: VarId;
|
|
153
|
+
/** The full variable name as used in the modeling tool. */
|
|
154
|
+
varName: string;
|
|
155
|
+
/** The default value of the input. */
|
|
156
|
+
defaultValue: number;
|
|
157
|
+
/** The minimum value of the input. */
|
|
158
|
+
minValue: number;
|
|
159
|
+
/** The maximum value of the input. */
|
|
160
|
+
maxValue: number;
|
|
161
|
+
/** The metadata for the related input control. */
|
|
162
|
+
relatedItem?: RelatedItem;
|
|
159
163
|
}
|
|
160
164
|
/**
|
|
161
165
|
* Holds information about an input variable that is controlled by a discrete on/off switch.
|
|
162
166
|
*/
|
|
163
167
|
interface SwitchInputVar {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
168
|
+
/** Indicates that this input is controlled by a discrete on/off switch. */
|
|
169
|
+
kind: 'switch';
|
|
170
|
+
/**
|
|
171
|
+
* A unique, stable identifier string for this input.
|
|
172
|
+
*
|
|
173
|
+
* This can be used to identify an input variable in a way that is resilient
|
|
174
|
+
* to the variable's name being changed between two versions of the model.
|
|
175
|
+
*/
|
|
176
|
+
inputId: InputId;
|
|
177
|
+
/** The variable identifier (typically a simplified/canonical ID, like the form used in SDE). */
|
|
178
|
+
varId: VarId;
|
|
179
|
+
/** The full variable name as used in the modeling tool. */
|
|
180
|
+
varName: string;
|
|
181
|
+
/** The default value of the input. */
|
|
182
|
+
defaultValue: number;
|
|
183
|
+
/** The value of the variable when this switch is in an "off" state. */
|
|
184
|
+
offValue: number;
|
|
185
|
+
/** The value of the variable when this switch is in an "on" state. */
|
|
186
|
+
onValue: number;
|
|
187
|
+
/** The metadata for the related input control. */
|
|
188
|
+
relatedItem?: RelatedItem;
|
|
185
189
|
}
|
|
186
190
|
/**
|
|
187
191
|
* Holds information about an input variable used in the model. This is a discriminated
|
|
@@ -192,36 +196,37 @@ type InputVar = SliderInputVar | SwitchInputVar;
|
|
|
192
196
|
* Holds information about an output variable used in the model.
|
|
193
197
|
*/
|
|
194
198
|
interface OutputVar {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
199
|
+
/** The unique dataset key for this variable (it should include `sourceName` and `varId`). */
|
|
200
|
+
datasetKey: DatasetKey;
|
|
201
|
+
/**
|
|
202
|
+
* The source for the variable (e.g., undefined for a normal model output, "Data" for a variable
|
|
203
|
+
* that is defined in an external data file).
|
|
204
|
+
*/
|
|
205
|
+
sourceName?: SourceName;
|
|
206
|
+
/** The variable identifier (typically a simplified/canonical ID, like the form used in SDE). */
|
|
207
|
+
varId: VarId;
|
|
208
|
+
/** The full variable name as used in the modeling tool. */
|
|
209
|
+
varName: string;
|
|
210
|
+
/** The metadata for the related visuals/graphs in which this variable is used. */
|
|
211
|
+
relatedItems?: RelatedItem[];
|
|
208
212
|
}
|
|
209
213
|
/**
|
|
210
214
|
* Holds information about a variable used in the model implementation.
|
|
211
215
|
*/
|
|
212
216
|
interface ImplVar {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
|
|
217
|
+
/** The variable identifier, as used in SDE. */
|
|
218
|
+
varId: VarId;
|
|
219
|
+
/** The variable name, as used in the modeling tool. */
|
|
220
|
+
varName: string;
|
|
221
|
+
/** The variable type (e.g. 'level', 'const'). */
|
|
222
|
+
varType: string;
|
|
223
|
+
/** The variable index, used to reference the value in the generated model. */
|
|
224
|
+
varIndex: number;
|
|
225
|
+
/** The subscript index values, used to reference the value in the generated model. */
|
|
226
|
+
subscriptIndices?: number[];
|
|
227
|
+
}
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region src/bundle/bundle-types.d.ts
|
|
225
230
|
/** The human-readable name for a group of inputs. */
|
|
226
231
|
type InputGroupName = string;
|
|
227
232
|
/** The alias name for an input. */
|
|
@@ -234,40 +239,40 @@ type DatasetGroupName = string;
|
|
|
234
239
|
* Describes a group of implementation variables.
|
|
235
240
|
*/
|
|
236
241
|
interface ImplVarGroup {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
242
|
+
/** The group title. */
|
|
243
|
+
title: string;
|
|
244
|
+
/**
|
|
245
|
+
* The function name in the generated model that is associated with
|
|
246
|
+
* this group. This can be used when displaying the group to change
|
|
247
|
+
* the appearance of the items in the section.
|
|
248
|
+
*/
|
|
249
|
+
fn?: string;
|
|
250
|
+
/**
|
|
251
|
+
* The keys of the variables in this group (corresponding to the
|
|
252
|
+
* `implVars` map keys). It is recommended to provide these in the
|
|
253
|
+
* order that the variables are evaluated in the generated model.
|
|
254
|
+
*/
|
|
255
|
+
datasetKeys: DatasetKey[];
|
|
251
256
|
}
|
|
252
257
|
/**
|
|
253
258
|
* Includes the properties needed to display a legend item in the UI.
|
|
254
259
|
*/
|
|
255
260
|
interface LegendItem {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
261
|
+
/** The item text. */
|
|
262
|
+
label: string;
|
|
263
|
+
/** The color of the item (in CSS/hex format). */
|
|
264
|
+
color: string;
|
|
260
265
|
}
|
|
261
266
|
/**
|
|
262
267
|
* Includes the properties needed to display a link item in the UI.
|
|
263
268
|
*/
|
|
264
269
|
interface LinkItem {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
270
|
+
/** Whether content is a URL or text to be copied to the clipboard. */
|
|
271
|
+
kind: 'url' | 'copy';
|
|
272
|
+
/** The link text that appears in the UI. */
|
|
273
|
+
text: string;
|
|
274
|
+
/** The link content (a URL or text). */
|
|
275
|
+
content: string;
|
|
271
276
|
}
|
|
272
277
|
/** The identifier for a bundle-specific graph. */
|
|
273
278
|
type BundleGraphId = string;
|
|
@@ -275,216 +280,217 @@ type BundleGraphId = string;
|
|
|
275
280
|
* Describes a dataset in a bundle-specific graph.
|
|
276
281
|
*/
|
|
277
282
|
interface BundleGraphDatasetSpec {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
283
|
+
/** The dataset key. */
|
|
284
|
+
datasetKey: DatasetKey;
|
|
285
|
+
/** The dataset or variable name. */
|
|
286
|
+
varName: string;
|
|
287
|
+
/** The source name. */
|
|
288
|
+
sourceName?: string;
|
|
289
|
+
/** The label string (as it appears in the graph legend). */
|
|
290
|
+
label?: string;
|
|
291
|
+
/** The color of the plot (in CSS/hex format). */
|
|
292
|
+
color: string;
|
|
288
293
|
}
|
|
289
294
|
/**
|
|
290
295
|
* Describes a bundle-specific graph.
|
|
291
296
|
*/
|
|
292
297
|
interface BundleGraphSpec {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
298
|
+
/** The graph identifier. */
|
|
299
|
+
id: BundleGraphId;
|
|
300
|
+
/** The graph title. */
|
|
301
|
+
title: string;
|
|
302
|
+
/** The legend items for the graph. */
|
|
303
|
+
legendItems: LegendItem[];
|
|
304
|
+
/** The datasets displayed in this graph. */
|
|
305
|
+
datasets: BundleGraphDatasetSpec[];
|
|
306
|
+
/** Metadata for the graph that can be used to diff to another graph. */
|
|
307
|
+
metadata: Map<string, string>;
|
|
303
308
|
}
|
|
304
309
|
/**
|
|
305
310
|
* Options for configuring a bundle-specific graph view.
|
|
306
311
|
*/
|
|
307
312
|
interface BundleGraphViewOptions {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
313
|
+
/** Whether graph updates will be animated (default is false). */
|
|
314
|
+
animated?: boolean;
|
|
315
|
+
/** A hint that indicates the context in which the graph will be displayed. */
|
|
316
|
+
style?: 'thumbnail' | undefined;
|
|
312
317
|
}
|
|
313
318
|
/**
|
|
314
319
|
* Allows for displaying a bundle-specific graph.
|
|
315
320
|
*/
|
|
316
321
|
interface BundleGraphView {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
322
|
+
/**
|
|
323
|
+
* Update the data that is displayed in the graph.
|
|
324
|
+
*
|
|
325
|
+
* @hidden This method is optional; it is not currently used by the report UI, but may be useful
|
|
326
|
+
* for other tools that want to display bundle-specific graphs.
|
|
327
|
+
*
|
|
328
|
+
* @param datasetMap The map of datasets that contain the data to be displayed in the graph.
|
|
329
|
+
*/
|
|
330
|
+
updateData?(datasetMap: DatasetMap): void;
|
|
331
|
+
/** Destroy the underlying graph view and any associated resources. */
|
|
332
|
+
destroy(): void;
|
|
328
333
|
}
|
|
329
334
|
/**
|
|
330
335
|
* Wrapper around data that can be used to initialize a graph view.
|
|
331
336
|
*/
|
|
332
337
|
interface BundleGraphData {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
338
|
+
/**
|
|
339
|
+
* Return a graph view that can be attached to the given parent element. The returned
|
|
340
|
+
* `BundleGraphView` instance will already be configured to display the data that was
|
|
341
|
+
* fetched from the model for the associated scenario.
|
|
342
|
+
*
|
|
343
|
+
* @param parent The parent element to which the graph view will be attached.
|
|
344
|
+
* @returns A `BundleGraphView` instance.
|
|
345
|
+
*/
|
|
346
|
+
createGraphView(parent: HTMLElement): BundleGraphView;
|
|
342
347
|
}
|
|
343
348
|
/**
|
|
344
349
|
* Describes the model that is contained in this bundle.
|
|
345
350
|
*/
|
|
346
351
|
interface ModelSpec {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
352
|
+
/** The size of the model binary, in bytes. */
|
|
353
|
+
modelSizeInBytes: number;
|
|
354
|
+
/** The size of the static data, in bytes. */
|
|
355
|
+
dataSizeInBytes: number;
|
|
356
|
+
/** The map of all input variables in this version of the model. */
|
|
357
|
+
inputVars: Map<VarId, InputVar>;
|
|
358
|
+
/** The map of all output (and static data) variables in this version of the model. */
|
|
359
|
+
outputVars: Map<DatasetKey, OutputVar>;
|
|
360
|
+
/** The map of all variables (both internal and exported) in this version of the model. */
|
|
361
|
+
implVars: Map<DatasetKey, ImplVar>;
|
|
362
|
+
/** The groupings of internal/implementation variables in this version of the model. */
|
|
363
|
+
implVarGroups?: ImplVarGroup[];
|
|
364
|
+
/** The custom input variable aliases defined for this model. */
|
|
365
|
+
inputAliases?: Map<InputAliasName, VarId>;
|
|
366
|
+
/** The custom input variable groups defined for this model. */
|
|
367
|
+
inputGroups?: Map<InputGroupName, InputVar[]>;
|
|
368
|
+
/** The custom input setting groups defined for this model. */
|
|
369
|
+
inputSettingGroups?: Map<InputSettingGroupId, InputSetting[]>;
|
|
370
|
+
/** The custom dataset (output variable) groups defined for this model. */
|
|
371
|
+
datasetGroups?: Map<DatasetGroupName, DatasetKey[]>;
|
|
372
|
+
/** The start time (year) for the model. */
|
|
373
|
+
startTime?: number;
|
|
374
|
+
/** The end time (year) for the model. */
|
|
375
|
+
endTime?: number;
|
|
376
|
+
/** The specs for the bundled graphs. */
|
|
377
|
+
graphSpecs?: BundleGraphSpec[];
|
|
373
378
|
}
|
|
374
379
|
/**
|
|
375
380
|
* An interface that allows for running the bundled model under different input scenarios
|
|
376
381
|
* and capturing the resulting output data.
|
|
377
382
|
*/
|
|
378
383
|
interface BundleModel extends DataSource {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
384
|
+
/** The spec for the bundled model. */
|
|
385
|
+
modelSpec: ModelSpec;
|
|
386
|
+
/**
|
|
387
|
+
* Load the data used to display the graph by running the model with inputs
|
|
388
|
+
* configured for the given scenario.
|
|
389
|
+
*
|
|
390
|
+
* The returned `BundleGraphData` instance will contain the data associated with the
|
|
391
|
+
* given graph. Calling the `createGraphView` method on the `BundleGraphData` instance
|
|
392
|
+
* will create a `BundleGraphView` that is already configured to display the data
|
|
393
|
+
* associated with the graph.
|
|
394
|
+
*
|
|
395
|
+
* This method is optional; if not implemented, custom graphs will not be displayed in
|
|
396
|
+
* the report UI.
|
|
397
|
+
*
|
|
398
|
+
* @param scenarioSpec The scenario spec that defines the inputs for the model run.
|
|
399
|
+
* @param graphId The identifier of the graph for which data will be loaded.
|
|
400
|
+
* @returns The graph data.
|
|
401
|
+
*/
|
|
402
|
+
getGraphDataForScenario?(scenarioSpec: ScenarioSpec, graphId: BundleGraphId): Promise<BundleGraphData>;
|
|
403
|
+
/**
|
|
404
|
+
* Return the links to be displayed for the graph in the given scenario.
|
|
405
|
+
*
|
|
406
|
+
* This method is optional; if not implemented, no graph links will be displayed in the report UI.
|
|
407
|
+
*
|
|
408
|
+
* @param scenarioSpec The scenario spec that defines the inputs for the model run.
|
|
409
|
+
* @param graphId The identifier of the graph for which links will be prepared.
|
|
410
|
+
* @returns An array of `LinkItem` instances.
|
|
411
|
+
*/
|
|
412
|
+
getGraphLinksForScenario?(scenarioSpec: ScenarioSpec, graphId: BundleGraphId): LinkItem[];
|
|
413
|
+
/**
|
|
414
|
+
* Return a graph view that is attached to the given element and that is prepared to display data
|
|
415
|
+
* for the given graph.
|
|
416
|
+
*
|
|
417
|
+
* Unlike `getGraphDataForScenario`, this method only creates the graph view. The data for the
|
|
418
|
+
* graph must be provided separately by calling the `updateData` method on the `BundleGraphView`
|
|
419
|
+
* instance.
|
|
420
|
+
*
|
|
421
|
+
* @hidden This method is optional; it is not currently used by the report UI, but may be useful
|
|
422
|
+
* for other tools that want to display bundle-specific graphs.
|
|
423
|
+
*
|
|
424
|
+
* @param parent The parent element to which the graph view will be attached.
|
|
425
|
+
* @param graphId The identifier of the graph for which the graph view will be prepared.
|
|
426
|
+
* @param options Optional configuration for the graph view.
|
|
427
|
+
* @returns A `BundleGraphView` instance.
|
|
428
|
+
*/
|
|
429
|
+
createGraphView?(parent: HTMLElement, graphId: BundleGraphId, options?: BundleGraphViewOptions): BundleGraphView;
|
|
425
430
|
}
|
|
426
431
|
/**
|
|
427
432
|
* Provides access to the model that is contained in this bundle for use in
|
|
428
433
|
* model-check packages.
|
|
429
434
|
*/
|
|
430
435
|
interface Bundle {
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
436
|
+
/**
|
|
437
|
+
* The version of the bundle. This should be incremented when there is an
|
|
438
|
+
* incompatible change to the bundle format. The model-check tools can use
|
|
439
|
+
* this value to skip tests if two bundles have different version numbers.
|
|
440
|
+
*/
|
|
441
|
+
version: number;
|
|
442
|
+
/** The spec for the bundled model. */
|
|
443
|
+
modelSpec: ModelSpec;
|
|
444
|
+
/** Asynchronously initialize the underlying model. */
|
|
445
|
+
initModel(): Promise<BundleModel>;
|
|
441
446
|
}
|
|
442
447
|
/**
|
|
443
448
|
* Associates a name with a `Bundle`.
|
|
444
449
|
*/
|
|
445
450
|
interface NamedBundle {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
451
|
+
/** The name of the bundle, for example, "Current" or "Baseline". */
|
|
452
|
+
name: string;
|
|
453
|
+
/** The associated bundle. */
|
|
454
|
+
bundle: Bundle;
|
|
450
455
|
}
|
|
451
456
|
/**
|
|
452
457
|
* Represents a bundle that has had its model instances initialized.
|
|
453
458
|
*/
|
|
454
459
|
interface LoadedBundle {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
}
|
|
468
|
-
|
|
460
|
+
/** The name of the bundle, for example, "Current" or "Baseline". */
|
|
461
|
+
name: string;
|
|
462
|
+
/** The version of the bundle. */
|
|
463
|
+
version: number;
|
|
464
|
+
/** The spec for the bundled model. */
|
|
465
|
+
modelSpec: ModelSpec;
|
|
466
|
+
/**
|
|
467
|
+
* The initialized model instances for this bundle. If `concurrency` was specified
|
|
468
|
+
* in the config, then there will be that number of model instances in this array,
|
|
469
|
+
* otherwise there will be one instance.
|
|
470
|
+
*/
|
|
471
|
+
models: BundleModel[];
|
|
472
|
+
}
|
|
473
|
+
//#endregion
|
|
474
|
+
//#region src/bundle/impl-vars-codec.d.ts
|
|
469
475
|
/**
|
|
470
476
|
* A terse representation of a subscript.
|
|
471
477
|
*/
|
|
472
478
|
interface EncodedSubscript {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
479
|
+
/** The subscript name (e.g., "Sub1"). */
|
|
480
|
+
n: string;
|
|
481
|
+
/** The subscript identifier (e.g., "_sub1"). */
|
|
482
|
+
i: string;
|
|
477
483
|
}
|
|
478
484
|
/**
|
|
479
485
|
* A terse representation of a variable without subscripts.
|
|
480
486
|
*/
|
|
481
487
|
interface EncodedVariable {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
+
/** The variable name (corresponds to the base part of `ImplVar.varName` without subscripts). */
|
|
489
|
+
n: string;
|
|
490
|
+
/** The variable identifier (corresponds to the base part of `ImplVar.varId` without subscripts). */
|
|
491
|
+
i: string;
|
|
492
|
+
/** The variable index (corresponds to `ImplVar.varIndex`). */
|
|
493
|
+
x: number;
|
|
488
494
|
}
|
|
489
495
|
/**
|
|
490
496
|
* A terse representation of a variable type.
|
|
@@ -505,12 +511,12 @@ type EncodedVarInstance = number[];
|
|
|
505
511
|
* The encoded representation of impl variables that eliminates redundancy.
|
|
506
512
|
*/
|
|
507
513
|
interface EncodedImplVars {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
+
subscripts: EncodedSubscript[];
|
|
515
|
+
variables: EncodedVariable[];
|
|
516
|
+
varTypes: EncodedVarType[];
|
|
517
|
+
varInstances: {
|
|
518
|
+
[key: string]: EncodedVarInstance[];
|
|
519
|
+
};
|
|
514
520
|
}
|
|
515
521
|
/**
|
|
516
522
|
* Encode impl variable metadata into a more efficient format.
|
|
@@ -524,8 +530,8 @@ interface EncodedImplVars {
|
|
|
524
530
|
* @param input The input structure mapping keys to ImplVar arrays.
|
|
525
531
|
* @returns The encoded representation.
|
|
526
532
|
*/
|
|
527
|
-
declare function encodeImplVars(input: {
|
|
528
|
-
|
|
533
|
+
export declare function encodeImplVars(input: {
|
|
534
|
+
[key: string]: ImplVar[];
|
|
529
535
|
}): EncodedImplVars;
|
|
530
536
|
/**
|
|
531
537
|
* Decode impl variables from the efficient format back to the original structure.
|
|
@@ -533,50 +539,52 @@ declare function encodeImplVars(input: {
|
|
|
533
539
|
* @param encoded The encoded representation.
|
|
534
540
|
* @returns The original structure mapping keys to `ImplVar` arrays.
|
|
535
541
|
*/
|
|
536
|
-
declare function decodeImplVars(encoded: EncodedImplVars): {
|
|
537
|
-
|
|
542
|
+
export declare function decodeImplVars(encoded: EncodedImplVars): {
|
|
543
|
+
[key: string]: ImplVar[];
|
|
538
544
|
};
|
|
539
|
-
|
|
545
|
+
//#endregion
|
|
546
|
+
//#region src/check/check-config.d.ts
|
|
540
547
|
interface CheckOptions {
|
|
541
|
-
|
|
542
|
-
|
|
548
|
+
/** The strings containing check tests in YAML format. */
|
|
549
|
+
tests: string[];
|
|
543
550
|
}
|
|
544
551
|
interface CheckConfig {
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
552
|
+
/** The loaded bundle being checked. */
|
|
553
|
+
bundle: LoadedBundle;
|
|
554
|
+
/** The strings containing check tests in YAML format. */
|
|
555
|
+
tests: string[];
|
|
549
556
|
}
|
|
550
|
-
|
|
557
|
+
//#endregion
|
|
558
|
+
//#region src/_shared/task-queue.d.ts
|
|
551
559
|
type TaskKey = string;
|
|
552
560
|
type TaskExecutorKey = string;
|
|
553
561
|
interface BundleModels {
|
|
554
|
-
|
|
555
|
-
|
|
562
|
+
L?: BundleModel;
|
|
563
|
+
R: BundleModel;
|
|
556
564
|
}
|
|
557
565
|
/**
|
|
558
566
|
* Base interface for all tasks in the unified system.
|
|
559
567
|
*/
|
|
560
568
|
interface Task {
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
569
|
+
/** Unique key for this task instance. */
|
|
570
|
+
key: TaskKey;
|
|
571
|
+
/** The task kind. */
|
|
572
|
+
kind: string;
|
|
573
|
+
/** Process the task using the given models. */
|
|
574
|
+
process(models: BundleModels): Promise<void>;
|
|
567
575
|
}
|
|
568
576
|
/**
|
|
569
577
|
* Executes a single task using a set of `BundleModel` instances.
|
|
570
578
|
*/
|
|
571
579
|
interface TaskExecutor {
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
+
/**
|
|
581
|
+
* Execute the given task using the set of `BundleModel` instances
|
|
582
|
+
* associated with this executor.
|
|
583
|
+
*
|
|
584
|
+
* @param task The task to execute.
|
|
585
|
+
* @return A promise that resolves when the task is complete.
|
|
586
|
+
*/
|
|
587
|
+
execute(task: Task): Promise<void>;
|
|
580
588
|
}
|
|
581
589
|
/**
|
|
582
590
|
* A unified task queue that can process multiple kinds of tasks concurrently
|
|
@@ -584,162 +592,167 @@ interface TaskExecutor {
|
|
|
584
592
|
* This replaces the need for multiple separate TaskQueue instances.
|
|
585
593
|
*/
|
|
586
594
|
declare class TaskQueue {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
}
|
|
651
|
-
|
|
595
|
+
private readonly executors;
|
|
596
|
+
/** The single instance. */
|
|
597
|
+
private static instance;
|
|
598
|
+
/** The queue of task keys, most recent at front. */
|
|
599
|
+
private readonly taskKeyQueue;
|
|
600
|
+
/** The map of tasks. */
|
|
601
|
+
private readonly taskMap;
|
|
602
|
+
/** The idle event listeners. */
|
|
603
|
+
private readonly idleListeners;
|
|
604
|
+
/** Whether tasks are being processed. */
|
|
605
|
+
private processing;
|
|
606
|
+
/** Whether `shutdown` has been called. */
|
|
607
|
+
private stopped;
|
|
608
|
+
/**
|
|
609
|
+
* @param executors The map of available task executors.
|
|
610
|
+
*/
|
|
611
|
+
constructor(executors: Map<TaskExecutorKey, TaskExecutor>);
|
|
612
|
+
/**
|
|
613
|
+
* Initialize the shared `TaskQueue` instance.
|
|
614
|
+
*
|
|
615
|
+
* @param executors The map of available task executors.
|
|
616
|
+
*/
|
|
617
|
+
static initialize(executors: Map<TaskExecutorKey, TaskExecutor>): void;
|
|
618
|
+
/**
|
|
619
|
+
* Get the shared `TaskQueue` instance.
|
|
620
|
+
*/
|
|
621
|
+
static getInstance(): TaskQueue;
|
|
622
|
+
/**
|
|
623
|
+
* Add a task to the queue.
|
|
624
|
+
*
|
|
625
|
+
* @param task The task to add.
|
|
626
|
+
*/
|
|
627
|
+
addTask(task: Task): void;
|
|
628
|
+
/**
|
|
629
|
+
* Cancel a task.
|
|
630
|
+
*
|
|
631
|
+
* @param taskKey The key of the task to cancel.
|
|
632
|
+
*/
|
|
633
|
+
cancelTask(taskKey: TaskKey): void;
|
|
634
|
+
/**
|
|
635
|
+
* Add an idle listener.
|
|
636
|
+
*
|
|
637
|
+
* @param listener The listener to add.
|
|
638
|
+
*/
|
|
639
|
+
onIdle(listener: (error?: Error) => void): void;
|
|
640
|
+
/**
|
|
641
|
+
* Remove an idle listener.
|
|
642
|
+
*
|
|
643
|
+
* @param listener The listener to remove.
|
|
644
|
+
*/
|
|
645
|
+
removeIdleListener(listener: (error?: Error) => void): void;
|
|
646
|
+
/**
|
|
647
|
+
* Notify the idle listeners.
|
|
648
|
+
*
|
|
649
|
+
* @param error The error to notify the listeners with.
|
|
650
|
+
*/
|
|
651
|
+
private notifyIdle;
|
|
652
|
+
/**
|
|
653
|
+
* Shutdown the task queue, cancelling all pending tasks.
|
|
654
|
+
*/
|
|
655
|
+
shutdown(): void;
|
|
656
|
+
private processTasksIfNeeded;
|
|
657
|
+
private processNextTasks;
|
|
658
|
+
}
|
|
659
|
+
//#endregion
|
|
660
|
+
//#region src/check/check-data-coordinator.d.ts
|
|
652
661
|
type CheckDataRequestKey = string;
|
|
653
662
|
/**
|
|
654
663
|
* Options for `requestDataset`.
|
|
655
664
|
*/
|
|
656
665
|
interface RequestDatasetOptions {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
666
|
+
/** Optional constant overrides for the model. */
|
|
667
|
+
constants?: ConstantOverride[];
|
|
668
|
+
/** Optional lookup overrides for the model. */
|
|
669
|
+
lookups?: LookupOverride[];
|
|
661
670
|
}
|
|
662
671
|
/**
|
|
663
672
|
* Coordinates on-demand loading of data used to display a graph representation
|
|
664
673
|
* of a check/predicate.
|
|
665
674
|
*/
|
|
666
|
-
declare class CheckDataCoordinator {
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
675
|
+
export declare class CheckDataCoordinator {
|
|
676
|
+
private readonly taskQueue;
|
|
677
|
+
constructor(taskQueue: TaskQueue);
|
|
678
|
+
/**
|
|
679
|
+
* Request a dataset from the model.
|
|
680
|
+
*
|
|
681
|
+
* @param requestKey The unique key for the request.
|
|
682
|
+
* @param scenarioSpec The scenario spec that defines the inputs for the model run.
|
|
683
|
+
* @param datasetKey The key of the dataset to be fetched.
|
|
684
|
+
* @param options Optional configuration including constant and lookup overrides.
|
|
685
|
+
* @param onResponse The callback that will be called with the dataset.
|
|
686
|
+
*/
|
|
687
|
+
requestDataset(requestKey: CheckDataRequestKey, scenarioSpec: ScenarioSpec, datasetKey: DatasetKey, options: RequestDatasetOptions | undefined, onResponse: (dataset: Dataset) => void): void;
|
|
688
|
+
cancelRequest(key: CheckDataRequestKey): void;
|
|
680
689
|
}
|
|
681
690
|
/**
|
|
682
691
|
* Create a `CheckDataCoordinator` instance using the shared task queue.
|
|
683
692
|
*/
|
|
684
|
-
declare function createCheckDataCoordinator(): CheckDataCoordinator;
|
|
693
|
+
export declare function createCheckDataCoordinator(): CheckDataCoordinator;
|
|
685
694
|
/**
|
|
686
695
|
* @hidden This is not part of the public API; it is exposed only for use in tests.
|
|
687
696
|
*/
|
|
688
|
-
declare function createCheckDataCoordinatorForTests(bundleModel: BundleModel): CheckDataCoordinator;
|
|
689
|
-
|
|
697
|
+
export declare function createCheckDataCoordinatorForTests(bundleModel: BundleModel): CheckDataCoordinator;
|
|
698
|
+
//#endregion
|
|
699
|
+
//#region src/check/check-spec.d.ts
|
|
690
700
|
/** Spec type that allows for matching a check by group and test name. */
|
|
691
701
|
interface CheckNameSpec {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
702
|
+
/** The name of a check group. */
|
|
703
|
+
groupName: string;
|
|
704
|
+
/** The name of a check test. */
|
|
705
|
+
testName: string;
|
|
696
706
|
}
|
|
697
707
|
type CheckPredicateTimeSingle = number;
|
|
698
708
|
type CheckPredicateTimeRange = [number, number];
|
|
699
709
|
interface CheckPredicateTimeOptions {
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
710
|
+
after_excl?: number;
|
|
711
|
+
after_incl?: number;
|
|
712
|
+
before_excl?: number;
|
|
713
|
+
before_incl?: number;
|
|
704
714
|
}
|
|
705
715
|
type CheckPredicateTimeSpec = CheckPredicateTimeSingle | CheckPredicateTimeRange | CheckPredicateTimeOptions;
|
|
706
|
-
|
|
716
|
+
//#endregion
|
|
717
|
+
//#region src/check/check-dataset.d.ts
|
|
707
718
|
type CheckDatasetError = 'no-matches-for-dataset' | 'no-matches-for-group' | 'no-matches-for-type';
|
|
708
719
|
interface CheckDataset {
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
}
|
|
716
|
-
|
|
720
|
+
/** The key for the matched dataset; can be undefined if no dataset matched. */
|
|
721
|
+
datasetKey?: DatasetKey;
|
|
722
|
+
/** The name of the matched dataset, or the name associated with the error, if defined. */
|
|
723
|
+
name: string;
|
|
724
|
+
/** The error info if the dataset query failed to match. */
|
|
725
|
+
error?: CheckDatasetError;
|
|
726
|
+
}
|
|
727
|
+
//#endregion
|
|
728
|
+
//#region src/check/check-scenario.d.ts
|
|
717
729
|
interface CheckScenarioError {
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
730
|
+
kind: 'unknown-input-group' | 'empty-input-group';
|
|
731
|
+
/** The name of the input group that failed to match. */
|
|
732
|
+
name: string;
|
|
721
733
|
}
|
|
722
734
|
interface CheckScenarioInputDesc {
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
735
|
+
/** The name of the input. */
|
|
736
|
+
name: string;
|
|
737
|
+
/** The matched input variable; can be undefined if no input matched. */
|
|
738
|
+
inputVar?: InputVar;
|
|
739
|
+
/** The position of the input, if this is a position scenario. */
|
|
740
|
+
position?: InputPosition;
|
|
741
|
+
/** The value of the input, for the given position or explicit value. */
|
|
742
|
+
value?: number;
|
|
731
743
|
}
|
|
732
744
|
interface CheckScenario {
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
}
|
|
742
|
-
|
|
745
|
+
/** The spec used to configure the model with the matched input(s); can be undefined if input(s) failed to match. */
|
|
746
|
+
spec?: ScenarioSpec;
|
|
747
|
+
/** The name of the associated input group, if any. */
|
|
748
|
+
inputGroupName?: string;
|
|
749
|
+
/** The descriptions of the inputs; if empty, it is an "all inputs" scenario. */
|
|
750
|
+
inputDescs: CheckScenarioInputDesc[];
|
|
751
|
+
/** The error info if the scenario/input query failed to match. */
|
|
752
|
+
error?: CheckScenarioError;
|
|
753
|
+
}
|
|
754
|
+
//#endregion
|
|
755
|
+
//#region src/check/check-data-ref.d.ts
|
|
743
756
|
/**
|
|
744
757
|
* The key type for data references (in the form `<ScenarioUid::DatasetKey>`).
|
|
745
758
|
*/
|
|
@@ -753,12 +766,12 @@ type CheckDataRefOp = 'sum';
|
|
|
753
766
|
* by a predicate. Each of these corresponds to one data fetch.
|
|
754
767
|
*/
|
|
755
768
|
interface CheckRefDataset {
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
769
|
+
/** The key for the reference; can be undefined if inputs or datasets failed to match. */
|
|
770
|
+
key?: CheckDataRefKey;
|
|
771
|
+
/** The scenario used to generate the referenced dataset. */
|
|
772
|
+
scenario: CheckScenario;
|
|
773
|
+
/** The referenced dataset. */
|
|
774
|
+
dataset: CheckDataset;
|
|
762
775
|
}
|
|
763
776
|
/**
|
|
764
777
|
* The dataset(s) referenced by a particular predicate op (for cases where the check
|
|
@@ -766,69 +779,73 @@ interface CheckRefDataset {
|
|
|
766
779
|
* is referenced, the `op` determines how they are combined into a single dataset.
|
|
767
780
|
*/
|
|
768
781
|
interface CheckDataRef {
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
782
|
+
/** The operation used to combine the referenced datasets; undefined if there is a single dataset. */
|
|
783
|
+
op?: CheckDataRefOp;
|
|
784
|
+
/** The referenced datasets. */
|
|
785
|
+
refs: CheckRefDataset[];
|
|
773
786
|
}
|
|
774
|
-
|
|
787
|
+
//#endregion
|
|
788
|
+
//#region src/check/check-predicate.d.ts
|
|
775
789
|
type CheckPredicateOp = 'gt' | 'gte' | 'lt' | 'lte' | 'eq' | 'approx';
|
|
776
|
-
|
|
790
|
+
//#endregion
|
|
791
|
+
//#region src/check/check-func.d.ts
|
|
777
792
|
interface CheckResultErrorInfo {
|
|
778
|
-
|
|
779
|
-
|
|
793
|
+
kind: 'unknown-dataset' | 'unknown-input' | 'unknown-input-group' | 'empty-input-group';
|
|
794
|
+
name: string;
|
|
780
795
|
}
|
|
781
796
|
interface CheckResult {
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
}
|
|
790
|
-
|
|
797
|
+
status: 'passed' | 'failed' | 'error' | 'skipped';
|
|
798
|
+
message?: string;
|
|
799
|
+
failValue?: number;
|
|
800
|
+
failOp?: CheckPredicateOp;
|
|
801
|
+
failRefValue?: number;
|
|
802
|
+
failTime?: number;
|
|
803
|
+
errorInfo?: CheckResultErrorInfo;
|
|
804
|
+
}
|
|
805
|
+
//#endregion
|
|
806
|
+
//#region src/check/check-planner.d.ts
|
|
791
807
|
type CheckKey = number;
|
|
792
|
-
|
|
808
|
+
//#endregion
|
|
809
|
+
//#region src/check/check-report.d.ts
|
|
793
810
|
type CheckStatus = 'passed' | 'failed' | 'error' | 'skipped';
|
|
794
811
|
interface CheckPredicateOpConstantRef {
|
|
795
|
-
|
|
796
|
-
|
|
812
|
+
kind: 'constant';
|
|
813
|
+
value: number;
|
|
797
814
|
}
|
|
798
815
|
interface CheckPredicateOpDataRef {
|
|
799
|
-
|
|
800
|
-
|
|
816
|
+
kind: 'data';
|
|
817
|
+
dataRef: CheckDataRef;
|
|
801
818
|
}
|
|
802
819
|
type CheckPredicateOpRef = CheckPredicateOpConstantRef | CheckPredicateOpDataRef;
|
|
803
820
|
interface CheckPredicateReport {
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
821
|
+
checkKey: CheckKey;
|
|
822
|
+
result: CheckResult;
|
|
823
|
+
opRefs: Map<CheckPredicateOp, CheckPredicateOpRef>;
|
|
824
|
+
opValues: string[];
|
|
825
|
+
time?: CheckPredicateTimeSpec;
|
|
826
|
+
tolerance?: number;
|
|
810
827
|
}
|
|
811
828
|
interface CheckDatasetReport {
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
829
|
+
checkDataset: CheckDataset;
|
|
830
|
+
status: CheckStatus;
|
|
831
|
+
predicates: CheckPredicateReport[];
|
|
815
832
|
}
|
|
816
833
|
interface CheckScenarioReport {
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
834
|
+
checkScenario: CheckScenario;
|
|
835
|
+
status: CheckStatus;
|
|
836
|
+
datasets: CheckDatasetReport[];
|
|
820
837
|
}
|
|
821
838
|
interface CheckTestReport {
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
839
|
+
name: string;
|
|
840
|
+
status: CheckStatus;
|
|
841
|
+
scenarios: CheckScenarioReport[];
|
|
825
842
|
}
|
|
826
843
|
interface CheckGroupReport {
|
|
827
|
-
|
|
828
|
-
|
|
844
|
+
name: string;
|
|
845
|
+
tests: CheckTestReport[];
|
|
829
846
|
}
|
|
830
847
|
interface CheckReport {
|
|
831
|
-
|
|
848
|
+
groups: CheckGroupReport[];
|
|
832
849
|
}
|
|
833
850
|
type StyleFunc = (s: string) => string;
|
|
834
851
|
/**
|
|
@@ -837,29 +854,30 @@ type StyleFunc = (s: string) => string;
|
|
|
837
854
|
* @param scenario The scenario report.
|
|
838
855
|
* @param bold A function that applies bold styling to a string.
|
|
839
856
|
*/
|
|
840
|
-
declare function scenarioMessage(scenario: CheckScenarioReport, bold: StyleFunc): string;
|
|
857
|
+
export declare function scenarioMessage(scenario: CheckScenarioReport, bold: StyleFunc): string;
|
|
841
858
|
/**
|
|
842
859
|
* Return a string representation of the given dataset.
|
|
843
860
|
*
|
|
844
861
|
* @param dataset The dataset report.
|
|
845
862
|
* @param bold A function that applies bold styling to a string.
|
|
846
863
|
*/
|
|
847
|
-
declare function datasetMessage(dataset: CheckDatasetReport, bold: StyleFunc): string;
|
|
864
|
+
export declare function datasetMessage(dataset: CheckDatasetReport, bold: StyleFunc): string;
|
|
848
865
|
/**
|
|
849
866
|
* Return a string representation of the given predicate.
|
|
850
867
|
*
|
|
851
868
|
* @param predicate The predicate report.
|
|
852
869
|
* @param bold A function that applies bold styling to a string.
|
|
853
870
|
*/
|
|
854
|
-
declare function predicateMessage(predicate: CheckPredicateReport, bold: StyleFunc): string;
|
|
855
|
-
|
|
871
|
+
export declare function predicateMessage(predicate: CheckPredicateReport, bold: StyleFunc): string;
|
|
872
|
+
//#endregion
|
|
873
|
+
//#region src/check/check-summary.d.ts
|
|
856
874
|
/**
|
|
857
875
|
* A simplified/terse version of `CheckPredicateReport` that matches the
|
|
858
876
|
* format of the JSON objects emitted by the CLI in terse mode.
|
|
859
877
|
*/
|
|
860
878
|
interface CheckPredicateSummary {
|
|
861
|
-
|
|
862
|
-
|
|
879
|
+
checkKey: CheckKey;
|
|
880
|
+
result: CheckResult;
|
|
863
881
|
}
|
|
864
882
|
/**
|
|
865
883
|
* A simplified/terse version of `CheckReport` that matches the
|
|
@@ -868,7 +886,7 @@ interface CheckPredicateSummary {
|
|
|
868
886
|
* of 'failed', 'error', or 'skipped'.
|
|
869
887
|
*/
|
|
870
888
|
interface CheckSummary {
|
|
871
|
-
|
|
889
|
+
predicateSummaries: CheckPredicateSummary[];
|
|
872
890
|
}
|
|
873
891
|
/**
|
|
874
892
|
* Convert a full `CheckReport` to a simplified `CheckSummary` that includes
|
|
@@ -877,7 +895,7 @@ interface CheckSummary {
|
|
|
877
895
|
* @param checkReport The full check report.
|
|
878
896
|
* @return The converted check summary.
|
|
879
897
|
*/
|
|
880
|
-
declare function checkSummaryFromReport(checkReport: CheckReport): CheckSummary;
|
|
898
|
+
export declare function checkSummaryFromReport(checkReport: CheckReport): CheckSummary;
|
|
881
899
|
/**
|
|
882
900
|
* Convert a simplified `CheckSummary` to a full `CheckReport` that restores the
|
|
883
901
|
* structure of the tests from the given configuration.
|
|
@@ -887,112 +905,113 @@ declare function checkSummaryFromReport(checkReport: CheckReport): CheckSummary;
|
|
|
887
905
|
* @param skipChecks The checks that were skipped when the original report was created.
|
|
888
906
|
* @return The converted check report.
|
|
889
907
|
*/
|
|
890
|
-
declare function checkReportFromSummary(checkConfig: CheckConfig, checkSummary: CheckSummary, skipChecks?: CheckNameSpec[]): CheckReport | undefined;
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
type
|
|
908
|
+
export declare function checkReportFromSummary(checkConfig: CheckConfig, checkSummary: CheckSummary, skipChecks?: CheckNameSpec[]): CheckReport | undefined;
|
|
909
|
+
//#endregion
|
|
910
|
+
//#region src/comparison/config/comparison-spec-types.d.ts
|
|
911
|
+
export type ComparisonDatasetName = string;
|
|
912
|
+
export type ComparisonDatasetSource = string;
|
|
894
913
|
/**
|
|
895
914
|
* Specifies a dataset (variable) used for comparison.
|
|
896
915
|
*/
|
|
897
|
-
interface ComparisonDatasetSpec {
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
}
|
|
907
|
-
type ComparisonScenarioId = string;
|
|
908
|
-
type ComparisonScenarioTitle = string;
|
|
909
|
-
type ComparisonScenarioSubtitle = string;
|
|
910
|
-
type ComparisonScenarioInputName = string;
|
|
911
|
-
type ComparisonScenarioInputPosition = 'default' | 'min' | 'max';
|
|
916
|
+
export interface ComparisonDatasetSpec {
|
|
917
|
+
kind: 'dataset';
|
|
918
|
+
/** The name of the dataset (variable). */
|
|
919
|
+
name: ComparisonDatasetName;
|
|
920
|
+
/**
|
|
921
|
+
* The source of the dataset, if it is from an external data file. If
|
|
922
|
+
* undefined, the dataset is assumed to be a model output.
|
|
923
|
+
*/
|
|
924
|
+
source?: ComparisonDatasetSource;
|
|
925
|
+
}
|
|
926
|
+
export type ComparisonScenarioId = string;
|
|
927
|
+
export type ComparisonScenarioTitle = string;
|
|
928
|
+
export type ComparisonScenarioSubtitle = string;
|
|
929
|
+
export type ComparisonScenarioInputName = string;
|
|
930
|
+
export type ComparisonScenarioInputPosition = 'default' | 'min' | 'max';
|
|
912
931
|
/**
|
|
913
932
|
* Specifies an input that is set to a specific position (default / min / max).
|
|
914
933
|
*/
|
|
915
|
-
interface ComparisonScenarioInputAtPositionSpec {
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
934
|
+
export interface ComparisonScenarioInputAtPositionSpec {
|
|
935
|
+
kind: 'input-at-position';
|
|
936
|
+
/** The requested input name or alias. */
|
|
937
|
+
inputName: ComparisonScenarioInputName;
|
|
938
|
+
/** The requested position of the input. */
|
|
939
|
+
position: ComparisonScenarioInputPosition;
|
|
921
940
|
}
|
|
922
941
|
/**
|
|
923
942
|
* Specifies an input that is set to a specific number value.
|
|
924
943
|
*/
|
|
925
|
-
interface ComparisonScenarioInputAtValueSpec {
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
944
|
+
export interface ComparisonScenarioInputAtValueSpec {
|
|
945
|
+
kind: 'input-at-value';
|
|
946
|
+
/** The requested input name or alias. */
|
|
947
|
+
inputName: ComparisonScenarioInputName;
|
|
948
|
+
/** The number value of the input. */
|
|
949
|
+
value: number;
|
|
931
950
|
}
|
|
932
951
|
/**
|
|
933
952
|
* A single input setting for a scenario. An input can be set to a specific number value,
|
|
934
953
|
* or it can be set to a "position" (default / min / max).
|
|
935
954
|
*/
|
|
936
|
-
type ComparisonScenarioInputSpec = ComparisonScenarioInputAtPositionSpec | ComparisonScenarioInputAtValueSpec;
|
|
955
|
+
export type ComparisonScenarioInputSpec = ComparisonScenarioInputAtPositionSpec | ComparisonScenarioInputAtValueSpec;
|
|
937
956
|
/**
|
|
938
957
|
* Specifies a single scenario that sets one or more inputs to a value/position.
|
|
939
958
|
*/
|
|
940
|
-
interface ComparisonScenarioWithInputsSpec {
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
959
|
+
export interface ComparisonScenarioWithInputsSpec {
|
|
960
|
+
kind: 'scenario-with-inputs';
|
|
961
|
+
/** The unique identifier for the scenario. */
|
|
962
|
+
id?: ComparisonScenarioId;
|
|
963
|
+
/** The title of the scenario. */
|
|
964
|
+
title?: ComparisonScenarioTitle;
|
|
965
|
+
/** The subtitle of the scenario. */
|
|
966
|
+
subtitle?: ComparisonScenarioSubtitle;
|
|
967
|
+
/** The input settings for this scenario. */
|
|
968
|
+
inputs: ComparisonScenarioInputSpec[];
|
|
950
969
|
}
|
|
951
970
|
/**
|
|
952
971
|
* Specifies a single scenario that configures inputs differently for the two
|
|
953
972
|
* model instances.
|
|
954
973
|
*/
|
|
955
|
-
interface ComparisonScenarioWithDistinctInputsSpec {
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
974
|
+
export interface ComparisonScenarioWithDistinctInputsSpec {
|
|
975
|
+
kind: 'scenario-with-distinct-inputs';
|
|
976
|
+
/** The unique identifier for the scenario. */
|
|
977
|
+
id?: ComparisonScenarioId;
|
|
978
|
+
/** The title of the scenario. */
|
|
979
|
+
title?: ComparisonScenarioTitle;
|
|
980
|
+
/** The subtitle of the scenario. */
|
|
981
|
+
subtitle?: ComparisonScenarioSubtitle;
|
|
982
|
+
/** The input settings for this scenario when run with the "left" model. */
|
|
983
|
+
inputsL: ComparisonScenarioInputSpec[];
|
|
984
|
+
/** The input settings for this scenario when run with the "right" model. */
|
|
985
|
+
inputsR: ComparisonScenarioInputSpec[];
|
|
967
986
|
}
|
|
968
987
|
/**
|
|
969
988
|
* Specifies a single scenario that configures inputs according to the setting
|
|
970
989
|
* group defined for each model instance.
|
|
971
990
|
*/
|
|
972
|
-
interface ComparisonScenarioWithSettingGroupSpec {
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
991
|
+
export interface ComparisonScenarioWithSettingGroupSpec {
|
|
992
|
+
kind: 'scenario-with-setting-group';
|
|
993
|
+
/** The unique identifier for the scenario. */
|
|
994
|
+
id?: ComparisonScenarioId;
|
|
995
|
+
/** The title of the scenario. */
|
|
996
|
+
title?: ComparisonScenarioTitle;
|
|
997
|
+
/** The subtitle of the scenario. */
|
|
998
|
+
subtitle?: ComparisonScenarioSubtitle;
|
|
999
|
+
/** The identifier of the input setting group as used in `ModelSpec.inputSettingGroups`. */
|
|
1000
|
+
settingGroupId: InputSettingGroupId;
|
|
982
1001
|
}
|
|
983
1002
|
/**
|
|
984
1003
|
* Specifies a single scenario that sets all available inputs to position.
|
|
985
1004
|
*/
|
|
986
|
-
interface ComparisonScenarioWithAllInputsSpec {
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
1005
|
+
export interface ComparisonScenarioWithAllInputsSpec {
|
|
1006
|
+
kind: 'scenario-with-all-inputs';
|
|
1007
|
+
/** The unique identifier for the scenario. */
|
|
1008
|
+
id?: ComparisonScenarioId;
|
|
1009
|
+
/** The title of the scenario. */
|
|
1010
|
+
title?: ComparisonScenarioTitle;
|
|
1011
|
+
/** The subtitle of the scenario. */
|
|
1012
|
+
subtitle?: ComparisonScenarioSubtitle;
|
|
1013
|
+
/** The position that will be used for all available inputs. */
|
|
1014
|
+
position: ComparisonScenarioInputPosition;
|
|
996
1015
|
}
|
|
997
1016
|
/**
|
|
998
1017
|
* Special preset that expands to many scenarios:
|
|
@@ -1001,502 +1020,506 @@ interface ComparisonScenarioWithAllInputsSpec {
|
|
|
1001
1020
|
* - one scenario with the input at its minimum
|
|
1002
1021
|
* - one scenario with the input at its maximum
|
|
1003
1022
|
*/
|
|
1004
|
-
interface ComparisonScenarioPresetMatrixSpec {
|
|
1005
|
-
|
|
1023
|
+
export interface ComparisonScenarioPresetMatrixSpec {
|
|
1024
|
+
kind: 'scenario-matrix';
|
|
1006
1025
|
}
|
|
1007
1026
|
/**
|
|
1008
1027
|
* A definition of input scenario(s). A scenario can set one input to a value/position, or it
|
|
1009
1028
|
* can set multiple inputs to particular values/positions.
|
|
1010
1029
|
*/
|
|
1011
|
-
type ComparisonScenarioSpec = ComparisonScenarioWithInputsSpec | ComparisonScenarioWithDistinctInputsSpec | ComparisonScenarioWithSettingGroupSpec | ComparisonScenarioWithAllInputsSpec | ComparisonScenarioPresetMatrixSpec;
|
|
1030
|
+
export type ComparisonScenarioSpec = ComparisonScenarioWithInputsSpec | ComparisonScenarioWithDistinctInputsSpec | ComparisonScenarioWithSettingGroupSpec | ComparisonScenarioWithAllInputsSpec | ComparisonScenarioPresetMatrixSpec;
|
|
1012
1031
|
/** A reference to a scenario definition. */
|
|
1013
|
-
interface ComparisonScenarioRefSpec {
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1032
|
+
export interface ComparisonScenarioRefSpec {
|
|
1033
|
+
kind: 'scenario-ref';
|
|
1034
|
+
/** The ID of the scenario that is referenced. */
|
|
1035
|
+
scenarioId: ComparisonScenarioId;
|
|
1036
|
+
/** The optional title that is used instead of the referenced scenario's title. */
|
|
1037
|
+
title?: ComparisonScenarioTitle;
|
|
1038
|
+
/** The optional subtitle that is used instead of the referenced scenario's subtitle. */
|
|
1039
|
+
subtitle?: ComparisonScenarioSubtitle;
|
|
1021
1040
|
}
|
|
1022
1041
|
/** Spec type that allows for matching a comparison scenario by title and subtitle. */
|
|
1023
|
-
interface ComparisonScenarioTitleSpec {
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1042
|
+
export interface ComparisonScenarioTitleSpec {
|
|
1043
|
+
/** The title of a comparison scenario. */
|
|
1044
|
+
title: string;
|
|
1045
|
+
/** The subtitle of a comparison scenario. */
|
|
1046
|
+
subtitle?: string;
|
|
1028
1047
|
}
|
|
1029
|
-
type ComparisonScenarioGroupId = string;
|
|
1030
|
-
type ComparisonScenarioGroupTitle = string;
|
|
1048
|
+
export type ComparisonScenarioGroupId = string;
|
|
1049
|
+
export type ComparisonScenarioGroupTitle = string;
|
|
1031
1050
|
/**
|
|
1032
1051
|
* A definition of a group of input scenarios. Multiple scenarios can be grouped together under a single name, and
|
|
1033
1052
|
* can later be referenced by group ID in a view definition.
|
|
1034
1053
|
*/
|
|
1035
|
-
interface ComparisonScenarioGroupSpec {
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1054
|
+
export interface ComparisonScenarioGroupSpec {
|
|
1055
|
+
kind: 'scenario-group';
|
|
1056
|
+
/** The unique identifier for the group. */
|
|
1057
|
+
id?: ComparisonScenarioGroupId;
|
|
1058
|
+
/** The title of the group. */
|
|
1059
|
+
title: ComparisonScenarioGroupTitle;
|
|
1060
|
+
/** The scenarios that are included in this group. */
|
|
1061
|
+
scenarios: (ComparisonScenarioSpec | ComparisonScenarioRefSpec)[];
|
|
1043
1062
|
}
|
|
1044
1063
|
/** A reference to a scenario group definition. */
|
|
1045
|
-
interface ComparisonScenarioGroupRefSpec {
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1064
|
+
export interface ComparisonScenarioGroupRefSpec {
|
|
1065
|
+
kind: 'scenario-group-ref';
|
|
1066
|
+
/** The ID of the scenario group that is referenced. */
|
|
1067
|
+
groupId: ComparisonScenarioGroupId;
|
|
1049
1068
|
}
|
|
1050
|
-
type ComparisonGraphId = string;
|
|
1069
|
+
export type ComparisonGraphId = string;
|
|
1051
1070
|
/**
|
|
1052
1071
|
* Specifies a list of graphs to be shown in a view.
|
|
1053
1072
|
*/
|
|
1054
|
-
interface ComparisonGraphsArraySpec {
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1073
|
+
export interface ComparisonGraphsArraySpec {
|
|
1074
|
+
kind: 'graphs-array';
|
|
1075
|
+
/** The array of IDs for graphs to show. */
|
|
1076
|
+
graphIds: ComparisonGraphId[];
|
|
1058
1077
|
}
|
|
1059
1078
|
/**
|
|
1060
1079
|
* Specifies a preset list of graphs to be shown in a view.
|
|
1061
1080
|
*/
|
|
1062
|
-
interface ComparisonGraphsPresetSpec {
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1081
|
+
export interface ComparisonGraphsPresetSpec {
|
|
1082
|
+
kind: 'graphs-preset';
|
|
1083
|
+
/** The preset (currently only "all" is supported, which shows all available graphs). */
|
|
1084
|
+
preset: 'all';
|
|
1066
1085
|
}
|
|
1067
|
-
type ComparisonGraphGroupId = string;
|
|
1086
|
+
export type ComparisonGraphGroupId = string;
|
|
1068
1087
|
/**
|
|
1069
1088
|
* A definition of a group of graphs to be shown in a view. Multiple graphs can be grouped together
|
|
1070
1089
|
* under a single ID, and can later be referenced by group ID in a view definition.
|
|
1071
1090
|
*/
|
|
1072
|
-
interface ComparisonGraphGroupSpec {
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1091
|
+
export interface ComparisonGraphGroupSpec {
|
|
1092
|
+
kind: 'graph-group';
|
|
1093
|
+
/** The unique identifier for the group. */
|
|
1094
|
+
id: ComparisonGraphGroupId;
|
|
1095
|
+
/** The graphs that are included in this group. */
|
|
1096
|
+
graphIds: ComparisonGraphId[];
|
|
1078
1097
|
}
|
|
1079
1098
|
/** A reference to a graph group definition. */
|
|
1080
|
-
interface ComparisonGraphGroupRefSpec {
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
}
|
|
1085
|
-
type ComparisonViewTitle = string;
|
|
1086
|
-
type ComparisonViewSubtitle = string;
|
|
1087
|
-
type ComparisonViewRowTitle = string;
|
|
1088
|
-
type ComparisonViewRowSubtitle = string;
|
|
1089
|
-
type ComparisonViewItemTitle = string;
|
|
1090
|
-
type ComparisonViewItemSubtitle = string;
|
|
1091
|
-
type ComparisonViewGraphOrder = 'default' | 'grouped-by-diffs';
|
|
1099
|
+
export interface ComparisonGraphGroupRefSpec {
|
|
1100
|
+
kind: 'graph-group-ref';
|
|
1101
|
+
/** The ID of the graph group that is referenced. */
|
|
1102
|
+
groupId: ComparisonGraphGroupId;
|
|
1103
|
+
}
|
|
1104
|
+
export type ComparisonViewTitle = string;
|
|
1105
|
+
export type ComparisonViewSubtitle = string;
|
|
1106
|
+
export type ComparisonViewRowTitle = string;
|
|
1107
|
+
export type ComparisonViewRowSubtitle = string;
|
|
1108
|
+
export type ComparisonViewItemTitle = string;
|
|
1109
|
+
export type ComparisonViewItemSubtitle = string;
|
|
1110
|
+
export type ComparisonViewGraphOrder = 'default' | 'grouped-by-diffs';
|
|
1092
1111
|
/**
|
|
1093
1112
|
* Specifies a single comparison box to be shown in a view.
|
|
1094
1113
|
*/
|
|
1095
|
-
interface ComparisonViewBoxSpec {
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1114
|
+
export interface ComparisonViewBoxSpec {
|
|
1115
|
+
kind: 'view-box';
|
|
1116
|
+
/** The title of the box. */
|
|
1117
|
+
title: ComparisonViewItemTitle;
|
|
1118
|
+
/** The subtitle of the box. */
|
|
1119
|
+
subtitle?: ComparisonViewItemSubtitle;
|
|
1120
|
+
/** The dataset shown in this comparison box. */
|
|
1121
|
+
dataset: ComparisonDatasetSpec;
|
|
1122
|
+
/** The scenario shown in this comparison box. */
|
|
1123
|
+
scenarioId: ComparisonScenarioId;
|
|
1105
1124
|
}
|
|
1106
1125
|
/**
|
|
1107
1126
|
* Specifies a row of comparison boxes to be shown in a view.
|
|
1108
1127
|
*/
|
|
1109
|
-
interface ComparisonViewRowSpec {
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1128
|
+
export interface ComparisonViewRowSpec {
|
|
1129
|
+
kind: 'view-row';
|
|
1130
|
+
/** The title of the row. */
|
|
1131
|
+
title: ComparisonViewRowTitle;
|
|
1132
|
+
/** The subtitle of the row. */
|
|
1133
|
+
subtitle?: ComparisonViewRowSubtitle;
|
|
1134
|
+
/** The array of boxes to be shown in the row. */
|
|
1135
|
+
boxes: ComparisonViewBoxSpec[];
|
|
1117
1136
|
}
|
|
1118
1137
|
/**
|
|
1119
1138
|
* Specifies a set of graphs to be shown in a view.
|
|
1120
1139
|
*/
|
|
1121
|
-
type ComparisonViewGraphsSpec = ComparisonGraphsPresetSpec | ComparisonGraphsArraySpec | ComparisonGraphGroupRefSpec;
|
|
1140
|
+
export type ComparisonViewGraphsSpec = ComparisonGraphsPresetSpec | ComparisonGraphsArraySpec | ComparisonGraphGroupRefSpec;
|
|
1122
1141
|
/**
|
|
1123
1142
|
* A definition of a view. A view presents a set of graphs, either for a single input scenario
|
|
1124
1143
|
* or for a mix of different dataset/scenario combinations.
|
|
1125
1144
|
*/
|
|
1126
|
-
interface ComparisonViewSpec {
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
}
|
|
1144
|
-
type ComparisonViewGroupTitle = string;
|
|
1145
|
+
export interface ComparisonViewSpec {
|
|
1146
|
+
kind: 'view';
|
|
1147
|
+
/** The title of the view. If undefined, the title will be inferred from the scenario. */
|
|
1148
|
+
title?: ComparisonViewTitle;
|
|
1149
|
+
/** The subtitle of the view. If undefined, the subtitle will be inferred from the scenario. */
|
|
1150
|
+
subtitle?: ComparisonViewSubtitle;
|
|
1151
|
+
/** The scenario to be shown in the view if this is a single-scenario view. */
|
|
1152
|
+
scenarioId?: ComparisonScenarioId;
|
|
1153
|
+
/** The array of rows to be shown in the view if this is a freeform view. */
|
|
1154
|
+
rows?: ComparisonViewRowSpec[];
|
|
1155
|
+
/** The graphs to be shown in the view. */
|
|
1156
|
+
graphs?: ComparisonViewGraphsSpec;
|
|
1157
|
+
/**
|
|
1158
|
+
* The order in which the graphs will be displayed. If undefined, the graphs will be
|
|
1159
|
+
* displayed in the "default" order, i.e., in the same order that the IDs were specified.
|
|
1160
|
+
*/
|
|
1161
|
+
graphOrder?: ComparisonViewGraphOrder;
|
|
1162
|
+
}
|
|
1163
|
+
export type ComparisonViewGroupTitle = string;
|
|
1145
1164
|
/**
|
|
1146
1165
|
* Specifies a view group with an explicit array of view definitions.
|
|
1147
1166
|
*/
|
|
1148
|
-
interface ComparisonViewGroupWithViewsSpec {
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1167
|
+
export interface ComparisonViewGroupWithViewsSpec {
|
|
1168
|
+
kind: 'view-group-with-views';
|
|
1169
|
+
/** The title of the group of views. */
|
|
1170
|
+
title: ComparisonViewGroupTitle;
|
|
1171
|
+
/** The views that are included in this group. */
|
|
1172
|
+
views: ComparisonViewSpec[];
|
|
1154
1173
|
}
|
|
1155
1174
|
/**
|
|
1156
1175
|
* Specifies a view group by declaring the scenarios included in the group (one view per scenario), along
|
|
1157
1176
|
* with a set of graphs that will shown in each view.
|
|
1158
1177
|
*/
|
|
1159
|
-
interface ComparisonViewGroupWithScenariosSpec {
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1178
|
+
export interface ComparisonViewGroupWithScenariosSpec {
|
|
1179
|
+
kind: 'view-group-with-scenarios';
|
|
1180
|
+
/** The title of the group of views. */
|
|
1181
|
+
title: ComparisonViewGroupTitle;
|
|
1182
|
+
/** The scenarios to be included (one view will be created for each scenario). */
|
|
1183
|
+
scenarios: (ComparisonScenarioRefSpec | ComparisonScenarioGroupRefSpec)[];
|
|
1184
|
+
/** The graphs to be shown for each scenario view. */
|
|
1185
|
+
graphs: ComparisonViewGraphsSpec;
|
|
1186
|
+
/**
|
|
1187
|
+
* The order in which the graphs will be displayed. If undefined, the graphs will be
|
|
1188
|
+
* displayed in the "default" order, i.e., in the same order that the IDs were specified.
|
|
1189
|
+
*/
|
|
1190
|
+
graphOrder?: ComparisonViewGraphOrder;
|
|
1172
1191
|
}
|
|
1173
1192
|
/**
|
|
1174
1193
|
* A definition of a group of views. Multiple related views can be grouped together under a single title
|
|
1175
1194
|
* to make them easy to distinguish in a report.
|
|
1176
1195
|
*/
|
|
1177
|
-
type ComparisonViewGroupSpec = ComparisonViewGroupWithViewsSpec | ComparisonViewGroupWithScenariosSpec;
|
|
1196
|
+
export type ComparisonViewGroupSpec = ComparisonViewGroupWithViewsSpec | ComparisonViewGroupWithScenariosSpec;
|
|
1178
1197
|
/**
|
|
1179
1198
|
* Contains the scenario and view definitions from one or more sources (JSON/YAML files or manually
|
|
1180
1199
|
* defined specs).
|
|
1181
1200
|
*/
|
|
1182
|
-
interface ComparisonSpecs {
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1201
|
+
export interface ComparisonSpecs {
|
|
1202
|
+
/** The requested scenarios. */
|
|
1203
|
+
scenarios?: ComparisonScenarioSpec[];
|
|
1204
|
+
/** The requested scenario groups. */
|
|
1205
|
+
scenarioGroups?: ComparisonScenarioGroupSpec[];
|
|
1206
|
+
/** The requested graph groups. */
|
|
1207
|
+
graphGroups?: ComparisonGraphGroupSpec[];
|
|
1208
|
+
/** The requested view groups. */
|
|
1209
|
+
viewGroups?: ComparisonViewGroupSpec[];
|
|
1191
1210
|
}
|
|
1192
1211
|
/** A source of comparison scenario and specifications. */
|
|
1193
|
-
interface ComparisonSpecsSource {
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1212
|
+
export interface ComparisonSpecsSource {
|
|
1213
|
+
kind: 'yaml' | 'json';
|
|
1214
|
+
/** The source filename, if known. */
|
|
1215
|
+
filename?: string;
|
|
1216
|
+
/** A string containing YAML or JSON content. */
|
|
1217
|
+
content: string;
|
|
1218
|
+
}
|
|
1219
|
+
//#endregion
|
|
1220
|
+
//#region src/comparison/_shared/comparison-resolved-types.d.ts
|
|
1201
1221
|
/** A resolved dataset that is being compared. */
|
|
1202
|
-
interface ComparisonDataset {
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1222
|
+
export interface ComparisonDataset {
|
|
1223
|
+
kind: 'dataset';
|
|
1224
|
+
/** The unique key for the dataset (i.e., output variable or static data). */
|
|
1225
|
+
key: DatasetKey;
|
|
1226
|
+
/**
|
|
1227
|
+
* The resolved output variable from the "left" model that corresponds to this dataset,
|
|
1228
|
+
* or undefined if the variable is not defined in the left model.
|
|
1229
|
+
*/
|
|
1230
|
+
outputVarL?: OutputVar;
|
|
1231
|
+
/**
|
|
1232
|
+
* The resolved output variable from the "right" model that corresponds to this dataset,
|
|
1233
|
+
* or undefined if the variable is not defined in the right model.
|
|
1234
|
+
*/
|
|
1235
|
+
outputVarR?: OutputVar;
|
|
1216
1236
|
}
|
|
1217
1237
|
/** A unique key for a `ComparisonScenario`, generated internally for use by the library. */
|
|
1218
|
-
type ComparisonScenarioKey = string & {
|
|
1219
|
-
|
|
1238
|
+
export type ComparisonScenarioKey = string & {
|
|
1239
|
+
_brand?: 'ComparisonScenarioKey';
|
|
1220
1240
|
};
|
|
1221
1241
|
/** A fatal error indicating that no input variable matched the requested name. */
|
|
1222
|
-
interface ComparisonResolverUnknownInputError {
|
|
1223
|
-
|
|
1242
|
+
export interface ComparisonResolverUnknownInputError {
|
|
1243
|
+
kind: 'unknown-input';
|
|
1224
1244
|
}
|
|
1225
1245
|
/** A fatal error indicating that no input setting group matched the requested ID. */
|
|
1226
|
-
interface ComparisonResolverUnknownInputSettingGroupError {
|
|
1227
|
-
|
|
1246
|
+
export interface ComparisonResolverUnknownInputSettingGroupError {
|
|
1247
|
+
kind: 'unknown-input-setting-group';
|
|
1228
1248
|
}
|
|
1229
1249
|
/**
|
|
1230
1250
|
* A fatal resolution error. When this is set on an input state, the scenario
|
|
1231
1251
|
* cannot be run for the affected side: spec construction for that side is
|
|
1232
1252
|
* skipped and downstream UI annotations render it as an error.
|
|
1233
1253
|
*/
|
|
1234
|
-
type ComparisonResolverError = ComparisonResolverUnknownInputError | ComparisonResolverUnknownInputSettingGroupError;
|
|
1254
|
+
export type ComparisonResolverError = ComparisonResolverUnknownInputError | ComparisonResolverUnknownInputSettingGroupError;
|
|
1235
1255
|
/**
|
|
1236
1256
|
* A non-fatal warning indicating that the resolved value falls outside the
|
|
1237
1257
|
* declared `[minValue, maxValue]` range of a slider (or is not one of the
|
|
1238
1258
|
* declared values of a switch). The scenario still runs with the requested
|
|
1239
1259
|
* value; consumers (e.g. UI annotations) should flag it as a warning.
|
|
1240
1260
|
*/
|
|
1241
|
-
interface ComparisonResolverValueOutOfRangeWarning {
|
|
1242
|
-
|
|
1261
|
+
export interface ComparisonResolverValueOutOfRangeWarning {
|
|
1262
|
+
kind: 'value-out-of-range';
|
|
1243
1263
|
}
|
|
1244
1264
|
/**
|
|
1245
1265
|
* A non-fatal resolution warning. Warnings do not prevent the scenario from
|
|
1246
1266
|
* running; they are surfaced as annotations alongside the resolved value.
|
|
1247
1267
|
*/
|
|
1248
|
-
type ComparisonResolverWarning = ComparisonResolverValueOutOfRangeWarning;
|
|
1268
|
+
export type ComparisonResolverWarning = ComparisonResolverValueOutOfRangeWarning;
|
|
1249
1269
|
/** Describes the resolution state for a scenario input relative to a specific model. */
|
|
1250
|
-
interface ComparisonScenarioInputState {
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1270
|
+
export interface ComparisonScenarioInputState {
|
|
1271
|
+
/** The matched input variable; can be undefined if no input matched. */
|
|
1272
|
+
inputVar?: InputVar;
|
|
1273
|
+
/** The position of the input, if this is a position scenario. */
|
|
1274
|
+
position?: InputPosition;
|
|
1275
|
+
/** The value of the input, for the given position or explicit value. */
|
|
1276
|
+
value?: number;
|
|
1277
|
+
/** The fatal error info if the input could not be resolved. */
|
|
1278
|
+
error?: ComparisonResolverError;
|
|
1279
|
+
/**
|
|
1280
|
+
* Non-fatal advisory info about the resolved input. When set (without an
|
|
1281
|
+
* accompanying `error`), the input still resolved and the scenario can run;
|
|
1282
|
+
* consumers should surface the warning alongside the resolved value.
|
|
1283
|
+
*/
|
|
1284
|
+
warning?: ComparisonResolverWarning;
|
|
1265
1285
|
}
|
|
1266
1286
|
/** A scenario input that has been checked against both "left" and "right" model. */
|
|
1267
|
-
interface ComparisonScenarioInput {
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1287
|
+
export interface ComparisonScenarioInput {
|
|
1288
|
+
/** The requested name of the input. */
|
|
1289
|
+
requestedName: string;
|
|
1290
|
+
/** The resolved state of the input for the "left" model. */
|
|
1291
|
+
stateL: ComparisonScenarioInputState;
|
|
1292
|
+
/** The resolved state of the input for the "right" model. */
|
|
1293
|
+
stateR: ComparisonScenarioInputState;
|
|
1274
1294
|
}
|
|
1275
1295
|
/** A configuration that sets model inputs to specific values. */
|
|
1276
|
-
interface ComparisonScenarioInputSettings {
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1296
|
+
export interface ComparisonScenarioInputSettings {
|
|
1297
|
+
kind: 'input-settings';
|
|
1298
|
+
/** The resolutions for the specified inputs in the scenario. */
|
|
1299
|
+
inputs: ComparisonScenarioInput[];
|
|
1300
|
+
/**
|
|
1301
|
+
* Whether the settings differ between the "left" and "right" models. This is
|
|
1302
|
+
* typically only used in the case of a scenario based on model-specific setting
|
|
1303
|
+
* groups, where the set of inputs or the input values differ between the two models.
|
|
1304
|
+
*/
|
|
1305
|
+
settingsDiffer?: boolean;
|
|
1286
1306
|
}
|
|
1287
1307
|
/** A configuration that sets all inputs in the model to a certain position. */
|
|
1288
|
-
interface ComparisonScenarioAllInputsSettings {
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1308
|
+
export interface ComparisonScenarioAllInputsSettings {
|
|
1309
|
+
kind: 'all-inputs-settings';
|
|
1310
|
+
/** The input position that will be applied to all available inputs. */
|
|
1311
|
+
position: InputPosition;
|
|
1292
1312
|
}
|
|
1293
1313
|
/**
|
|
1294
1314
|
* The configuration for an input scenario, either a set of individual input settings, or one
|
|
1295
1315
|
* that sets all inputs in the model to a certain position.
|
|
1296
1316
|
*/
|
|
1297
|
-
type ComparisonScenarioSettings = ComparisonScenarioInputSettings | ComparisonScenarioAllInputsSettings;
|
|
1317
|
+
export type ComparisonScenarioSettings = ComparisonScenarioInputSettings | ComparisonScenarioAllInputsSettings;
|
|
1298
1318
|
/** A single resolved input scenario. */
|
|
1299
|
-
interface ComparisonScenario {
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1319
|
+
export interface ComparisonScenario {
|
|
1320
|
+
kind: 'scenario';
|
|
1321
|
+
/** The unique key for the scenario, generated internally for use by the library. */
|
|
1322
|
+
key: ComparisonScenarioKey;
|
|
1323
|
+
/** The unique user-defined identifier for the scenario. */
|
|
1324
|
+
id?: ComparisonScenarioId;
|
|
1325
|
+
/** The scenario title. */
|
|
1326
|
+
title: string;
|
|
1327
|
+
/** The scenario subtitle. */
|
|
1328
|
+
subtitle?: string;
|
|
1329
|
+
/** The resolved settings for the model inputs in this scenario. */
|
|
1330
|
+
settings: ComparisonScenarioSettings;
|
|
1331
|
+
/** The input scenario used to configure the "left" model, or undefined if data not available. */
|
|
1332
|
+
specL?: ScenarioSpec;
|
|
1333
|
+
/** The input scenario used to configure the "right" model, or undefined if data not available. */
|
|
1334
|
+
specR?: ScenarioSpec;
|
|
1315
1335
|
}
|
|
1316
1336
|
/** An unresolved input scenario reference. */
|
|
1317
|
-
interface ComparisonUnresolvedScenarioRef {
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1337
|
+
export interface ComparisonUnresolvedScenarioRef {
|
|
1338
|
+
kind: 'unresolved-scenario-ref';
|
|
1339
|
+
/** The ID of the referenced scenario that could not be resolved. */
|
|
1340
|
+
scenarioId: ComparisonScenarioId;
|
|
1321
1341
|
}
|
|
1322
1342
|
/** A resolved group of input scenarios. */
|
|
1323
|
-
interface ComparisonScenarioGroup {
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1343
|
+
export interface ComparisonScenarioGroup {
|
|
1344
|
+
kind: 'scenario-group';
|
|
1345
|
+
/** The unique identifier for the group. */
|
|
1346
|
+
id?: ComparisonScenarioGroupId;
|
|
1347
|
+
/** The title of the group. */
|
|
1348
|
+
title: ComparisonScenarioGroupTitle;
|
|
1349
|
+
/**
|
|
1350
|
+
* The scenarios that are included in this group. This includes scenarios that were successfully
|
|
1351
|
+
* resolved as well as scenario references that could not be resolved.
|
|
1352
|
+
*/
|
|
1353
|
+
scenarios: (ComparisonScenario | ComparisonUnresolvedScenarioRef)[];
|
|
1334
1354
|
}
|
|
1335
1355
|
/** An unresolved scenario group reference. */
|
|
1336
|
-
interface ComparisonUnresolvedScenarioGroupRef {
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1356
|
+
export interface ComparisonUnresolvedScenarioGroupRef {
|
|
1357
|
+
kind: 'unresolved-scenario-group-ref';
|
|
1358
|
+
/** The ID of the referenced scenario group that could not be resolved. */
|
|
1359
|
+
scenarioGroupId: ComparisonScenarioGroupId;
|
|
1340
1360
|
}
|
|
1341
1361
|
/** A resolved group of graphs. */
|
|
1342
|
-
interface ComparisonGraphGroup {
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1362
|
+
export interface ComparisonGraphGroup {
|
|
1363
|
+
kind: 'graph-group';
|
|
1364
|
+
/** The unique identifier for the group. */
|
|
1365
|
+
id: ComparisonScenarioGroupId;
|
|
1366
|
+
/** The graphs that are included in this group. */
|
|
1367
|
+
graphIds: ComparisonGraphId[];
|
|
1348
1368
|
}
|
|
1349
1369
|
/**
|
|
1350
1370
|
* A resolved comparison box to be shown in a view.
|
|
1351
1371
|
*/
|
|
1352
|
-
interface ComparisonViewBox {
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1372
|
+
export interface ComparisonViewBox {
|
|
1373
|
+
kind: 'view-box';
|
|
1374
|
+
/** The title of the box. */
|
|
1375
|
+
title: ComparisonViewItemTitle;
|
|
1376
|
+
/** The subtitle of the box. */
|
|
1377
|
+
subtitle?: ComparisonViewItemSubtitle;
|
|
1378
|
+
/** The resolved dataset shown in this comparison box. */
|
|
1379
|
+
dataset: ComparisonDataset;
|
|
1380
|
+
/** The resolved scenario shown in this comparison box. */
|
|
1381
|
+
scenario: ComparisonScenario;
|
|
1362
1382
|
}
|
|
1363
1383
|
/**
|
|
1364
1384
|
* A resolved row of comparison boxes to be shown in a view.
|
|
1365
1385
|
*/
|
|
1366
|
-
interface ComparisonViewRow {
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1386
|
+
export interface ComparisonViewRow {
|
|
1387
|
+
kind: 'view-row';
|
|
1388
|
+
/** The title of the row. */
|
|
1389
|
+
title: ComparisonViewRowTitle;
|
|
1390
|
+
/** The subtitle of the row. */
|
|
1391
|
+
subtitle?: ComparisonViewRowSubtitle;
|
|
1392
|
+
/** The array of resolved boxes to be shown in the row. */
|
|
1393
|
+
boxes: ComparisonViewBox[];
|
|
1374
1394
|
}
|
|
1375
1395
|
/**
|
|
1376
1396
|
* A resolved view definition. A view presents a set of graphs, either for a single input scenario
|
|
1377
1397
|
* or for a mix of different dataset/scenario combinations.
|
|
1378
1398
|
*/
|
|
1379
|
-
interface ComparisonView {
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1399
|
+
export interface ComparisonView {
|
|
1400
|
+
kind: 'view';
|
|
1401
|
+
/** The title of the view. */
|
|
1402
|
+
title: ComparisonViewTitle;
|
|
1403
|
+
/** The subtitle of the view. */
|
|
1404
|
+
subtitle?: ComparisonViewSubtitle;
|
|
1405
|
+
/** The resolved scenario to be shown in the view if this is a single-scenario view. */
|
|
1406
|
+
scenario?: ComparisonScenario;
|
|
1407
|
+
/** The array of resolved rows to be shown in the view if this is a freeform view. */
|
|
1408
|
+
rows?: ComparisonViewRow[];
|
|
1409
|
+
/** The graphs to be shown for each scenario view. */
|
|
1410
|
+
graphIds: ComparisonGraphId[];
|
|
1411
|
+
/** The order in which the graphs will be displayed. */
|
|
1412
|
+
graphOrder: ComparisonViewGraphOrder;
|
|
1393
1413
|
}
|
|
1394
1414
|
/** An unresolved view. */
|
|
1395
|
-
interface ComparisonUnresolvedView {
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1415
|
+
export interface ComparisonUnresolvedView {
|
|
1416
|
+
kind: 'unresolved-view';
|
|
1417
|
+
/** The requested title of the view, if provided. */
|
|
1418
|
+
title?: ComparisonViewTitle;
|
|
1419
|
+
/** The requested subtitle of the view, if provided. */
|
|
1420
|
+
subtitle?: ComparisonViewSubtitle;
|
|
1421
|
+
/** The name of the referenced dataset that could not be resolved. */
|
|
1422
|
+
datasetName?: ComparisonDatasetName;
|
|
1423
|
+
/** The source of the referenced dataset that could not be resolved. */
|
|
1424
|
+
datasetSource?: ComparisonDatasetSource;
|
|
1425
|
+
/** The ID of the referenced scenario that could not be resolved. */
|
|
1426
|
+
scenarioId?: ComparisonScenarioId;
|
|
1427
|
+
/** The ID of the referenced scenario group that could not be resolved. */
|
|
1428
|
+
scenarioGroupId?: ComparisonScenarioGroupId;
|
|
1409
1429
|
}
|
|
1410
1430
|
/** A resolved group of compared scenario/graph views. */
|
|
1411
|
-
interface ComparisonViewGroup {
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1431
|
+
export interface ComparisonViewGroup {
|
|
1432
|
+
kind: 'view-group';
|
|
1433
|
+
/** The title of the group of views. */
|
|
1434
|
+
title: ComparisonViewGroupTitle;
|
|
1435
|
+
/** The array of resolved (and unresolved) views that are included in this group. */
|
|
1436
|
+
views: (ComparisonView | ComparisonUnresolvedView)[];
|
|
1417
1437
|
}
|
|
1418
|
-
|
|
1438
|
+
//#endregion
|
|
1439
|
+
//#region src/perf/perf-stats.d.ts
|
|
1419
1440
|
/**
|
|
1420
1441
|
* A summary of timing samples collected during a performance run.
|
|
1421
1442
|
*/
|
|
1422
1443
|
interface PerfReport {
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1444
|
+
/** Minimum sample time, in milliseconds. */
|
|
1445
|
+
readonly minTime: number;
|
|
1446
|
+
/** Maximum sample time, in milliseconds. */
|
|
1447
|
+
readonly maxTime: number;
|
|
1448
|
+
/**
|
|
1449
|
+
* Trimmed mean (interquartile mean) computed from the middle 50% of samples,
|
|
1450
|
+
* in milliseconds. This is more robust against outliers than a simple mean.
|
|
1451
|
+
*/
|
|
1452
|
+
readonly avgTime: number;
|
|
1453
|
+
/** Median (50th percentile) sample time, in milliseconds. */
|
|
1454
|
+
readonly medianTime: number;
|
|
1455
|
+
/** 95th percentile sample time, in milliseconds. */
|
|
1456
|
+
readonly p95Time: number;
|
|
1457
|
+
/** Population standard deviation across all samples, in milliseconds. */
|
|
1458
|
+
readonly stdDev: number;
|
|
1459
|
+
/** All recorded sample times, sorted ascending, in milliseconds. */
|
|
1460
|
+
readonly allTimes: number[];
|
|
1440
1461
|
}
|
|
1441
1462
|
/**
|
|
1442
1463
|
* Collect performance timing samples and produce a robust statistical summary.
|
|
1443
1464
|
*/
|
|
1444
|
-
declare class PerfStats {
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1465
|
+
export declare class PerfStats {
|
|
1466
|
+
private readonly times;
|
|
1467
|
+
/**
|
|
1468
|
+
* Record a single run time sample.
|
|
1469
|
+
*
|
|
1470
|
+
* @param timeInMillis The run time in milliseconds.
|
|
1471
|
+
*/
|
|
1472
|
+
addRun(timeInMillis: number): void;
|
|
1473
|
+
/**
|
|
1474
|
+
* Get the raw run time samples that have been recorded.
|
|
1475
|
+
*
|
|
1476
|
+
* @returns A copy of the recorded run times, in insertion order.
|
|
1477
|
+
*/
|
|
1478
|
+
getTimes(): number[];
|
|
1479
|
+
/**
|
|
1480
|
+
* Produce a `PerfReport` summarizing the recorded samples.
|
|
1481
|
+
*
|
|
1482
|
+
* @returns The summary report.
|
|
1483
|
+
*/
|
|
1484
|
+
toReport(): PerfReport;
|
|
1485
|
+
}
|
|
1486
|
+
//#endregion
|
|
1487
|
+
//#region src/comparison/diff-datasets/diff-datasets.d.ts
|
|
1488
|
+
export interface DiffPoint {
|
|
1489
|
+
time: number;
|
|
1490
|
+
valueL: number;
|
|
1491
|
+
valueR: number;
|
|
1492
|
+
}
|
|
1493
|
+
export type DiffValidity = 'neither' | 'left-only' | 'right-only' | 'both';
|
|
1494
|
+
export interface DiffReport {
|
|
1495
|
+
validity: DiffValidity;
|
|
1496
|
+
minValue: number;
|
|
1497
|
+
maxValue: number;
|
|
1498
|
+
avgDiff: number;
|
|
1499
|
+
minDiff: number;
|
|
1500
|
+
maxDiff: number;
|
|
1501
|
+
maxDiffPoint: DiffPoint;
|
|
1502
|
+
}
|
|
1503
|
+
export declare function diffDatasets(datasetL: Dataset | undefined, datasetR: Dataset | undefined): DiffReport;
|
|
1504
|
+
//#endregion
|
|
1505
|
+
//#region src/comparison/report/comparison-report-types.d.ts
|
|
1483
1506
|
/**
|
|
1484
1507
|
* The report for a single comparison test (involving a dataset produced under
|
|
1485
1508
|
* a specific input scenario). This includes the full `DiffReport`, whereas
|
|
1486
1509
|
* a `ComparisonTestSummary` only includes the `maxDiff` value.
|
|
1487
1510
|
*/
|
|
1488
|
-
interface ComparisonTestReport {
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1511
|
+
export interface ComparisonTestReport {
|
|
1512
|
+
/** The key of the scenario that was compared. */
|
|
1513
|
+
scenarioKey: ComparisonScenarioKey;
|
|
1514
|
+
/** The key of the dataset that was compared. */
|
|
1515
|
+
datasetKey: DatasetKey;
|
|
1516
|
+
/** The diff report for the comparison, or undefined if the test was skipped. */
|
|
1517
|
+
diffReport?: DiffReport;
|
|
1518
|
+
/**
|
|
1519
|
+
* The diff report for the baseline scenario (all inputs at default), or undefined if this
|
|
1520
|
+
* report is for the baseline scenario itself.
|
|
1521
|
+
*/
|
|
1522
|
+
baselineDiffReport?: DiffReport;
|
|
1500
1523
|
}
|
|
1501
1524
|
/**
|
|
1502
1525
|
* A simplified/terse version of `ComparisonTestReport` that is used when writing
|
|
@@ -1504,30 +1527,30 @@ interface ComparisonTestReport {
|
|
|
1504
1527
|
* minimum set of fields (only the `maxDiff` value instead of the full `DiffReport`)
|
|
1505
1528
|
* to keep the file smaller when there are many reported differences.
|
|
1506
1529
|
*/
|
|
1507
|
-
interface ComparisonTestSummary {
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1530
|
+
export interface ComparisonTestSummary {
|
|
1531
|
+
/** Short for `scenarioKey`. */
|
|
1532
|
+
s: ComparisonScenarioKey;
|
|
1533
|
+
/** Short for `datasetKey`. */
|
|
1534
|
+
d: DatasetKey;
|
|
1535
|
+
/** Short for `maxDiff`. */
|
|
1536
|
+
md?: number;
|
|
1537
|
+
/** Short for `avgDiff`. */
|
|
1538
|
+
ad?: number;
|
|
1539
|
+
/** Short for `maxDiff` relative to baseline `maxDiff`. */
|
|
1540
|
+
mdb?: number;
|
|
1541
|
+
/** Short for `avgDiff` relative to baseline `avgDiff`. */
|
|
1542
|
+
adb?: number;
|
|
1520
1543
|
}
|
|
1521
1544
|
/**
|
|
1522
1545
|
* The roll-up report that contains the results of all individual comparison tests.
|
|
1523
1546
|
*/
|
|
1524
|
-
interface ComparisonReport {
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1547
|
+
export interface ComparisonReport {
|
|
1548
|
+
/** The set of all comparison test reports. */
|
|
1549
|
+
testReports: ComparisonTestReport[];
|
|
1550
|
+
/** The perf report for the "left" model. */
|
|
1551
|
+
perfReportL: PerfReport;
|
|
1552
|
+
/** The perf report for the "right" model. */
|
|
1553
|
+
perfReportR: PerfReport;
|
|
1531
1554
|
}
|
|
1532
1555
|
/**
|
|
1533
1556
|
* A simplified/terse version of `ComparisonReport` that only includes the minimum set
|
|
@@ -1535,417 +1558,423 @@ interface ComparisonReport {
|
|
|
1535
1558
|
* reported differences). This only includes comparison results for which there is
|
|
1536
1559
|
* a non-zero `maxDiff` value.
|
|
1537
1560
|
*/
|
|
1538
|
-
interface ComparisonSummary {
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1561
|
+
export interface ComparisonSummary {
|
|
1562
|
+
/** The simplified set of all terse comparison test summaries. */
|
|
1563
|
+
testSummaries: ComparisonTestSummary[];
|
|
1564
|
+
/** The perf report for the "left" model. */
|
|
1565
|
+
perfReportL: PerfReport;
|
|
1566
|
+
/** The perf report for the "right" model. */
|
|
1567
|
+
perfReportR: PerfReport;
|
|
1545
1568
|
}
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
type
|
|
1569
|
+
//#endregion
|
|
1570
|
+
//#region src/comparison/report/comparison-group-types.d.ts
|
|
1571
|
+
export type ComparisonGroupKind = 'by-dataset' | 'by-scenario';
|
|
1572
|
+
export type ComparisonGroupKey = string;
|
|
1549
1573
|
/**
|
|
1550
1574
|
* A group of comparison test summaries associated with a particular scenario or dataset.
|
|
1551
1575
|
*/
|
|
1552
|
-
interface ComparisonGroup {
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1576
|
+
export interface ComparisonGroup {
|
|
1577
|
+
/** The kind of group, either 'by-dataset' or 'by-scenario'. */
|
|
1578
|
+
kind: ComparisonGroupKind;
|
|
1579
|
+
/**
|
|
1580
|
+
* The unique key for this group (a `DatasetKey` if grouped by dataset, or a
|
|
1581
|
+
* `ComparisonScenarioKey` if grouped by scenario).
|
|
1582
|
+
*/
|
|
1583
|
+
key: ComparisonGroupKey;
|
|
1584
|
+
/** The comparison test summaries for this group. */
|
|
1585
|
+
testSummaries: ComparisonTestSummary[];
|
|
1562
1586
|
}
|
|
1563
1587
|
/** Describes the "root" or primary item for a group of comparisons. */
|
|
1564
|
-
type ComparisonGroupRoot = ComparisonDataset | ComparisonScenario;
|
|
1588
|
+
export type ComparisonGroupRoot = ComparisonDataset | ComparisonScenario;
|
|
1565
1589
|
/** A summary of scores for a group of comparisons. */
|
|
1566
|
-
interface ComparisonGroupScores {
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1590
|
+
export interface ComparisonGroupScores {
|
|
1591
|
+
/** The total number of comparisons (sample size) for this group. */
|
|
1592
|
+
totalDiffCount: number;
|
|
1593
|
+
/** The sum of the diff values for the active sort mode (e.g., `maxDiff`, `avgDiff`) for each threshold bucket. */
|
|
1594
|
+
totalDiffByBucket: number[];
|
|
1595
|
+
/** The number of comparisons that fall into each threshold bucket. */
|
|
1596
|
+
diffCountByBucket: number[];
|
|
1597
|
+
/** The percentage of comparisons that fall into each threshold bucket. */
|
|
1598
|
+
diffPercentByBucket: number[];
|
|
1575
1599
|
}
|
|
1576
1600
|
/**
|
|
1577
1601
|
* A summary of a group of comparisons that includes the resolved scenario/dataset metadata
|
|
1578
1602
|
* and score information for the group.
|
|
1579
1603
|
*/
|
|
1580
|
-
interface ComparisonGroupSummary {
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1604
|
+
export interface ComparisonGroupSummary {
|
|
1605
|
+
/** The metadata for the "root" or primary item for this group of comparisons. */
|
|
1606
|
+
root: ComparisonGroupRoot;
|
|
1607
|
+
/** The group containing the comparison summaries. */
|
|
1608
|
+
group: ComparisonGroup;
|
|
1609
|
+
/** The scores for this group, or undefined if comparisons were not performed for this group. */
|
|
1610
|
+
scores?: ComparisonGroupScores;
|
|
1587
1611
|
}
|
|
1588
1612
|
/**
|
|
1589
1613
|
* Breaks down a set of by-scenario or by-dataset groupings into distinct categories.
|
|
1590
1614
|
*/
|
|
1591
|
-
interface ComparisonGroupSummariesByCategory {
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1615
|
+
export interface ComparisonGroupSummariesByCategory {
|
|
1616
|
+
/**
|
|
1617
|
+
* All groups in a map, keyed by "group key" (either a dataset key or scenario key).
|
|
1618
|
+
*/
|
|
1619
|
+
allGroupSummaries: Map<ComparisonGroupKey, ComparisonGroupSummary>;
|
|
1620
|
+
/**
|
|
1621
|
+
* Groups with items that have errors (are not valid) for both "left" and "right" models.
|
|
1622
|
+
*/
|
|
1623
|
+
withErrors: ComparisonGroupSummary[];
|
|
1624
|
+
/**
|
|
1625
|
+
* Groups with items that are only valid for the "left" model (for example, datasets that
|
|
1626
|
+
* were removed and no longer available in the "right" model).
|
|
1627
|
+
*/
|
|
1628
|
+
onlyInLeft: ComparisonGroupSummary[];
|
|
1629
|
+
/**
|
|
1630
|
+
* Groups with items that are only valid for the "right" model (for example, scenarios
|
|
1631
|
+
* for inputs that were added in the "right" model).
|
|
1632
|
+
*/
|
|
1633
|
+
onlyInRight: ComparisonGroupSummary[];
|
|
1634
|
+
/**
|
|
1635
|
+
* Groups with one or more comparisons that have non-zero diff scores; the groups
|
|
1636
|
+
* will be sorted by the diff score according to the active sort mode, with higher
|
|
1637
|
+
* scores at the front of the array.
|
|
1638
|
+
*/
|
|
1639
|
+
withDiffs: ComparisonGroupSummary[];
|
|
1640
|
+
/**
|
|
1641
|
+
* Groups where all comparisons have diff scores of zero (no differences between
|
|
1642
|
+
* "left" and "right").
|
|
1643
|
+
*/
|
|
1644
|
+
withoutDiffs: ComparisonGroupSummary[];
|
|
1621
1645
|
}
|
|
1622
1646
|
/**
|
|
1623
1647
|
* Rolls up all by-scenario and by-dataset groupings.
|
|
1624
1648
|
*/
|
|
1625
|
-
interface ComparisonCategorizedResults {
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1649
|
+
export interface ComparisonCategorizedResults {
|
|
1650
|
+
/** All summaries for the comparison tests that were performed. */
|
|
1651
|
+
allTestSummaries: ComparisonTestSummary[];
|
|
1652
|
+
/** The full set of by-scenario groupings. */
|
|
1653
|
+
byScenario: ComparisonGroupSummariesByCategory;
|
|
1654
|
+
/** The full set of by-dataset groupings. */
|
|
1655
|
+
byDataset: ComparisonGroupSummariesByCategory;
|
|
1632
1656
|
}
|
|
1633
|
-
|
|
1657
|
+
//#endregion
|
|
1658
|
+
//#region src/comparison/config/comparison-datasets.d.ts
|
|
1634
1659
|
/**
|
|
1635
1660
|
* Provides access to the set of dataset definitions (`ComparisonDataset` instances) that are used
|
|
1636
1661
|
* when comparing the two models.
|
|
1637
1662
|
*/
|
|
1638
1663
|
interface ComparisonDatasets {
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
}
|
|
1671
|
-
|
|
1664
|
+
/**
|
|
1665
|
+
* Return all `ComparisonDataset` instances that are available for comparisons.
|
|
1666
|
+
*/
|
|
1667
|
+
getAllDatasets(): IterableIterator<ComparisonDataset>;
|
|
1668
|
+
/**
|
|
1669
|
+
* Return the dataset metadata for the given key.
|
|
1670
|
+
*
|
|
1671
|
+
* @param datasetKey The key for the dataset.
|
|
1672
|
+
*/
|
|
1673
|
+
getDataset(datasetKey: DatasetKey): ComparisonDataset | undefined;
|
|
1674
|
+
/**
|
|
1675
|
+
* Return the keys for the datasets that should be compared for the given scenario.
|
|
1676
|
+
*
|
|
1677
|
+
* @param scenario The scenario definition.
|
|
1678
|
+
*/
|
|
1679
|
+
getDatasetKeysForScenario(scenario: ComparisonScenario): DatasetKey[];
|
|
1680
|
+
/**
|
|
1681
|
+
* Return the reference plots that should be shown in the comparison graph for the
|
|
1682
|
+
* given dataset and scenario.
|
|
1683
|
+
*
|
|
1684
|
+
* @param datasetKey The key for the dataset.
|
|
1685
|
+
* @param scenario The scenario for which the dataset will be displayed.
|
|
1686
|
+
*/
|
|
1687
|
+
getReferencePlotsForDataset(datasetKey: DatasetKey, scenario: ComparisonScenario): ComparisonPlot[];
|
|
1688
|
+
/**
|
|
1689
|
+
* Return the context graph IDs that should be shown for the given dataset and scenario.
|
|
1690
|
+
*
|
|
1691
|
+
* @param datasetKey The key for the dataset.
|
|
1692
|
+
* @param scenario The scenario for which the dataset will be displayed.
|
|
1693
|
+
*/
|
|
1694
|
+
getContextGraphIdsForDataset(datasetKey: DatasetKey, scenario: ComparisonScenario): BundleGraphId[];
|
|
1695
|
+
}
|
|
1696
|
+
//#endregion
|
|
1697
|
+
//#region src/comparison/config/comparison-scenarios.d.ts
|
|
1672
1698
|
interface ComparisonScenarios {
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1699
|
+
/**
|
|
1700
|
+
* Return all `ComparisonScenario` instances that are available for comparisons.
|
|
1701
|
+
*/
|
|
1702
|
+
getAllScenarios(): IterableIterator<ComparisonScenario>;
|
|
1703
|
+
/**
|
|
1704
|
+
* Return the scenario definition for the given key.
|
|
1705
|
+
*
|
|
1706
|
+
* @param key The key for the scenario.
|
|
1707
|
+
*/
|
|
1708
|
+
getScenario(key: ComparisonScenarioKey): ComparisonScenario | undefined;
|
|
1709
|
+
}
|
|
1710
|
+
//#endregion
|
|
1711
|
+
//#region src/comparison/config/comparison-config.d.ts
|
|
1685
1712
|
/**
|
|
1686
1713
|
* Describes an extra plot to be shown in a comparison graph.
|
|
1687
1714
|
*/
|
|
1688
1715
|
interface ComparisonPlot {
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1716
|
+
/** The dataset key for the plot. */
|
|
1717
|
+
datasetKey: DatasetKey;
|
|
1718
|
+
/** The plot color. */
|
|
1719
|
+
color: string;
|
|
1720
|
+
/** The plot style. If undefined, defaults to 'normal'. */
|
|
1721
|
+
style?: 'normal' | 'dashed';
|
|
1722
|
+
/** The plot line width, in px units. If undefined, a default width will be used. */
|
|
1723
|
+
lineWidth?: number;
|
|
1697
1724
|
}
|
|
1698
1725
|
interface ComparisonDatasetOptions {
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
+
/**
|
|
1727
|
+
* The mapping of renamed dataset keys (old or "left" name as the map key,
|
|
1728
|
+
* new or "right" name as the value).
|
|
1729
|
+
*/
|
|
1730
|
+
renamedDatasetKeys?: Map<DatasetKey, DatasetKey>;
|
|
1731
|
+
/**
|
|
1732
|
+
* An optional function that allows for limiting the datasets that are compared
|
|
1733
|
+
* for a given scenario. By default, all datasets are compared for a given
|
|
1734
|
+
* scenario, but if a custom function is provided, it can return a subset of
|
|
1735
|
+
* datasets (for example, to omit datasets that are not relevant).
|
|
1736
|
+
*/
|
|
1737
|
+
datasetKeysForScenario?: (allDatasetKeys: DatasetKey[], scenario: ComparisonScenario) => DatasetKey[];
|
|
1738
|
+
/**
|
|
1739
|
+
* An optional function that allows for including additional reference plots
|
|
1740
|
+
* on a comparison graph for a given dataset and scenario. By default, no
|
|
1741
|
+
* additional reference plots are included, but if a custom function is
|
|
1742
|
+
* provided, it can return an array of `ComparisonPlot` objects.
|
|
1743
|
+
*/
|
|
1744
|
+
referencePlotsForDataset?: (dataset: ComparisonDataset, scenario: ComparisonScenario) => ComparisonPlot[];
|
|
1745
|
+
/**
|
|
1746
|
+
* An optional function that allows for customizing the set of context graphs
|
|
1747
|
+
* that are shown for a given dataset and scenario. By default, all graphs in
|
|
1748
|
+
* which the dataset appears will be shown, but if a custom function is provided,
|
|
1749
|
+
* it can return a different set of graphs (for example, to omit graphs that are
|
|
1750
|
+
* not relevant under the given scenario).
|
|
1751
|
+
*/
|
|
1752
|
+
contextGraphIdsForDataset?: (dataset: ComparisonDataset, scenario: ComparisonScenario) => BundleGraphId[];
|
|
1726
1753
|
}
|
|
1727
1754
|
/**
|
|
1728
1755
|
* Describes a row in the comparison report summary view.
|
|
1729
1756
|
*/
|
|
1730
1757
|
interface ComparisonReportSummaryRow {
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1758
|
+
/** The group summary represented by the row. */
|
|
1759
|
+
groupSummary: ComparisonGroupSummary;
|
|
1760
|
+
/** The custom title for the row (this overrides the default title derived from the summary). */
|
|
1761
|
+
title?: string;
|
|
1762
|
+
/** The custom subtitle for the row (this overrides the default subtitle derived from the summary). */
|
|
1763
|
+
subtitle?: string;
|
|
1737
1764
|
}
|
|
1738
1765
|
/**
|
|
1739
1766
|
* Describes a section in the comparison report summary view.
|
|
1740
1767
|
*/
|
|
1741
1768
|
interface ComparisonReportSummarySection {
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1769
|
+
/** The text to display for the section header. */
|
|
1770
|
+
headerText: string;
|
|
1771
|
+
/** The summary rows to display in the section. */
|
|
1772
|
+
rows: ComparisonReportSummaryRow[];
|
|
1773
|
+
/**
|
|
1774
|
+
* The initial expanded state of the section. If undefined, defaults to 'expanded-if-diffs',
|
|
1775
|
+
* meaning the section will be initially expanded only if any rows have differences, otherwise
|
|
1776
|
+
* it will be initially collapsed.
|
|
1777
|
+
*/
|
|
1778
|
+
initialState?: 'collapsed' | 'expanded' | 'expanded-if-diffs';
|
|
1779
|
+
/**
|
|
1780
|
+
* Whether the items in the section are stable, i.e., not changing from run to run. If
|
|
1781
|
+
* undefined, defaults to false. This can be used to group items in the filter panel.
|
|
1782
|
+
* Set it to true if the group contains a stable set of rows where the order does not
|
|
1783
|
+
* change between runs. Set it to false (or leave it undefined) if the group contains
|
|
1784
|
+
* rows that have a different order between runs (for example, "Scenarios producing
|
|
1785
|
+
* differences").
|
|
1786
|
+
*/
|
|
1787
|
+
stable?: boolean;
|
|
1761
1788
|
}
|
|
1762
1789
|
/**
|
|
1763
1790
|
* Describes an item (box) in the comparison report detail view.
|
|
1764
1791
|
*/
|
|
1765
1792
|
interface ComparisonReportDetailItem {
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1793
|
+
/** The title of the item. */
|
|
1794
|
+
title: string;
|
|
1795
|
+
/** The subtitle of the item (if any). */
|
|
1796
|
+
subtitle?: string;
|
|
1797
|
+
/** The scenario for the item. */
|
|
1798
|
+
scenario: ComparisonScenario;
|
|
1799
|
+
/** The test summary for the item. */
|
|
1800
|
+
testSummary: ComparisonTestSummary;
|
|
1774
1801
|
}
|
|
1775
1802
|
/**
|
|
1776
1803
|
* Describes a row in the comparison report detail view.
|
|
1777
1804
|
*/
|
|
1778
1805
|
interface ComparisonReportDetailRow {
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1806
|
+
/** The title of the row. */
|
|
1807
|
+
title: string;
|
|
1808
|
+
/** The subtitle of the row (if any). */
|
|
1809
|
+
subtitle?: string;
|
|
1810
|
+
/** The score for the row (the meaning of the value depends on the chosen statistical method). */
|
|
1811
|
+
score: number;
|
|
1812
|
+
/** The items in this row (one item per box). */
|
|
1813
|
+
items: ComparisonReportDetailItem[];
|
|
1787
1814
|
}
|
|
1788
1815
|
interface ComparisonReportOptions {
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1816
|
+
/**
|
|
1817
|
+
* An optional function that allows for customizing the order and grouping of
|
|
1818
|
+
* sections and rows in the "comparisons by scenario" summary view.
|
|
1819
|
+
*
|
|
1820
|
+
* @param summaries The comparison summaries, one summary per scenario.
|
|
1821
|
+
* @returns The sections to display in the "comparisons by scenario" summary view.
|
|
1822
|
+
*/
|
|
1823
|
+
summarySectionsForComparisonsByScenario?: (summaries: ComparisonGroupSummariesByCategory) => ComparisonReportSummarySection[];
|
|
1824
|
+
/**
|
|
1825
|
+
* An optional function that allows for customizing the order and grouping of
|
|
1826
|
+
* sections and rows in the "comparisons by dataset" summary view.
|
|
1827
|
+
*
|
|
1828
|
+
* @param summaries The comparison summaries, one summary per dataset.
|
|
1829
|
+
* @returns The sections to display in the "comparisons by dataset" summary view.
|
|
1830
|
+
*/
|
|
1831
|
+
summarySectionsForComparisonsByDataset?: (summaries: ComparisonGroupSummariesByCategory) => ComparisonReportSummarySection[];
|
|
1832
|
+
/**
|
|
1833
|
+
* An optional function that allows for customizing the order of rows and boxes
|
|
1834
|
+
* in the detail view for a scenario.
|
|
1835
|
+
*
|
|
1836
|
+
* @param rows The original rows to be displayed in the detail view for a scenario.
|
|
1837
|
+
* @returns The customized rows to display in the detail view for a scenario.
|
|
1838
|
+
*/
|
|
1839
|
+
detailRowsForScenario?: (rows: ComparisonReportDetailRow[]) => ComparisonReportDetailRow[];
|
|
1840
|
+
/**
|
|
1841
|
+
* An optional function that allows for customizing the order of rows and boxes
|
|
1842
|
+
* in the detail view for a dataset.
|
|
1843
|
+
*
|
|
1844
|
+
* @param rows The original rows to be displayed in the detail view for a dataset.
|
|
1845
|
+
* @returns The customized rows to display in the detail view for a dataset.
|
|
1846
|
+
*/
|
|
1847
|
+
detailRowsForDataset?: (rows: ComparisonReportDetailRow[]) => ComparisonReportDetailRow[];
|
|
1821
1848
|
}
|
|
1822
1849
|
interface ComparisonOptions {
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1850
|
+
/** The left-side ("baseline") bundle being compared. */
|
|
1851
|
+
baseline: NamedBundle;
|
|
1852
|
+
/**
|
|
1853
|
+
* The array of thresholds used to color differences. Defaults to [1, 5, 10]
|
|
1854
|
+
* which will use buckets of 0%, 0-1%, 1-5%, 5-10%, and >10%.
|
|
1855
|
+
*/
|
|
1856
|
+
thresholds?: number[];
|
|
1857
|
+
/**
|
|
1858
|
+
* The array of ratio thresholds used to color differences when relative sorting is
|
|
1859
|
+
* active. Defaults to [1, 2, 3] which will use buckets of 0, 0-1, 1-2, 2-3, and >3.
|
|
1860
|
+
*/
|
|
1861
|
+
ratioThresholds?: number[];
|
|
1862
|
+
/**
|
|
1863
|
+
* The requested comparison scenario and view specifications. These can be
|
|
1864
|
+
* specified in YAML or JSON files, or using `Spec` objects.
|
|
1865
|
+
*/
|
|
1866
|
+
specs: (ComparisonSpecs | ComparisonSpecsSource)[];
|
|
1867
|
+
/** Optional configuration for the datasets that are compared for different scenarios. */
|
|
1868
|
+
datasets?: ComparisonDatasetOptions;
|
|
1869
|
+
/** Options for customizing the comparison report. */
|
|
1870
|
+
report?: ComparisonReportOptions;
|
|
1844
1871
|
}
|
|
1845
1872
|
interface ComparisonConfig {
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
}
|
|
1869
|
-
|
|
1873
|
+
/** The loaded left-side ("baseline") bundle being compared. */
|
|
1874
|
+
bundleL: LoadedBundle;
|
|
1875
|
+
/** The loaded right-side ("current") bundle being compared. */
|
|
1876
|
+
bundleR: LoadedBundle;
|
|
1877
|
+
/**
|
|
1878
|
+
* The array of thresholds used to color differences. For example, [1, 5, 10] will use
|
|
1879
|
+
* buckets of 0%, 0-1%, 1-5%, 5-10%, and >10%.
|
|
1880
|
+
*/
|
|
1881
|
+
thresholds: number[];
|
|
1882
|
+
/**
|
|
1883
|
+
* The array of ratio thresholds used to color differences when relative sorting is
|
|
1884
|
+
* active. For example, [1, 2, 3] will use buckets of 0, 0-1, 1-2, 2-3, and >3.
|
|
1885
|
+
*/
|
|
1886
|
+
ratioThresholds: number[];
|
|
1887
|
+
/** The set of resolved scenarios that will be compared. */
|
|
1888
|
+
scenarios: ComparisonScenarios;
|
|
1889
|
+
/** The set of resolved datasets that will be compared. */
|
|
1890
|
+
datasets: ComparisonDatasets;
|
|
1891
|
+
/** The set of resolved view groups. */
|
|
1892
|
+
viewGroups: ComparisonViewGroup[];
|
|
1893
|
+
/** Options for customizing the comparison report. */
|
|
1894
|
+
reportOptions?: ComparisonReportOptions;
|
|
1895
|
+
}
|
|
1896
|
+
//#endregion
|
|
1897
|
+
//#region src/comparison/run/comparison-data-coordinator.d.ts
|
|
1870
1898
|
type ComparisonDataRequestKey = string;
|
|
1871
1899
|
/**
|
|
1872
1900
|
* Options for `requestDatasetMaps`.
|
|
1873
1901
|
*/
|
|
1874
1902
|
interface RequestDatasetMapsOptions {
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1903
|
+
/** Optional constant overrides for the "left" model. */
|
|
1904
|
+
constantsL?: ConstantOverride[];
|
|
1905
|
+
/** Optional constant overrides for the "right" model. */
|
|
1906
|
+
constantsR?: ConstantOverride[];
|
|
1907
|
+
/** Optional lookup overrides for the "left" model. */
|
|
1908
|
+
lookupsL?: LookupOverride[];
|
|
1909
|
+
/** Optional lookup overrides for the "right" model. */
|
|
1910
|
+
lookupsR?: LookupOverride[];
|
|
1883
1911
|
}
|
|
1884
1912
|
/**
|
|
1885
1913
|
* Coordinates loading of data in parallel from two models.
|
|
1886
1914
|
*/
|
|
1887
|
-
declare class ComparisonDataCoordinator {
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
}
|
|
1925
|
-
declare function createComparisonDataCoordinator(): ComparisonDataCoordinator;
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1915
|
+
export declare class ComparisonDataCoordinator {
|
|
1916
|
+
private readonly taskQueue;
|
|
1917
|
+
constructor(taskQueue: TaskQueue);
|
|
1918
|
+
/**
|
|
1919
|
+
* Request datasets from the two models.
|
|
1920
|
+
*
|
|
1921
|
+
* @param requestKey The unique key for the request.
|
|
1922
|
+
* @param sourceL The source of the first ("left") dataset. If "left", the datasets will
|
|
1923
|
+
* be fetched from the "left" bundle's model, otherwise they will be fetched from the
|
|
1924
|
+
* "right" bundle's model.
|
|
1925
|
+
* @param scenarioSpecL The scenario used for the first ("left") model of the comparison.
|
|
1926
|
+
* @param sourceR The source of the second ("right") dataset. If "left", the datasets
|
|
1927
|
+
* will be fetched from the "left" bundle's model, otherwise they will be fetched from
|
|
1928
|
+
* the "right" bundle's model.
|
|
1929
|
+
* @param scenarioSpecR The scenario used for the second ("right") model of the comparison.
|
|
1930
|
+
* @param datasetKeys The keys of the datasets to be fetched.
|
|
1931
|
+
* @param options Optional configuration including constant and lookup overrides.
|
|
1932
|
+
* @param onResponse The callback that will be called with the dataset maps.
|
|
1933
|
+
*/
|
|
1934
|
+
requestDatasetMaps(requestKey: ComparisonDataRequestKey, sourceL: 'left' | 'right', scenarioSpecL: ScenarioSpec, sourceR: 'left' | 'right', scenarioSpecR: ScenarioSpec, datasetKeys: DatasetKey[], options: RequestDatasetMapsOptions | undefined, onResponse: (datasetMapL?: DatasetMap, datasetMapR?: DatasetMap) => void): void;
|
|
1935
|
+
/**
|
|
1936
|
+
* Request graph data from the two models.
|
|
1937
|
+
*
|
|
1938
|
+
* @param requestKey The unique key for the request.
|
|
1939
|
+
* @param sourceL The source of the first ("left") dataset. If "left", the datasets will
|
|
1940
|
+
* be fetched from the "left" bundle's model, otherwise they will be fetched from the
|
|
1941
|
+
* "right" bundle's model.
|
|
1942
|
+
* @param scenarioSpecL The scenario used for the first ("left") model of the comparison.
|
|
1943
|
+
* @param sourceR The source of the second ("right") dataset. If "left", the datasets
|
|
1944
|
+
* will be fetched from the "left" bundle's model, otherwise they will be fetched from
|
|
1945
|
+
* the "right" bundle's model.
|
|
1946
|
+
* @param scenarioSpecR The scenario used for the second ("right") model of the comparison.
|
|
1947
|
+
* @param graphId The ID of the graph for which data will be fetched.
|
|
1948
|
+
* @param onResponse The callback that will be called with the graph data.
|
|
1949
|
+
*/
|
|
1950
|
+
requestGraphData(requestKey: ComparisonDataRequestKey, sourceL: 'left' | 'right', scenarioSpecL: ScenarioSpec, sourceR: 'left' | 'right', scenarioSpecR: ScenarioSpec, graphId: BundleGraphId, onResponse: (graphDataL?: BundleGraphData, graphDataR?: BundleGraphData) => void): void;
|
|
1951
|
+
cancelRequest(key: ComparisonDataRequestKey): void;
|
|
1952
|
+
}
|
|
1953
|
+
export declare function createComparisonDataCoordinator(): ComparisonDataCoordinator;
|
|
1954
|
+
//#endregion
|
|
1955
|
+
//#region src/comparison/diff-graphs/diff-graphs.d.ts
|
|
1956
|
+
export type GraphInclusion = 'neither' | 'left-only' | 'right-only' | 'both';
|
|
1957
|
+
export interface GraphComparisonMetadataReport {
|
|
1958
|
+
/** The key for the metadata field. */
|
|
1959
|
+
key: string;
|
|
1960
|
+
/** The value of the metadata field in the left bundle. */
|
|
1961
|
+
valueL?: string;
|
|
1962
|
+
/** The value of the metadata field in the right bundle. */
|
|
1963
|
+
valueR?: string;
|
|
1964
|
+
}
|
|
1965
|
+
export interface GraphComparisonDatasetReport {
|
|
1966
|
+
/** The dataset key. */
|
|
1967
|
+
datasetKey: DatasetKey;
|
|
1968
|
+
/** The max diff for this dataset. */
|
|
1969
|
+
maxDiff?: number;
|
|
1970
|
+
}
|
|
1971
|
+
export interface GraphComparisonReport {
|
|
1972
|
+
/** Indicates which bundles the graph is defined in. */
|
|
1973
|
+
inclusion: GraphInclusion;
|
|
1974
|
+
/** The metadata fields with differences. */
|
|
1975
|
+
metadataReports: GraphComparisonMetadataReport[];
|
|
1976
|
+
/** The datasets with differences. */
|
|
1977
|
+
datasetReports: GraphComparisonDatasetReport[];
|
|
1949
1978
|
}
|
|
1950
1979
|
/**
|
|
1951
1980
|
* Comparison the metadata and datasets for the given graphs.
|
|
@@ -1955,8 +1984,9 @@ interface GraphComparisonReport {
|
|
|
1955
1984
|
* @param scenarioKey The key of the scenario used for comparing datasets.
|
|
1956
1985
|
* @param testSummaries The set of test summaries from a previous comparison run.
|
|
1957
1986
|
*/
|
|
1958
|
-
declare function diffGraphs(graphL: BundleGraphSpec | undefined, graphR: BundleGraphSpec | undefined, scenarioKey: ComparisonScenarioKey, testSummaries: ComparisonTestSummary[]): GraphComparisonReport;
|
|
1959
|
-
|
|
1987
|
+
export declare function diffGraphs(graphL: BundleGraphSpec | undefined, graphR: BundleGraphSpec | undefined, scenarioKey: ComparisonScenarioKey, testSummaries: ComparisonTestSummary[]): GraphComparisonReport;
|
|
1988
|
+
//#endregion
|
|
1989
|
+
//#region src/comparison/report/comparison-reporting.d.ts
|
|
1960
1990
|
/**
|
|
1961
1991
|
* Convert a full `ComparisonReport` to a simplified `ComparisonSummary` that includes
|
|
1962
1992
|
* the minimum set of fields needed to keep the file smaller when there are many
|
|
@@ -1966,7 +1996,7 @@ declare function diffGraphs(graphL: BundleGraphSpec | undefined, graphR: BundleG
|
|
|
1966
1996
|
* @param comparisonReport The full comparison report.
|
|
1967
1997
|
* @return The terse summary.
|
|
1968
1998
|
*/
|
|
1969
|
-
declare function comparisonSummaryFromReport(comparisonReport: ComparisonReport): ComparisonSummary;
|
|
1999
|
+
export declare function comparisonSummaryFromReport(comparisonReport: ComparisonReport): ComparisonSummary;
|
|
1970
2000
|
/**
|
|
1971
2001
|
* Convert a full `ComparisonTestReport` to a terse `ComparisonTestSummary`. This will
|
|
1972
2002
|
* return undefined if the test has a zero `maxDiff` value.
|
|
@@ -1976,11 +2006,13 @@ declare function comparisonSummaryFromReport(comparisonReport: ComparisonReport)
|
|
|
1976
2006
|
* @param baselineAvgDiff The avg diff for the baseline scenario, or undefined if not available.
|
|
1977
2007
|
* @return The terse comparison test summary.
|
|
1978
2008
|
*/
|
|
1979
|
-
declare function testSummaryFromReport(r: ComparisonTestReport, baselineMaxDiff: number | undefined, baselineAvgDiff: number | undefined): ComparisonTestSummary | undefined;
|
|
1980
|
-
|
|
2009
|
+
export declare function testSummaryFromReport(r: ComparisonTestReport, baselineMaxDiff: number | undefined, baselineAvgDiff: number | undefined): ComparisonTestSummary | undefined;
|
|
2010
|
+
//#endregion
|
|
2011
|
+
//#region src/comparison/report/comparison-sort-mode.d.ts
|
|
1981
2012
|
/** The available sort modes for categorizing comparison groups. */
|
|
1982
2013
|
type ComparisonSortMode = 'max-diff' | 'avg-diff' | 'max-diff-relative' | 'avg-diff-relative';
|
|
1983
|
-
|
|
2014
|
+
//#endregion
|
|
2015
|
+
//#region src/comparison/report/comparison-group-scores.d.ts
|
|
1984
2016
|
/**
|
|
1985
2017
|
* Compute the overall scores for the given group of comparison test summaries.
|
|
1986
2018
|
*
|
|
@@ -1989,8 +2021,9 @@ type ComparisonSortMode = 'max-diff' | 'avg-diff' | 'max-diff-relative' | 'avg-d
|
|
|
1989
2021
|
* the scores will be summarized.
|
|
1990
2022
|
* @param sortMode The sort mode to determine which field to use for scoring.
|
|
1991
2023
|
*/
|
|
1992
|
-
declare function getScoresForTestSummaries(testSummaries: ComparisonTestSummary[], thresholds: number[], sortMode: ComparisonSortMode): ComparisonGroupScores;
|
|
1993
|
-
|
|
2024
|
+
export declare function getScoresForTestSummaries(testSummaries: ComparisonTestSummary[], thresholds: number[], sortMode: ComparisonSortMode): ComparisonGroupScores;
|
|
2025
|
+
//#endregion
|
|
2026
|
+
//#region src/comparison/report/comparison-grouping.d.ts
|
|
1994
2027
|
/**
|
|
1995
2028
|
* Given a set of terse test summaries (which only includes summaries for tests with non-zero `maxDiff`
|
|
1996
2029
|
* scores), restore the full set of summaries and then categorize them.
|
|
@@ -1999,74 +2032,77 @@ declare function getScoresForTestSummaries(testSummaries: ComparisonTestSummary[
|
|
|
1999
2032
|
* @param terseSummaries The set of terse test summaries.
|
|
2000
2033
|
* @param sortMode The sort mode to determine which field to use for scoring.
|
|
2001
2034
|
*/
|
|
2002
|
-
declare function categorizeComparisonTestSummaries(comparisonConfig: ComparisonConfig, terseSummaries: ComparisonTestSummary[], sortMode: ComparisonSortMode): ComparisonCategorizedResults;
|
|
2003
|
-
|
|
2035
|
+
export declare function categorizeComparisonTestSummaries(comparisonConfig: ComparisonConfig, terseSummaries: ComparisonTestSummary[], sortMode: ComparisonSortMode): ComparisonCategorizedResults;
|
|
2036
|
+
//#endregion
|
|
2037
|
+
//#region src/config/config-types.d.ts
|
|
2004
2038
|
/**
|
|
2005
2039
|
* Additional options that are passed to `getConfigOptions`.
|
|
2006
2040
|
*/
|
|
2007
2041
|
interface ConfigInitOptions {
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2042
|
+
/** If defined, overrides the displayed name of the baseline ("left") bundle. */
|
|
2043
|
+
bundleNameL?: string;
|
|
2044
|
+
/** If defined, overrides the displayed name of the current ("right") bundle. */
|
|
2045
|
+
bundleNameR?: string;
|
|
2012
2046
|
}
|
|
2013
2047
|
/**
|
|
2014
2048
|
* The user-specified options used by the library to resolve and initialize a `Config` instance.
|
|
2015
2049
|
*/
|
|
2016
2050
|
interface ConfigOptions {
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2051
|
+
/**
|
|
2052
|
+
* The bundle being checked. This bundle will also be compared against the
|
|
2053
|
+
* "baseline" bundle, if `comparison` options are defined.
|
|
2054
|
+
*/
|
|
2055
|
+
current: NamedBundle;
|
|
2056
|
+
/**
|
|
2057
|
+
* The model check options.
|
|
2058
|
+
*/
|
|
2059
|
+
check: CheckOptions;
|
|
2060
|
+
/**
|
|
2061
|
+
* The model comparison options.
|
|
2062
|
+
*/
|
|
2063
|
+
comparison?: ComparisonOptions;
|
|
2064
|
+
/**
|
|
2065
|
+
* The number of model instances to initialize for each bundle.
|
|
2066
|
+
*
|
|
2067
|
+
* If undefined, the default behavior will be used, which is to initialize a single
|
|
2068
|
+
* model instance for each bundle.
|
|
2069
|
+
*
|
|
2070
|
+
* If you set this to a value greater than 1, it will allow multiple pairs of model
|
|
2071
|
+
* instances to be run concurrently. For example, if the number of CPU cores is 8,
|
|
2072
|
+
* setting this to 4 will allow 4 pairs of model instances to be run concurrently,
|
|
2073
|
+
* using all available cores.
|
|
2074
|
+
*
|
|
2075
|
+
* If you set this to 0, the implementation will automatically choose a value based on
|
|
2076
|
+
* the number of available CPU cores (i.e., the number of cores divided by 2).
|
|
2077
|
+
*/
|
|
2078
|
+
concurrency?: number;
|
|
2045
2079
|
}
|
|
2046
2080
|
/**
|
|
2047
2081
|
* The resolved configuration for check and comparison tests.
|
|
2048
2082
|
*/
|
|
2049
2083
|
interface Config {
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
}
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2084
|
+
/** The resolved check test configuration. */
|
|
2085
|
+
check: CheckConfig;
|
|
2086
|
+
/** The resolved comparison test configuration. */
|
|
2087
|
+
comparison?: ComparisonConfig;
|
|
2088
|
+
}
|
|
2089
|
+
//#endregion
|
|
2090
|
+
//#region src/config/config.d.ts
|
|
2091
|
+
export declare function createConfig(options: ConfigOptions): Promise<Config>;
|
|
2092
|
+
//#endregion
|
|
2093
|
+
//#region src/perf/perf-runner.d.ts
|
|
2058
2094
|
type CancelRunPerf = () => void;
|
|
2059
2095
|
interface RunPerfCallbacks {
|
|
2060
|
-
|
|
2061
|
-
|
|
2096
|
+
onComplete?: (reportL: PerfReport, reportR: PerfReport) => void;
|
|
2097
|
+
onError?: (error: Error) => void;
|
|
2062
2098
|
}
|
|
2063
2099
|
interface RunPerfOptions {
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2100
|
+
/** The mode to run the performance tests (default is 'serial'). */
|
|
2101
|
+
mode?: 'serial' | 'parallel';
|
|
2102
|
+
/** The number of warmups for each perf run (default is 5). */
|
|
2103
|
+
warmupCount?: number;
|
|
2104
|
+
/** The number of times to run the model for each perf run (default is 100). */
|
|
2105
|
+
runCount?: number;
|
|
2070
2106
|
}
|
|
2071
2107
|
/**
|
|
2072
2108
|
* Run performance tests on the bundle models.
|
|
@@ -2075,8 +2111,9 @@ interface RunPerfOptions {
|
|
|
2075
2111
|
* @param options The options for the performance run.
|
|
2076
2112
|
* @return A function that will cancel the process when invoked.
|
|
2077
2113
|
*/
|
|
2078
|
-
declare function runPerf(callbacks: RunPerfCallbacks, options?: RunPerfOptions): CancelRunPerf;
|
|
2079
|
-
|
|
2114
|
+
export declare function runPerf(callbacks: RunPerfCallbacks, options?: RunPerfOptions): CancelRunPerf;
|
|
2115
|
+
//#endregion
|
|
2116
|
+
//#region src/trace/trace-report.d.ts
|
|
2080
2117
|
/**
|
|
2081
2118
|
* The report for a single trace comparison between two datasets.
|
|
2082
2119
|
*
|
|
@@ -2084,41 +2121,42 @@ declare function runPerf(callbacks: RunPerfCallbacks, options?: RunPerfOptions):
|
|
|
2084
2121
|
* diff points. Maybe we can combine them and make the points array an opt-in thing.
|
|
2085
2122
|
*/
|
|
2086
2123
|
interface TraceDatasetReport {
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2124
|
+
datasetKey: DatasetKey;
|
|
2125
|
+
validity: DiffValidity;
|
|
2126
|
+
points: Map<number, DiffPoint>;
|
|
2127
|
+
minValue: number;
|
|
2128
|
+
maxValue: number;
|
|
2129
|
+
avgDiff: number;
|
|
2130
|
+
minDiff: number;
|
|
2131
|
+
maxDiff: number;
|
|
2132
|
+
maxDiffPoint: DiffPoint;
|
|
2096
2133
|
}
|
|
2097
2134
|
/**
|
|
2098
2135
|
* The roll-up report that contains the results of the trace comparisons
|
|
2099
2136
|
* for all datasets.
|
|
2100
2137
|
*/
|
|
2101
2138
|
interface TraceReport {
|
|
2102
|
-
|
|
2139
|
+
datasetReports: Map<DatasetKey, TraceDatasetReport>;
|
|
2103
2140
|
}
|
|
2104
|
-
|
|
2141
|
+
//#endregion
|
|
2142
|
+
//#region src/trace/trace-runner.d.ts
|
|
2105
2143
|
type CancelRunTrace = () => void;
|
|
2106
2144
|
interface RunTraceCallbacks {
|
|
2107
|
-
|
|
2108
|
-
|
|
2145
|
+
onComplete?: (traceReport: TraceReport) => void;
|
|
2146
|
+
onError?: (error: Error) => void;
|
|
2109
2147
|
}
|
|
2110
2148
|
interface TraceCompareToBundleOptions {
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2149
|
+
kind: 'compare-to-bundle';
|
|
2150
|
+
bundleSide0: 'left' | 'right';
|
|
2151
|
+
scenarioSpec0: ScenarioSpec;
|
|
2152
|
+
bundleSide1: 'left' | 'right';
|
|
2153
|
+
scenarioSpec1: ScenarioSpec;
|
|
2116
2154
|
}
|
|
2117
2155
|
interface TraceCompareToExtDataOptions {
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2156
|
+
kind: 'compare-to-ext-data';
|
|
2157
|
+
extData: DatasetMap;
|
|
2158
|
+
bundleSide: 'left' | 'right';
|
|
2159
|
+
scenarioSpec: ScenarioSpec;
|
|
2122
2160
|
}
|
|
2123
2161
|
type TraceOptions = TraceCompareToBundleOptions | TraceCompareToExtDataOptions;
|
|
2124
2162
|
/**
|
|
@@ -2129,16 +2167,17 @@ type TraceOptions = TraceCompareToBundleOptions | TraceCompareToExtDataOptions;
|
|
|
2129
2167
|
* @param options Options to control how the trace is run.
|
|
2130
2168
|
* @return A function that will cancel the process when invoked.
|
|
2131
2169
|
*/
|
|
2132
|
-
declare function runTrace(modelSpec: ModelSpec, callbacks: RunTraceCallbacks, options: TraceOptions): CancelRunTrace;
|
|
2133
|
-
|
|
2170
|
+
export declare function runTrace(modelSpec: ModelSpec, callbacks: RunTraceCallbacks, options: TraceOptions): CancelRunTrace;
|
|
2171
|
+
//#endregion
|
|
2172
|
+
//#region src/suite/suite-report-types.d.ts
|
|
2134
2173
|
/**
|
|
2135
2174
|
* The report for a single run of the full check+comparison test suite.
|
|
2136
2175
|
*/
|
|
2137
|
-
interface SuiteReport {
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2176
|
+
export interface SuiteReport {
|
|
2177
|
+
/** The check report. */
|
|
2178
|
+
checkReport: CheckReport;
|
|
2179
|
+
/** The comparison report (only defined if comparisons were enabled). */
|
|
2180
|
+
comparisonReport?: ComparisonReport;
|
|
2142
2181
|
}
|
|
2143
2182
|
/**
|
|
2144
2183
|
* A simplified/terse version of `SuiteReport` that is used when writing
|
|
@@ -2147,34 +2186,35 @@ interface SuiteReport {
|
|
|
2147
2186
|
* full `DiffReport` for each comparison test) to keep the file smaller
|
|
2148
2187
|
* when there are many reported differences.
|
|
2149
2188
|
*/
|
|
2150
|
-
interface SuiteSummary {
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
}
|
|
2160
|
-
|
|
2189
|
+
export interface SuiteSummary {
|
|
2190
|
+
/** The date and time the suite was run (in ISO 8601 format, as generated by `Date.toISOString`). */
|
|
2191
|
+
date: string;
|
|
2192
|
+
/** The time in milliseconds that it took to run the suite. */
|
|
2193
|
+
elapsed: number;
|
|
2194
|
+
/** The check summary. */
|
|
2195
|
+
checkSummary: CheckSummary;
|
|
2196
|
+
/** The comparison summary (only defined if comparisons were enabled). */
|
|
2197
|
+
comparisonSummary?: ComparisonSummary;
|
|
2198
|
+
}
|
|
2199
|
+
//#endregion
|
|
2200
|
+
//#region src/suite/suite-runner.d.ts
|
|
2161
2201
|
type CancelRunSuite = () => void;
|
|
2162
2202
|
interface RunSuiteCallbacks {
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2203
|
+
onProgress?: (pct: number) => void;
|
|
2204
|
+
onComplete?: (suiteReport: SuiteReport) => void;
|
|
2205
|
+
onError?: (error: Error) => void;
|
|
2166
2206
|
}
|
|
2167
2207
|
interface RunSuiteOptions {
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2208
|
+
/**
|
|
2209
|
+
* The check tests to skip. Note that checks are matched by group and name
|
|
2210
|
+
* (case insensitive).
|
|
2211
|
+
*/
|
|
2212
|
+
skipChecks?: CheckNameSpec[];
|
|
2213
|
+
/**
|
|
2214
|
+
* The comparison scenarios to skip. Note that scenarios are matched by
|
|
2215
|
+
* title and subtitle (case insensitive).
|
|
2216
|
+
*/
|
|
2217
|
+
skipComparisonScenarios?: ComparisonScenarioTitleSpec[];
|
|
2178
2218
|
}
|
|
2179
2219
|
/**
|
|
2180
2220
|
* Run the full suite of checks and comparisons defined in the given configuration.
|
|
@@ -2184,8 +2224,9 @@ interface RunSuiteOptions {
|
|
|
2184
2224
|
* @param options Options to control how the tests are run.
|
|
2185
2225
|
* @return A function that will cancel the process when invoked.
|
|
2186
2226
|
*/
|
|
2187
|
-
declare function runSuite(config: Config, callbacks: RunSuiteCallbacks, options?: RunSuiteOptions): CancelRunSuite;
|
|
2188
|
-
|
|
2227
|
+
export declare function runSuite(config: Config, callbacks: RunSuiteCallbacks, options?: RunSuiteOptions): CancelRunSuite;
|
|
2228
|
+
//#endregion
|
|
2229
|
+
//#region src/suite/suite-reporting.d.ts
|
|
2189
2230
|
/**
|
|
2190
2231
|
* Convert a full `SuiteReport` to a simplified `SuiteSummary` that only includes
|
|
2191
2232
|
* failed/errored checks or comparisons with differences.
|
|
@@ -2194,6 +2235,7 @@ declare function runSuite(config: Config, callbacks: RunSuiteCallbacks, options?
|
|
|
2194
2235
|
* @param elapsedMillis The time in milliseconds that it took to run the suite.
|
|
2195
2236
|
* @return The converted suite summary.
|
|
2196
2237
|
*/
|
|
2197
|
-
declare function suiteSummaryFromReport(suiteReport: SuiteReport, elapsedMillis: number): SuiteSummary;
|
|
2198
|
-
|
|
2199
|
-
export
|
|
2238
|
+
export declare function suiteSummaryFromReport(suiteReport: SuiteReport, elapsedMillis: number): SuiteSummary;
|
|
2239
|
+
//#endregion
|
|
2240
|
+
export type { Bundle, BundleGraphData, BundleGraphDatasetSpec, BundleGraphId, BundleGraphSpec, BundleGraphView, BundleGraphViewOptions, BundleModel, CancelRunPerf, CancelRunSuite, CancelRunTrace as CancelTrace, CheckConfig, CheckDataRef, CheckDataRefKey, CheckDataRefOp, CheckDataRequestKey, CheckDataset, CheckDatasetError, CheckDatasetReport, CheckGroupReport, CheckKey, CheckNameSpec, CheckOptions, CheckPredicateOp, CheckPredicateOpConstantRef, CheckPredicateOpDataRef, CheckPredicateOpRef, CheckPredicateReport, CheckPredicateSummary, CheckPredicateTimeOptions, CheckPredicateTimeRange, CheckPredicateTimeSingle, CheckPredicateTimeSpec, CheckRefDataset, CheckReport, CheckResult, CheckResultErrorInfo, CheckScenario, CheckScenarioError, CheckScenarioInputDesc, CheckScenarioReport, CheckStatus, CheckSummary, CheckTestReport, ComparisonConfig, ComparisonDataRequestKey, ComparisonDatasetOptions, ComparisonDatasets, ComparisonOptions, ComparisonPlot, ComparisonReportDetailItem, ComparisonReportDetailRow, ComparisonReportOptions, ComparisonReportSummaryRow, ComparisonReportSummarySection, ComparisonScenarios, ComparisonSortMode, Config, ConfigInitOptions, ConfigOptions, DatasetGroupName, EncodedImplVars, EncodedSubscript, EncodedVarInstance, EncodedVarType, EncodedVariable, ImplVar, ImplVarGroup, InputAliasName, InputGroupName, InputId, InputSettingGroupId, InputVar, LegendItem, LinkItem, LoadedBundle, ModelSpec, NamedBundle, OutputVar, PerfReport, RelatedItem, RunPerfCallbacks, RunPerfOptions, RunSuiteCallbacks, RunSuiteOptions, SliderInputVar, SwitchInputVar, RunTraceCallbacks as TraceCallbacks, TraceCompareToBundleOptions, TraceCompareToExtDataOptions, TraceDatasetReport, TraceOptions, TraceReport };
|
|
2241
|
+
//# sourceMappingURL=index.d.ts.map
|