@sdeverywhere/check-core 0.1.13 → 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 +1523 -1466
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4773 -5447
- package/dist/index.js.map +1 -1
- package/package.json +3 -5
- package/schema/check.schema.json +49 -0
- package/dist/index.cjs +0 -5779
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -2184
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,236 +592,260 @@ 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
|
*/
|
|
746
759
|
type CheckDataRefKey = string;
|
|
747
760
|
/**
|
|
748
|
-
* The
|
|
749
|
-
|
|
761
|
+
* The operation used to combine multiple referenced datasets into a single dataset.
|
|
762
|
+
*/
|
|
763
|
+
type CheckDataRefOp = 'sum';
|
|
764
|
+
/**
|
|
765
|
+
* A single dataset (along with the scenario used to produce it) that is referenced
|
|
766
|
+
* by a predicate. Each of these corresponds to one data fetch.
|
|
767
|
+
*/
|
|
768
|
+
interface CheckRefDataset {
|
|
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;
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* The dataset(s) referenced by a particular predicate op (for cases where the check
|
|
778
|
+
* is against other datasets rather than a constant value). When more than one dataset
|
|
779
|
+
* is referenced, the `op` determines how they are combined into a single dataset.
|
|
750
780
|
*/
|
|
751
781
|
interface CheckDataRef {
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
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[];
|
|
786
|
+
}
|
|
787
|
+
//#endregion
|
|
788
|
+
//#region src/check/check-predicate.d.ts
|
|
760
789
|
type CheckPredicateOp = 'gt' | 'gte' | 'lt' | 'lte' | 'eq' | 'approx';
|
|
761
|
-
|
|
790
|
+
//#endregion
|
|
791
|
+
//#region src/check/check-func.d.ts
|
|
762
792
|
interface CheckResultErrorInfo {
|
|
763
|
-
|
|
764
|
-
|
|
793
|
+
kind: 'unknown-dataset' | 'unknown-input' | 'unknown-input-group' | 'empty-input-group';
|
|
794
|
+
name: string;
|
|
765
795
|
}
|
|
766
796
|
interface CheckResult {
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
}
|
|
775
|
-
|
|
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
|
|
776
807
|
type CheckKey = number;
|
|
777
|
-
|
|
808
|
+
//#endregion
|
|
809
|
+
//#region src/check/check-report.d.ts
|
|
778
810
|
type CheckStatus = 'passed' | 'failed' | 'error' | 'skipped';
|
|
779
811
|
interface CheckPredicateOpConstantRef {
|
|
780
|
-
|
|
781
|
-
|
|
812
|
+
kind: 'constant';
|
|
813
|
+
value: number;
|
|
782
814
|
}
|
|
783
815
|
interface CheckPredicateOpDataRef {
|
|
784
|
-
|
|
785
|
-
|
|
816
|
+
kind: 'data';
|
|
817
|
+
dataRef: CheckDataRef;
|
|
786
818
|
}
|
|
787
819
|
type CheckPredicateOpRef = CheckPredicateOpConstantRef | CheckPredicateOpDataRef;
|
|
788
820
|
interface CheckPredicateReport {
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
821
|
+
checkKey: CheckKey;
|
|
822
|
+
result: CheckResult;
|
|
823
|
+
opRefs: Map<CheckPredicateOp, CheckPredicateOpRef>;
|
|
824
|
+
opValues: string[];
|
|
825
|
+
time?: CheckPredicateTimeSpec;
|
|
826
|
+
tolerance?: number;
|
|
795
827
|
}
|
|
796
828
|
interface CheckDatasetReport {
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
829
|
+
checkDataset: CheckDataset;
|
|
830
|
+
status: CheckStatus;
|
|
831
|
+
predicates: CheckPredicateReport[];
|
|
800
832
|
}
|
|
801
833
|
interface CheckScenarioReport {
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
834
|
+
checkScenario: CheckScenario;
|
|
835
|
+
status: CheckStatus;
|
|
836
|
+
datasets: CheckDatasetReport[];
|
|
805
837
|
}
|
|
806
838
|
interface CheckTestReport {
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
839
|
+
name: string;
|
|
840
|
+
status: CheckStatus;
|
|
841
|
+
scenarios: CheckScenarioReport[];
|
|
810
842
|
}
|
|
811
843
|
interface CheckGroupReport {
|
|
812
|
-
|
|
813
|
-
|
|
844
|
+
name: string;
|
|
845
|
+
tests: CheckTestReport[];
|
|
814
846
|
}
|
|
815
847
|
interface CheckReport {
|
|
816
|
-
|
|
848
|
+
groups: CheckGroupReport[];
|
|
817
849
|
}
|
|
818
850
|
type StyleFunc = (s: string) => string;
|
|
819
851
|
/**
|
|
@@ -822,29 +854,30 @@ type StyleFunc = (s: string) => string;
|
|
|
822
854
|
* @param scenario The scenario report.
|
|
823
855
|
* @param bold A function that applies bold styling to a string.
|
|
824
856
|
*/
|
|
825
|
-
declare function scenarioMessage(scenario: CheckScenarioReport, bold: StyleFunc): string;
|
|
857
|
+
export declare function scenarioMessage(scenario: CheckScenarioReport, bold: StyleFunc): string;
|
|
826
858
|
/**
|
|
827
859
|
* Return a string representation of the given dataset.
|
|
828
860
|
*
|
|
829
861
|
* @param dataset The dataset report.
|
|
830
862
|
* @param bold A function that applies bold styling to a string.
|
|
831
863
|
*/
|
|
832
|
-
declare function datasetMessage(dataset: CheckDatasetReport, bold: StyleFunc): string;
|
|
864
|
+
export declare function datasetMessage(dataset: CheckDatasetReport, bold: StyleFunc): string;
|
|
833
865
|
/**
|
|
834
866
|
* Return a string representation of the given predicate.
|
|
835
867
|
*
|
|
836
868
|
* @param predicate The predicate report.
|
|
837
869
|
* @param bold A function that applies bold styling to a string.
|
|
838
870
|
*/
|
|
839
|
-
declare function predicateMessage(predicate: CheckPredicateReport, bold: StyleFunc): string;
|
|
840
|
-
|
|
871
|
+
export declare function predicateMessage(predicate: CheckPredicateReport, bold: StyleFunc): string;
|
|
872
|
+
//#endregion
|
|
873
|
+
//#region src/check/check-summary.d.ts
|
|
841
874
|
/**
|
|
842
875
|
* A simplified/terse version of `CheckPredicateReport` that matches the
|
|
843
876
|
* format of the JSON objects emitted by the CLI in terse mode.
|
|
844
877
|
*/
|
|
845
878
|
interface CheckPredicateSummary {
|
|
846
|
-
|
|
847
|
-
|
|
879
|
+
checkKey: CheckKey;
|
|
880
|
+
result: CheckResult;
|
|
848
881
|
}
|
|
849
882
|
/**
|
|
850
883
|
* A simplified/terse version of `CheckReport` that matches the
|
|
@@ -853,7 +886,7 @@ interface CheckPredicateSummary {
|
|
|
853
886
|
* of 'failed', 'error', or 'skipped'.
|
|
854
887
|
*/
|
|
855
888
|
interface CheckSummary {
|
|
856
|
-
|
|
889
|
+
predicateSummaries: CheckPredicateSummary[];
|
|
857
890
|
}
|
|
858
891
|
/**
|
|
859
892
|
* Convert a full `CheckReport` to a simplified `CheckSummary` that includes
|
|
@@ -862,7 +895,7 @@ interface CheckSummary {
|
|
|
862
895
|
* @param checkReport The full check report.
|
|
863
896
|
* @return The converted check summary.
|
|
864
897
|
*/
|
|
865
|
-
declare function checkSummaryFromReport(checkReport: CheckReport): CheckSummary;
|
|
898
|
+
export declare function checkSummaryFromReport(checkReport: CheckReport): CheckSummary;
|
|
866
899
|
/**
|
|
867
900
|
* Convert a simplified `CheckSummary` to a full `CheckReport` that restores the
|
|
868
901
|
* structure of the tests from the given configuration.
|
|
@@ -872,112 +905,113 @@ declare function checkSummaryFromReport(checkReport: CheckReport): CheckSummary;
|
|
|
872
905
|
* @param skipChecks The checks that were skipped when the original report was created.
|
|
873
906
|
* @return The converted check report.
|
|
874
907
|
*/
|
|
875
|
-
declare function checkReportFromSummary(checkConfig: CheckConfig, checkSummary: CheckSummary, skipChecks?: CheckNameSpec[]): CheckReport | undefined;
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
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;
|
|
879
913
|
/**
|
|
880
914
|
* Specifies a dataset (variable) used for comparison.
|
|
881
915
|
*/
|
|
882
|
-
interface ComparisonDatasetSpec {
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
}
|
|
892
|
-
type ComparisonScenarioId = string;
|
|
893
|
-
type ComparisonScenarioTitle = string;
|
|
894
|
-
type ComparisonScenarioSubtitle = string;
|
|
895
|
-
type ComparisonScenarioInputName = string;
|
|
896
|
-
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';
|
|
897
931
|
/**
|
|
898
932
|
* Specifies an input that is set to a specific position (default / min / max).
|
|
899
933
|
*/
|
|
900
|
-
interface ComparisonScenarioInputAtPositionSpec {
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
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;
|
|
906
940
|
}
|
|
907
941
|
/**
|
|
908
942
|
* Specifies an input that is set to a specific number value.
|
|
909
943
|
*/
|
|
910
|
-
interface ComparisonScenarioInputAtValueSpec {
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
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;
|
|
916
950
|
}
|
|
917
951
|
/**
|
|
918
952
|
* A single input setting for a scenario. An input can be set to a specific number value,
|
|
919
953
|
* or it can be set to a "position" (default / min / max).
|
|
920
954
|
*/
|
|
921
|
-
type ComparisonScenarioInputSpec = ComparisonScenarioInputAtPositionSpec | ComparisonScenarioInputAtValueSpec;
|
|
955
|
+
export type ComparisonScenarioInputSpec = ComparisonScenarioInputAtPositionSpec | ComparisonScenarioInputAtValueSpec;
|
|
922
956
|
/**
|
|
923
957
|
* Specifies a single scenario that sets one or more inputs to a value/position.
|
|
924
958
|
*/
|
|
925
|
-
interface ComparisonScenarioWithInputsSpec {
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
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[];
|
|
935
969
|
}
|
|
936
970
|
/**
|
|
937
971
|
* Specifies a single scenario that configures inputs differently for the two
|
|
938
972
|
* model instances.
|
|
939
973
|
*/
|
|
940
|
-
interface ComparisonScenarioWithDistinctInputsSpec {
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
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[];
|
|
952
986
|
}
|
|
953
987
|
/**
|
|
954
988
|
* Specifies a single scenario that configures inputs according to the setting
|
|
955
989
|
* group defined for each model instance.
|
|
956
990
|
*/
|
|
957
|
-
interface ComparisonScenarioWithSettingGroupSpec {
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
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;
|
|
967
1001
|
}
|
|
968
1002
|
/**
|
|
969
1003
|
* Specifies a single scenario that sets all available inputs to position.
|
|
970
1004
|
*/
|
|
971
|
-
interface ComparisonScenarioWithAllInputsSpec {
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
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;
|
|
981
1015
|
}
|
|
982
1016
|
/**
|
|
983
1017
|
* Special preset that expands to many scenarios:
|
|
@@ -986,502 +1020,506 @@ interface ComparisonScenarioWithAllInputsSpec {
|
|
|
986
1020
|
* - one scenario with the input at its minimum
|
|
987
1021
|
* - one scenario with the input at its maximum
|
|
988
1022
|
*/
|
|
989
|
-
interface ComparisonScenarioPresetMatrixSpec {
|
|
990
|
-
|
|
1023
|
+
export interface ComparisonScenarioPresetMatrixSpec {
|
|
1024
|
+
kind: 'scenario-matrix';
|
|
991
1025
|
}
|
|
992
1026
|
/**
|
|
993
1027
|
* A definition of input scenario(s). A scenario can set one input to a value/position, or it
|
|
994
1028
|
* can set multiple inputs to particular values/positions.
|
|
995
1029
|
*/
|
|
996
|
-
type ComparisonScenarioSpec = ComparisonScenarioWithInputsSpec | ComparisonScenarioWithDistinctInputsSpec | ComparisonScenarioWithSettingGroupSpec | ComparisonScenarioWithAllInputsSpec | ComparisonScenarioPresetMatrixSpec;
|
|
1030
|
+
export type ComparisonScenarioSpec = ComparisonScenarioWithInputsSpec | ComparisonScenarioWithDistinctInputsSpec | ComparisonScenarioWithSettingGroupSpec | ComparisonScenarioWithAllInputsSpec | ComparisonScenarioPresetMatrixSpec;
|
|
997
1031
|
/** A reference to a scenario definition. */
|
|
998
|
-
interface ComparisonScenarioRefSpec {
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
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;
|
|
1006
1040
|
}
|
|
1007
1041
|
/** Spec type that allows for matching a comparison scenario by title and subtitle. */
|
|
1008
|
-
interface ComparisonScenarioTitleSpec {
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1042
|
+
export interface ComparisonScenarioTitleSpec {
|
|
1043
|
+
/** The title of a comparison scenario. */
|
|
1044
|
+
title: string;
|
|
1045
|
+
/** The subtitle of a comparison scenario. */
|
|
1046
|
+
subtitle?: string;
|
|
1013
1047
|
}
|
|
1014
|
-
type ComparisonScenarioGroupId = string;
|
|
1015
|
-
type ComparisonScenarioGroupTitle = string;
|
|
1048
|
+
export type ComparisonScenarioGroupId = string;
|
|
1049
|
+
export type ComparisonScenarioGroupTitle = string;
|
|
1016
1050
|
/**
|
|
1017
1051
|
* A definition of a group of input scenarios. Multiple scenarios can be grouped together under a single name, and
|
|
1018
1052
|
* can later be referenced by group ID in a view definition.
|
|
1019
1053
|
*/
|
|
1020
|
-
interface ComparisonScenarioGroupSpec {
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
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)[];
|
|
1028
1062
|
}
|
|
1029
1063
|
/** A reference to a scenario group definition. */
|
|
1030
|
-
interface ComparisonScenarioGroupRefSpec {
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1064
|
+
export interface ComparisonScenarioGroupRefSpec {
|
|
1065
|
+
kind: 'scenario-group-ref';
|
|
1066
|
+
/** The ID of the scenario group that is referenced. */
|
|
1067
|
+
groupId: ComparisonScenarioGroupId;
|
|
1034
1068
|
}
|
|
1035
|
-
type ComparisonGraphId = string;
|
|
1069
|
+
export type ComparisonGraphId = string;
|
|
1036
1070
|
/**
|
|
1037
1071
|
* Specifies a list of graphs to be shown in a view.
|
|
1038
1072
|
*/
|
|
1039
|
-
interface ComparisonGraphsArraySpec {
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1073
|
+
export interface ComparisonGraphsArraySpec {
|
|
1074
|
+
kind: 'graphs-array';
|
|
1075
|
+
/** The array of IDs for graphs to show. */
|
|
1076
|
+
graphIds: ComparisonGraphId[];
|
|
1043
1077
|
}
|
|
1044
1078
|
/**
|
|
1045
1079
|
* Specifies a preset list of graphs to be shown in a view.
|
|
1046
1080
|
*/
|
|
1047
|
-
interface ComparisonGraphsPresetSpec {
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1081
|
+
export interface ComparisonGraphsPresetSpec {
|
|
1082
|
+
kind: 'graphs-preset';
|
|
1083
|
+
/** The preset (currently only "all" is supported, which shows all available graphs). */
|
|
1084
|
+
preset: 'all';
|
|
1051
1085
|
}
|
|
1052
|
-
type ComparisonGraphGroupId = string;
|
|
1086
|
+
export type ComparisonGraphGroupId = string;
|
|
1053
1087
|
/**
|
|
1054
1088
|
* A definition of a group of graphs to be shown in a view. Multiple graphs can be grouped together
|
|
1055
1089
|
* under a single ID, and can later be referenced by group ID in a view definition.
|
|
1056
1090
|
*/
|
|
1057
|
-
interface ComparisonGraphGroupSpec {
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
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[];
|
|
1063
1097
|
}
|
|
1064
1098
|
/** A reference to a graph group definition. */
|
|
1065
|
-
interface ComparisonGraphGroupRefSpec {
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
}
|
|
1070
|
-
type ComparisonViewTitle = string;
|
|
1071
|
-
type ComparisonViewSubtitle = string;
|
|
1072
|
-
type ComparisonViewRowTitle = string;
|
|
1073
|
-
type ComparisonViewRowSubtitle = string;
|
|
1074
|
-
type ComparisonViewItemTitle = string;
|
|
1075
|
-
type ComparisonViewItemSubtitle = string;
|
|
1076
|
-
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';
|
|
1077
1111
|
/**
|
|
1078
1112
|
* Specifies a single comparison box to be shown in a view.
|
|
1079
1113
|
*/
|
|
1080
|
-
interface ComparisonViewBoxSpec {
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
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;
|
|
1090
1124
|
}
|
|
1091
1125
|
/**
|
|
1092
1126
|
* Specifies a row of comparison boxes to be shown in a view.
|
|
1093
1127
|
*/
|
|
1094
|
-
interface ComparisonViewRowSpec {
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
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[];
|
|
1102
1136
|
}
|
|
1103
1137
|
/**
|
|
1104
1138
|
* Specifies a set of graphs to be shown in a view.
|
|
1105
1139
|
*/
|
|
1106
|
-
type ComparisonViewGraphsSpec = ComparisonGraphsPresetSpec | ComparisonGraphsArraySpec | ComparisonGraphGroupRefSpec;
|
|
1140
|
+
export type ComparisonViewGraphsSpec = ComparisonGraphsPresetSpec | ComparisonGraphsArraySpec | ComparisonGraphGroupRefSpec;
|
|
1107
1141
|
/**
|
|
1108
1142
|
* A definition of a view. A view presents a set of graphs, either for a single input scenario
|
|
1109
1143
|
* or for a mix of different dataset/scenario combinations.
|
|
1110
1144
|
*/
|
|
1111
|
-
interface ComparisonViewSpec {
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
}
|
|
1129
|
-
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;
|
|
1130
1164
|
/**
|
|
1131
1165
|
* Specifies a view group with an explicit array of view definitions.
|
|
1132
1166
|
*/
|
|
1133
|
-
interface ComparisonViewGroupWithViewsSpec {
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
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[];
|
|
1139
1173
|
}
|
|
1140
1174
|
/**
|
|
1141
1175
|
* Specifies a view group by declaring the scenarios included in the group (one view per scenario), along
|
|
1142
1176
|
* with a set of graphs that will shown in each view.
|
|
1143
1177
|
*/
|
|
1144
|
-
interface ComparisonViewGroupWithScenariosSpec {
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
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;
|
|
1157
1191
|
}
|
|
1158
1192
|
/**
|
|
1159
1193
|
* A definition of a group of views. Multiple related views can be grouped together under a single title
|
|
1160
1194
|
* to make them easy to distinguish in a report.
|
|
1161
1195
|
*/
|
|
1162
|
-
type ComparisonViewGroupSpec = ComparisonViewGroupWithViewsSpec | ComparisonViewGroupWithScenariosSpec;
|
|
1196
|
+
export type ComparisonViewGroupSpec = ComparisonViewGroupWithViewsSpec | ComparisonViewGroupWithScenariosSpec;
|
|
1163
1197
|
/**
|
|
1164
1198
|
* Contains the scenario and view definitions from one or more sources (JSON/YAML files or manually
|
|
1165
1199
|
* defined specs).
|
|
1166
1200
|
*/
|
|
1167
|
-
interface ComparisonSpecs {
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
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[];
|
|
1176
1210
|
}
|
|
1177
1211
|
/** A source of comparison scenario and specifications. */
|
|
1178
|
-
interface ComparisonSpecsSource {
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
}
|
|
1185
|
-
|
|
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
|
|
1186
1221
|
/** A resolved dataset that is being compared. */
|
|
1187
|
-
interface ComparisonDataset {
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
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;
|
|
1201
1236
|
}
|
|
1202
1237
|
/** A unique key for a `ComparisonScenario`, generated internally for use by the library. */
|
|
1203
|
-
type ComparisonScenarioKey = string & {
|
|
1204
|
-
|
|
1238
|
+
export type ComparisonScenarioKey = string & {
|
|
1239
|
+
_brand?: 'ComparisonScenarioKey';
|
|
1205
1240
|
};
|
|
1206
1241
|
/** A fatal error indicating that no input variable matched the requested name. */
|
|
1207
|
-
interface ComparisonResolverUnknownInputError {
|
|
1208
|
-
|
|
1242
|
+
export interface ComparisonResolverUnknownInputError {
|
|
1243
|
+
kind: 'unknown-input';
|
|
1209
1244
|
}
|
|
1210
1245
|
/** A fatal error indicating that no input setting group matched the requested ID. */
|
|
1211
|
-
interface ComparisonResolverUnknownInputSettingGroupError {
|
|
1212
|
-
|
|
1246
|
+
export interface ComparisonResolverUnknownInputSettingGroupError {
|
|
1247
|
+
kind: 'unknown-input-setting-group';
|
|
1213
1248
|
}
|
|
1214
1249
|
/**
|
|
1215
1250
|
* A fatal resolution error. When this is set on an input state, the scenario
|
|
1216
1251
|
* cannot be run for the affected side: spec construction for that side is
|
|
1217
1252
|
* skipped and downstream UI annotations render it as an error.
|
|
1218
1253
|
*/
|
|
1219
|
-
type ComparisonResolverError = ComparisonResolverUnknownInputError | ComparisonResolverUnknownInputSettingGroupError;
|
|
1254
|
+
export type ComparisonResolverError = ComparisonResolverUnknownInputError | ComparisonResolverUnknownInputSettingGroupError;
|
|
1220
1255
|
/**
|
|
1221
1256
|
* A non-fatal warning indicating that the resolved value falls outside the
|
|
1222
1257
|
* declared `[minValue, maxValue]` range of a slider (or is not one of the
|
|
1223
1258
|
* declared values of a switch). The scenario still runs with the requested
|
|
1224
1259
|
* value; consumers (e.g. UI annotations) should flag it as a warning.
|
|
1225
1260
|
*/
|
|
1226
|
-
interface ComparisonResolverValueOutOfRangeWarning {
|
|
1227
|
-
|
|
1261
|
+
export interface ComparisonResolverValueOutOfRangeWarning {
|
|
1262
|
+
kind: 'value-out-of-range';
|
|
1228
1263
|
}
|
|
1229
1264
|
/**
|
|
1230
1265
|
* A non-fatal resolution warning. Warnings do not prevent the scenario from
|
|
1231
1266
|
* running; they are surfaced as annotations alongside the resolved value.
|
|
1232
1267
|
*/
|
|
1233
|
-
type ComparisonResolverWarning = ComparisonResolverValueOutOfRangeWarning;
|
|
1268
|
+
export type ComparisonResolverWarning = ComparisonResolverValueOutOfRangeWarning;
|
|
1234
1269
|
/** Describes the resolution state for a scenario input relative to a specific model. */
|
|
1235
|
-
interface ComparisonScenarioInputState {
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
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;
|
|
1250
1285
|
}
|
|
1251
1286
|
/** A scenario input that has been checked against both "left" and "right" model. */
|
|
1252
|
-
interface ComparisonScenarioInput {
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
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;
|
|
1259
1294
|
}
|
|
1260
1295
|
/** A configuration that sets model inputs to specific values. */
|
|
1261
|
-
interface ComparisonScenarioInputSettings {
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
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;
|
|
1271
1306
|
}
|
|
1272
1307
|
/** A configuration that sets all inputs in the model to a certain position. */
|
|
1273
|
-
interface ComparisonScenarioAllInputsSettings {
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1308
|
+
export interface ComparisonScenarioAllInputsSettings {
|
|
1309
|
+
kind: 'all-inputs-settings';
|
|
1310
|
+
/** The input position that will be applied to all available inputs. */
|
|
1311
|
+
position: InputPosition;
|
|
1277
1312
|
}
|
|
1278
1313
|
/**
|
|
1279
1314
|
* The configuration for an input scenario, either a set of individual input settings, or one
|
|
1280
1315
|
* that sets all inputs in the model to a certain position.
|
|
1281
1316
|
*/
|
|
1282
|
-
type ComparisonScenarioSettings = ComparisonScenarioInputSettings | ComparisonScenarioAllInputsSettings;
|
|
1317
|
+
export type ComparisonScenarioSettings = ComparisonScenarioInputSettings | ComparisonScenarioAllInputsSettings;
|
|
1283
1318
|
/** A single resolved input scenario. */
|
|
1284
|
-
interface ComparisonScenario {
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
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;
|
|
1300
1335
|
}
|
|
1301
1336
|
/** An unresolved input scenario reference. */
|
|
1302
|
-
interface ComparisonUnresolvedScenarioRef {
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1337
|
+
export interface ComparisonUnresolvedScenarioRef {
|
|
1338
|
+
kind: 'unresolved-scenario-ref';
|
|
1339
|
+
/** The ID of the referenced scenario that could not be resolved. */
|
|
1340
|
+
scenarioId: ComparisonScenarioId;
|
|
1306
1341
|
}
|
|
1307
1342
|
/** A resolved group of input scenarios. */
|
|
1308
|
-
interface ComparisonScenarioGroup {
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
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)[];
|
|
1319
1354
|
}
|
|
1320
1355
|
/** An unresolved scenario group reference. */
|
|
1321
|
-
interface ComparisonUnresolvedScenarioGroupRef {
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
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;
|
|
1325
1360
|
}
|
|
1326
1361
|
/** A resolved group of graphs. */
|
|
1327
|
-
interface ComparisonGraphGroup {
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
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[];
|
|
1333
1368
|
}
|
|
1334
1369
|
/**
|
|
1335
1370
|
* A resolved comparison box to be shown in a view.
|
|
1336
1371
|
*/
|
|
1337
|
-
interface ComparisonViewBox {
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
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;
|
|
1347
1382
|
}
|
|
1348
1383
|
/**
|
|
1349
1384
|
* A resolved row of comparison boxes to be shown in a view.
|
|
1350
1385
|
*/
|
|
1351
|
-
interface ComparisonViewRow {
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
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[];
|
|
1359
1394
|
}
|
|
1360
1395
|
/**
|
|
1361
1396
|
* A resolved view definition. A view presents a set of graphs, either for a single input scenario
|
|
1362
1397
|
* or for a mix of different dataset/scenario combinations.
|
|
1363
1398
|
*/
|
|
1364
|
-
interface ComparisonView {
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
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;
|
|
1378
1413
|
}
|
|
1379
1414
|
/** An unresolved view. */
|
|
1380
|
-
interface ComparisonUnresolvedView {
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
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;
|
|
1394
1429
|
}
|
|
1395
1430
|
/** A resolved group of compared scenario/graph views. */
|
|
1396
|
-
interface ComparisonViewGroup {
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
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)[];
|
|
1402
1437
|
}
|
|
1403
|
-
|
|
1438
|
+
//#endregion
|
|
1439
|
+
//#region src/perf/perf-stats.d.ts
|
|
1404
1440
|
/**
|
|
1405
1441
|
* A summary of timing samples collected during a performance run.
|
|
1406
1442
|
*/
|
|
1407
1443
|
interface PerfReport {
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
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[];
|
|
1425
1461
|
}
|
|
1426
1462
|
/**
|
|
1427
1463
|
* Collect performance timing samples and produce a robust statistical summary.
|
|
1428
1464
|
*/
|
|
1429
|
-
declare class PerfStats {
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
}
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
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
|
|
1468
1506
|
/**
|
|
1469
1507
|
* The report for a single comparison test (involving a dataset produced under
|
|
1470
1508
|
* a specific input scenario). This includes the full `DiffReport`, whereas
|
|
1471
1509
|
* a `ComparisonTestSummary` only includes the `maxDiff` value.
|
|
1472
1510
|
*/
|
|
1473
|
-
interface ComparisonTestReport {
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
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;
|
|
1485
1523
|
}
|
|
1486
1524
|
/**
|
|
1487
1525
|
* A simplified/terse version of `ComparisonTestReport` that is used when writing
|
|
@@ -1489,30 +1527,30 @@ interface ComparisonTestReport {
|
|
|
1489
1527
|
* minimum set of fields (only the `maxDiff` value instead of the full `DiffReport`)
|
|
1490
1528
|
* to keep the file smaller when there are many reported differences.
|
|
1491
1529
|
*/
|
|
1492
|
-
interface ComparisonTestSummary {
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
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;
|
|
1505
1543
|
}
|
|
1506
1544
|
/**
|
|
1507
1545
|
* The roll-up report that contains the results of all individual comparison tests.
|
|
1508
1546
|
*/
|
|
1509
|
-
interface ComparisonReport {
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
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;
|
|
1516
1554
|
}
|
|
1517
1555
|
/**
|
|
1518
1556
|
* A simplified/terse version of `ComparisonReport` that only includes the minimum set
|
|
@@ -1520,417 +1558,423 @@ interface ComparisonReport {
|
|
|
1520
1558
|
* reported differences). This only includes comparison results for which there is
|
|
1521
1559
|
* a non-zero `maxDiff` value.
|
|
1522
1560
|
*/
|
|
1523
|
-
interface ComparisonSummary {
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
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;
|
|
1530
1568
|
}
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
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;
|
|
1534
1573
|
/**
|
|
1535
1574
|
* A group of comparison test summaries associated with a particular scenario or dataset.
|
|
1536
1575
|
*/
|
|
1537
|
-
interface ComparisonGroup {
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
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[];
|
|
1547
1586
|
}
|
|
1548
1587
|
/** Describes the "root" or primary item for a group of comparisons. */
|
|
1549
|
-
type ComparisonGroupRoot = ComparisonDataset | ComparisonScenario;
|
|
1588
|
+
export type ComparisonGroupRoot = ComparisonDataset | ComparisonScenario;
|
|
1550
1589
|
/** A summary of scores for a group of comparisons. */
|
|
1551
|
-
interface ComparisonGroupScores {
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
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[];
|
|
1560
1599
|
}
|
|
1561
1600
|
/**
|
|
1562
1601
|
* A summary of a group of comparisons that includes the resolved scenario/dataset metadata
|
|
1563
1602
|
* and score information for the group.
|
|
1564
1603
|
*/
|
|
1565
|
-
interface ComparisonGroupSummary {
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
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;
|
|
1572
1611
|
}
|
|
1573
1612
|
/**
|
|
1574
1613
|
* Breaks down a set of by-scenario or by-dataset groupings into distinct categories.
|
|
1575
1614
|
*/
|
|
1576
|
-
interface ComparisonGroupSummariesByCategory {
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
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[];
|
|
1606
1645
|
}
|
|
1607
1646
|
/**
|
|
1608
1647
|
* Rolls up all by-scenario and by-dataset groupings.
|
|
1609
1648
|
*/
|
|
1610
|
-
interface ComparisonCategorizedResults {
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
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;
|
|
1617
1656
|
}
|
|
1618
|
-
|
|
1657
|
+
//#endregion
|
|
1658
|
+
//#region src/comparison/config/comparison-datasets.d.ts
|
|
1619
1659
|
/**
|
|
1620
1660
|
* Provides access to the set of dataset definitions (`ComparisonDataset` instances) that are used
|
|
1621
1661
|
* when comparing the two models.
|
|
1622
1662
|
*/
|
|
1623
1663
|
interface ComparisonDatasets {
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
}
|
|
1656
|
-
|
|
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
|
|
1657
1698
|
interface ComparisonScenarios {
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
}
|
|
1669
|
-
|
|
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
|
|
1670
1712
|
/**
|
|
1671
1713
|
* Describes an extra plot to be shown in a comparison graph.
|
|
1672
1714
|
*/
|
|
1673
1715
|
interface ComparisonPlot {
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
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;
|
|
1682
1724
|
}
|
|
1683
1725
|
interface ComparisonDatasetOptions {
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
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[];
|
|
1711
1753
|
}
|
|
1712
1754
|
/**
|
|
1713
1755
|
* Describes a row in the comparison report summary view.
|
|
1714
1756
|
*/
|
|
1715
1757
|
interface ComparisonReportSummaryRow {
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
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;
|
|
1722
1764
|
}
|
|
1723
1765
|
/**
|
|
1724
1766
|
* Describes a section in the comparison report summary view.
|
|
1725
1767
|
*/
|
|
1726
1768
|
interface ComparisonReportSummarySection {
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
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;
|
|
1746
1788
|
}
|
|
1747
1789
|
/**
|
|
1748
1790
|
* Describes an item (box) in the comparison report detail view.
|
|
1749
1791
|
*/
|
|
1750
1792
|
interface ComparisonReportDetailItem {
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
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;
|
|
1759
1801
|
}
|
|
1760
1802
|
/**
|
|
1761
1803
|
* Describes a row in the comparison report detail view.
|
|
1762
1804
|
*/
|
|
1763
1805
|
interface ComparisonReportDetailRow {
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
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[];
|
|
1772
1814
|
}
|
|
1773
1815
|
interface ComparisonReportOptions {
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
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[];
|
|
1806
1848
|
}
|
|
1807
1849
|
interface ComparisonOptions {
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
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;
|
|
1829
1871
|
}
|
|
1830
1872
|
interface ComparisonConfig {
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
}
|
|
1854
|
-
|
|
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
|
|
1855
1898
|
type ComparisonDataRequestKey = string;
|
|
1856
1899
|
/**
|
|
1857
1900
|
* Options for `requestDatasetMaps`.
|
|
1858
1901
|
*/
|
|
1859
1902
|
interface RequestDatasetMapsOptions {
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
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[];
|
|
1868
1911
|
}
|
|
1869
1912
|
/**
|
|
1870
1913
|
* Coordinates loading of data in parallel from two models.
|
|
1871
1914
|
*/
|
|
1872
|
-
declare class ComparisonDataCoordinator {
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
}
|
|
1910
|
-
declare function createComparisonDataCoordinator(): ComparisonDataCoordinator;
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
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[];
|
|
1934
1978
|
}
|
|
1935
1979
|
/**
|
|
1936
1980
|
* Comparison the metadata and datasets for the given graphs.
|
|
@@ -1940,8 +1984,9 @@ interface GraphComparisonReport {
|
|
|
1940
1984
|
* @param scenarioKey The key of the scenario used for comparing datasets.
|
|
1941
1985
|
* @param testSummaries The set of test summaries from a previous comparison run.
|
|
1942
1986
|
*/
|
|
1943
|
-
declare function diffGraphs(graphL: BundleGraphSpec | undefined, graphR: BundleGraphSpec | undefined, scenarioKey: ComparisonScenarioKey, testSummaries: ComparisonTestSummary[]): GraphComparisonReport;
|
|
1944
|
-
|
|
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
|
|
1945
1990
|
/**
|
|
1946
1991
|
* Convert a full `ComparisonReport` to a simplified `ComparisonSummary` that includes
|
|
1947
1992
|
* the minimum set of fields needed to keep the file smaller when there are many
|
|
@@ -1951,7 +1996,7 @@ declare function diffGraphs(graphL: BundleGraphSpec | undefined, graphR: BundleG
|
|
|
1951
1996
|
* @param comparisonReport The full comparison report.
|
|
1952
1997
|
* @return The terse summary.
|
|
1953
1998
|
*/
|
|
1954
|
-
declare function comparisonSummaryFromReport(comparisonReport: ComparisonReport): ComparisonSummary;
|
|
1999
|
+
export declare function comparisonSummaryFromReport(comparisonReport: ComparisonReport): ComparisonSummary;
|
|
1955
2000
|
/**
|
|
1956
2001
|
* Convert a full `ComparisonTestReport` to a terse `ComparisonTestSummary`. This will
|
|
1957
2002
|
* return undefined if the test has a zero `maxDiff` value.
|
|
@@ -1961,11 +2006,13 @@ declare function comparisonSummaryFromReport(comparisonReport: ComparisonReport)
|
|
|
1961
2006
|
* @param baselineAvgDiff The avg diff for the baseline scenario, or undefined if not available.
|
|
1962
2007
|
* @return The terse comparison test summary.
|
|
1963
2008
|
*/
|
|
1964
|
-
declare function testSummaryFromReport(r: ComparisonTestReport, baselineMaxDiff: number | undefined, baselineAvgDiff: number | undefined): ComparisonTestSummary | undefined;
|
|
1965
|
-
|
|
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
|
|
1966
2012
|
/** The available sort modes for categorizing comparison groups. */
|
|
1967
2013
|
type ComparisonSortMode = 'max-diff' | 'avg-diff' | 'max-diff-relative' | 'avg-diff-relative';
|
|
1968
|
-
|
|
2014
|
+
//#endregion
|
|
2015
|
+
//#region src/comparison/report/comparison-group-scores.d.ts
|
|
1969
2016
|
/**
|
|
1970
2017
|
* Compute the overall scores for the given group of comparison test summaries.
|
|
1971
2018
|
*
|
|
@@ -1974,8 +2021,9 @@ type ComparisonSortMode = 'max-diff' | 'avg-diff' | 'max-diff-relative' | 'avg-d
|
|
|
1974
2021
|
* the scores will be summarized.
|
|
1975
2022
|
* @param sortMode The sort mode to determine which field to use for scoring.
|
|
1976
2023
|
*/
|
|
1977
|
-
declare function getScoresForTestSummaries(testSummaries: ComparisonTestSummary[], thresholds: number[], sortMode: ComparisonSortMode): ComparisonGroupScores;
|
|
1978
|
-
|
|
2024
|
+
export declare function getScoresForTestSummaries(testSummaries: ComparisonTestSummary[], thresholds: number[], sortMode: ComparisonSortMode): ComparisonGroupScores;
|
|
2025
|
+
//#endregion
|
|
2026
|
+
//#region src/comparison/report/comparison-grouping.d.ts
|
|
1979
2027
|
/**
|
|
1980
2028
|
* Given a set of terse test summaries (which only includes summaries for tests with non-zero `maxDiff`
|
|
1981
2029
|
* scores), restore the full set of summaries and then categorize them.
|
|
@@ -1984,74 +2032,77 @@ declare function getScoresForTestSummaries(testSummaries: ComparisonTestSummary[
|
|
|
1984
2032
|
* @param terseSummaries The set of terse test summaries.
|
|
1985
2033
|
* @param sortMode The sort mode to determine which field to use for scoring.
|
|
1986
2034
|
*/
|
|
1987
|
-
declare function categorizeComparisonTestSummaries(comparisonConfig: ComparisonConfig, terseSummaries: ComparisonTestSummary[], sortMode: ComparisonSortMode): ComparisonCategorizedResults;
|
|
1988
|
-
|
|
2035
|
+
export declare function categorizeComparisonTestSummaries(comparisonConfig: ComparisonConfig, terseSummaries: ComparisonTestSummary[], sortMode: ComparisonSortMode): ComparisonCategorizedResults;
|
|
2036
|
+
//#endregion
|
|
2037
|
+
//#region src/config/config-types.d.ts
|
|
1989
2038
|
/**
|
|
1990
2039
|
* Additional options that are passed to `getConfigOptions`.
|
|
1991
2040
|
*/
|
|
1992
2041
|
interface ConfigInitOptions {
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
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;
|
|
1997
2046
|
}
|
|
1998
2047
|
/**
|
|
1999
2048
|
* The user-specified options used by the library to resolve and initialize a `Config` instance.
|
|
2000
2049
|
*/
|
|
2001
2050
|
interface ConfigOptions {
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
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;
|
|
2030
2079
|
}
|
|
2031
2080
|
/**
|
|
2032
2081
|
* The resolved configuration for check and comparison tests.
|
|
2033
2082
|
*/
|
|
2034
2083
|
interface Config {
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
}
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
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
|
|
2043
2094
|
type CancelRunPerf = () => void;
|
|
2044
2095
|
interface RunPerfCallbacks {
|
|
2045
|
-
|
|
2046
|
-
|
|
2096
|
+
onComplete?: (reportL: PerfReport, reportR: PerfReport) => void;
|
|
2097
|
+
onError?: (error: Error) => void;
|
|
2047
2098
|
}
|
|
2048
2099
|
interface RunPerfOptions {
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
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;
|
|
2055
2106
|
}
|
|
2056
2107
|
/**
|
|
2057
2108
|
* Run performance tests on the bundle models.
|
|
@@ -2060,8 +2111,9 @@ interface RunPerfOptions {
|
|
|
2060
2111
|
* @param options The options for the performance run.
|
|
2061
2112
|
* @return A function that will cancel the process when invoked.
|
|
2062
2113
|
*/
|
|
2063
|
-
declare function runPerf(callbacks: RunPerfCallbacks, options?: RunPerfOptions): CancelRunPerf;
|
|
2064
|
-
|
|
2114
|
+
export declare function runPerf(callbacks: RunPerfCallbacks, options?: RunPerfOptions): CancelRunPerf;
|
|
2115
|
+
//#endregion
|
|
2116
|
+
//#region src/trace/trace-report.d.ts
|
|
2065
2117
|
/**
|
|
2066
2118
|
* The report for a single trace comparison between two datasets.
|
|
2067
2119
|
*
|
|
@@ -2069,41 +2121,42 @@ declare function runPerf(callbacks: RunPerfCallbacks, options?: RunPerfOptions):
|
|
|
2069
2121
|
* diff points. Maybe we can combine them and make the points array an opt-in thing.
|
|
2070
2122
|
*/
|
|
2071
2123
|
interface TraceDatasetReport {
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
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;
|
|
2081
2133
|
}
|
|
2082
2134
|
/**
|
|
2083
2135
|
* The roll-up report that contains the results of the trace comparisons
|
|
2084
2136
|
* for all datasets.
|
|
2085
2137
|
*/
|
|
2086
2138
|
interface TraceReport {
|
|
2087
|
-
|
|
2139
|
+
datasetReports: Map<DatasetKey, TraceDatasetReport>;
|
|
2088
2140
|
}
|
|
2089
|
-
|
|
2141
|
+
//#endregion
|
|
2142
|
+
//#region src/trace/trace-runner.d.ts
|
|
2090
2143
|
type CancelRunTrace = () => void;
|
|
2091
2144
|
interface RunTraceCallbacks {
|
|
2092
|
-
|
|
2093
|
-
|
|
2145
|
+
onComplete?: (traceReport: TraceReport) => void;
|
|
2146
|
+
onError?: (error: Error) => void;
|
|
2094
2147
|
}
|
|
2095
2148
|
interface TraceCompareToBundleOptions {
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2149
|
+
kind: 'compare-to-bundle';
|
|
2150
|
+
bundleSide0: 'left' | 'right';
|
|
2151
|
+
scenarioSpec0: ScenarioSpec;
|
|
2152
|
+
bundleSide1: 'left' | 'right';
|
|
2153
|
+
scenarioSpec1: ScenarioSpec;
|
|
2101
2154
|
}
|
|
2102
2155
|
interface TraceCompareToExtDataOptions {
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2156
|
+
kind: 'compare-to-ext-data';
|
|
2157
|
+
extData: DatasetMap;
|
|
2158
|
+
bundleSide: 'left' | 'right';
|
|
2159
|
+
scenarioSpec: ScenarioSpec;
|
|
2107
2160
|
}
|
|
2108
2161
|
type TraceOptions = TraceCompareToBundleOptions | TraceCompareToExtDataOptions;
|
|
2109
2162
|
/**
|
|
@@ -2114,16 +2167,17 @@ type TraceOptions = TraceCompareToBundleOptions | TraceCompareToExtDataOptions;
|
|
|
2114
2167
|
* @param options Options to control how the trace is run.
|
|
2115
2168
|
* @return A function that will cancel the process when invoked.
|
|
2116
2169
|
*/
|
|
2117
|
-
declare function runTrace(modelSpec: ModelSpec, callbacks: RunTraceCallbacks, options: TraceOptions): CancelRunTrace;
|
|
2118
|
-
|
|
2170
|
+
export declare function runTrace(modelSpec: ModelSpec, callbacks: RunTraceCallbacks, options: TraceOptions): CancelRunTrace;
|
|
2171
|
+
//#endregion
|
|
2172
|
+
//#region src/suite/suite-report-types.d.ts
|
|
2119
2173
|
/**
|
|
2120
2174
|
* The report for a single run of the full check+comparison test suite.
|
|
2121
2175
|
*/
|
|
2122
|
-
interface SuiteReport {
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2176
|
+
export interface SuiteReport {
|
|
2177
|
+
/** The check report. */
|
|
2178
|
+
checkReport: CheckReport;
|
|
2179
|
+
/** The comparison report (only defined if comparisons were enabled). */
|
|
2180
|
+
comparisonReport?: ComparisonReport;
|
|
2127
2181
|
}
|
|
2128
2182
|
/**
|
|
2129
2183
|
* A simplified/terse version of `SuiteReport` that is used when writing
|
|
@@ -2132,34 +2186,35 @@ interface SuiteReport {
|
|
|
2132
2186
|
* full `DiffReport` for each comparison test) to keep the file smaller
|
|
2133
2187
|
* when there are many reported differences.
|
|
2134
2188
|
*/
|
|
2135
|
-
interface SuiteSummary {
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
}
|
|
2145
|
-
|
|
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
|
|
2146
2201
|
type CancelRunSuite = () => void;
|
|
2147
2202
|
interface RunSuiteCallbacks {
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2203
|
+
onProgress?: (pct: number) => void;
|
|
2204
|
+
onComplete?: (suiteReport: SuiteReport) => void;
|
|
2205
|
+
onError?: (error: Error) => void;
|
|
2151
2206
|
}
|
|
2152
2207
|
interface RunSuiteOptions {
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
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[];
|
|
2163
2218
|
}
|
|
2164
2219
|
/**
|
|
2165
2220
|
* Run the full suite of checks and comparisons defined in the given configuration.
|
|
@@ -2169,8 +2224,9 @@ interface RunSuiteOptions {
|
|
|
2169
2224
|
* @param options Options to control how the tests are run.
|
|
2170
2225
|
* @return A function that will cancel the process when invoked.
|
|
2171
2226
|
*/
|
|
2172
|
-
declare function runSuite(config: Config, callbacks: RunSuiteCallbacks, options?: RunSuiteOptions): CancelRunSuite;
|
|
2173
|
-
|
|
2227
|
+
export declare function runSuite(config: Config, callbacks: RunSuiteCallbacks, options?: RunSuiteOptions): CancelRunSuite;
|
|
2228
|
+
//#endregion
|
|
2229
|
+
//#region src/suite/suite-reporting.d.ts
|
|
2174
2230
|
/**
|
|
2175
2231
|
* Convert a full `SuiteReport` to a simplified `SuiteSummary` that only includes
|
|
2176
2232
|
* failed/errored checks or comparisons with differences.
|
|
@@ -2179,6 +2235,7 @@ declare function runSuite(config: Config, callbacks: RunSuiteCallbacks, options?
|
|
|
2179
2235
|
* @param elapsedMillis The time in milliseconds that it took to run the suite.
|
|
2180
2236
|
* @return The converted suite summary.
|
|
2181
2237
|
*/
|
|
2182
|
-
declare function suiteSummaryFromReport(suiteReport: SuiteReport, elapsedMillis: number): SuiteSummary;
|
|
2183
|
-
|
|
2184
|
-
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
|