@sdeverywhere/check-core 0.1.3 → 0.1.5
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.cjs +131 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +286 -168
- package/dist/index.d.ts +286 -168
- package/dist/index.js +131 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -149,6 +149,8 @@ interface ImplVar {
|
|
|
149
149
|
type InputGroupName = string;
|
|
150
150
|
/** The alias name for an input. */
|
|
151
151
|
type InputAliasName = string;
|
|
152
|
+
/** The name for a custom input setting group. */
|
|
153
|
+
type InputSettingGroupId = string;
|
|
152
154
|
/** The human-readable name for a group of dataset. */
|
|
153
155
|
type DatasetGroupName = string;
|
|
154
156
|
/**
|
|
@@ -235,6 +237,8 @@ interface ModelSpec {
|
|
|
235
237
|
inputAliases?: Map<InputAliasName, VarId>;
|
|
236
238
|
/** The custom input variable groups defined for this model. */
|
|
237
239
|
inputGroups?: Map<InputGroupName, InputVar[]>;
|
|
240
|
+
/** The custom input setting groups defined for this model. */
|
|
241
|
+
inputSettingGroups?: Map<InputSettingGroupId, InputSetting[]>;
|
|
238
242
|
/** The custom dataset (output variable) groups defined for this model. */
|
|
239
243
|
datasetGroups?: Map<DatasetGroupName, DatasetKey[]>;
|
|
240
244
|
/** The start time (year) for the model. */
|
|
@@ -575,6 +579,21 @@ interface ComparisonScenarioWithDistinctInputsSpec {
|
|
|
575
579
|
/** The input settings for this scenario when run with the "right" model. */
|
|
576
580
|
inputsR: ComparisonScenarioInputSpec[];
|
|
577
581
|
}
|
|
582
|
+
/**
|
|
583
|
+
* Specifies a single scenario that configures inputs according to the setting
|
|
584
|
+
* group defined for each model instance.
|
|
585
|
+
*/
|
|
586
|
+
interface ComparisonScenarioWithSettingGroupSpec {
|
|
587
|
+
kind: 'scenario-with-setting-group';
|
|
588
|
+
/** The unique identifier for the scenario. */
|
|
589
|
+
id?: ComparisonScenarioId;
|
|
590
|
+
/** The title of the scenario. */
|
|
591
|
+
title?: ComparisonScenarioTitle;
|
|
592
|
+
/** The subtitle of the scenario. */
|
|
593
|
+
subtitle?: ComparisonScenarioSubtitle;
|
|
594
|
+
/** The identifier of the input setting group as used in `ModelSpec.inputSettingGroups`. */
|
|
595
|
+
settingGroupId: InputSettingGroupId;
|
|
596
|
+
}
|
|
578
597
|
/**
|
|
579
598
|
* Specifies a single scenario that sets all available inputs to position.
|
|
580
599
|
*/
|
|
@@ -603,7 +622,7 @@ interface ComparisonScenarioPresetMatrixSpec {
|
|
|
603
622
|
* A definition of input scenario(s). A scenario can set one input to a value/position, or it
|
|
604
623
|
* can set multiple inputs to particular values/positions.
|
|
605
624
|
*/
|
|
606
|
-
type ComparisonScenarioSpec = ComparisonScenarioWithInputsSpec | ComparisonScenarioWithDistinctInputsSpec | ComparisonScenarioWithAllInputsSpec | ComparisonScenarioPresetMatrixSpec;
|
|
625
|
+
type ComparisonScenarioSpec = ComparisonScenarioWithInputsSpec | ComparisonScenarioWithDistinctInputsSpec | ComparisonScenarioWithSettingGroupSpec | ComparisonScenarioWithAllInputsSpec | ComparisonScenarioPresetMatrixSpec;
|
|
607
626
|
/** A reference to a scenario definition. */
|
|
608
627
|
interface ComparisonScenarioRefSpec {
|
|
609
628
|
kind: 'scenario-ref';
|
|
@@ -809,10 +828,13 @@ type ComparisonScenarioKey = string & {
|
|
|
809
828
|
interface ComparisonResolverUnknownInputError {
|
|
810
829
|
kind: 'unknown-input';
|
|
811
830
|
}
|
|
831
|
+
interface ComparisonResolverUnknownInputSettingGroupError {
|
|
832
|
+
kind: 'unknown-input-setting-group';
|
|
833
|
+
}
|
|
812
834
|
interface ComparisonResolverInvalidValueError {
|
|
813
835
|
kind: 'invalid-value';
|
|
814
836
|
}
|
|
815
|
-
type ComparisonResolverError = ComparisonResolverUnknownInputError | ComparisonResolverInvalidValueError;
|
|
837
|
+
type ComparisonResolverError = ComparisonResolverUnknownInputError | ComparisonResolverUnknownInputSettingGroupError | ComparisonResolverInvalidValueError;
|
|
816
838
|
/** Describes the resolution state for a scenario input relative to a specific model. */
|
|
817
839
|
interface ComparisonScenarioInputState {
|
|
818
840
|
/** The matched input variable; can be undefined if no input matched. */
|
|
@@ -838,6 +860,12 @@ interface ComparisonScenarioInputSettings {
|
|
|
838
860
|
kind: 'input-settings';
|
|
839
861
|
/** The resolutions for the specified inputs in the scenario. */
|
|
840
862
|
inputs: ComparisonScenarioInput[];
|
|
863
|
+
/**
|
|
864
|
+
* Whether the settings differ between the "left" and "right" models. This is
|
|
865
|
+
* typically only used in the case of a scenario based on model-specific setting
|
|
866
|
+
* groups, where the set of inputs or the input values differ between the two models.
|
|
867
|
+
*/
|
|
868
|
+
settingsDiffer?: boolean;
|
|
841
869
|
}
|
|
842
870
|
/** A configuration that sets all inputs in the model to a certain position. */
|
|
843
871
|
interface ComparisonScenarioAllInputsSettings {
|
|
@@ -971,6 +999,171 @@ interface ComparisonViewGroup {
|
|
|
971
999
|
views: (ComparisonView | ComparisonUnresolvedView)[];
|
|
972
1000
|
}
|
|
973
1001
|
|
|
1002
|
+
interface PerfReport {
|
|
1003
|
+
readonly minTime: number;
|
|
1004
|
+
readonly maxTime: number;
|
|
1005
|
+
readonly avgTime: number;
|
|
1006
|
+
readonly allTimes: number[];
|
|
1007
|
+
}
|
|
1008
|
+
declare class PerfStats {
|
|
1009
|
+
private readonly times;
|
|
1010
|
+
addRun(timeInMillis: number): void;
|
|
1011
|
+
toReport(): PerfReport;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
interface DiffPoint {
|
|
1015
|
+
time: number;
|
|
1016
|
+
valueL: number;
|
|
1017
|
+
valueR: number;
|
|
1018
|
+
}
|
|
1019
|
+
type DiffValidity = 'neither' | 'left-only' | 'right-only' | 'both';
|
|
1020
|
+
interface DiffReport {
|
|
1021
|
+
validity: DiffValidity;
|
|
1022
|
+
minValue: number;
|
|
1023
|
+
maxValue: number;
|
|
1024
|
+
avgDiff: number;
|
|
1025
|
+
minDiff: number;
|
|
1026
|
+
maxDiff: number;
|
|
1027
|
+
maxDiffPoint: DiffPoint;
|
|
1028
|
+
}
|
|
1029
|
+
declare function diffDatasets(datasetL: Dataset | undefined, datasetR: Dataset | undefined): DiffReport;
|
|
1030
|
+
|
|
1031
|
+
/**
|
|
1032
|
+
* The report for a single comparison test (involving a dataset produced under
|
|
1033
|
+
* a specific input scenario). This includes the full `DiffReport`, whereas
|
|
1034
|
+
* a `ComparisonTestSummary` only includes the `maxDiff` value.
|
|
1035
|
+
*/
|
|
1036
|
+
interface ComparisonTestReport {
|
|
1037
|
+
scenarioKey: ComparisonScenarioKey;
|
|
1038
|
+
datasetKey: DatasetKey;
|
|
1039
|
+
diffReport: DiffReport;
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* A simplified/terse version of `ComparisonTestReport` that is used when writing
|
|
1043
|
+
* results to a JSON file. The object keys are terse and it only includes the
|
|
1044
|
+
* minimum set of fields (only the `maxDiff` value instead of the full `DiffReport`)
|
|
1045
|
+
* to keep the file smaller when there are many reported differences.
|
|
1046
|
+
*/
|
|
1047
|
+
interface ComparisonTestSummary {
|
|
1048
|
+
/** Short for `scenarioKey`. */
|
|
1049
|
+
s: ComparisonScenarioKey;
|
|
1050
|
+
/** Short for `datasetKey`. */
|
|
1051
|
+
d: DatasetKey;
|
|
1052
|
+
/** Short for `maxDiff`. */
|
|
1053
|
+
md: number;
|
|
1054
|
+
}
|
|
1055
|
+
/**
|
|
1056
|
+
* The roll-up report that contains the results of all individual comparison tests.
|
|
1057
|
+
*/
|
|
1058
|
+
interface ComparisonReport {
|
|
1059
|
+
/** The set of all comparison test reports. */
|
|
1060
|
+
testReports: ComparisonTestReport[];
|
|
1061
|
+
/** The perf report for the "left" model. */
|
|
1062
|
+
perfReportL: PerfReport;
|
|
1063
|
+
/** The perf report for the "right" model. */
|
|
1064
|
+
perfReportR: PerfReport;
|
|
1065
|
+
}
|
|
1066
|
+
/**
|
|
1067
|
+
* A simplified/terse version of `ComparisonReport` that only includes the minimum set
|
|
1068
|
+
* of fields needed by the reporting app (to keep the file smaller when there are many
|
|
1069
|
+
* reported differences). This only includes comparison results for which there is
|
|
1070
|
+
* a non-zero `maxDiff` value.
|
|
1071
|
+
*/
|
|
1072
|
+
interface ComparisonSummary {
|
|
1073
|
+
/** The simplified set of all terse comparison test summaries. */
|
|
1074
|
+
testSummaries: ComparisonTestSummary[];
|
|
1075
|
+
/** The perf report for the "left" model. */
|
|
1076
|
+
perfReportL: PerfReport;
|
|
1077
|
+
/** The perf report for the "right" model. */
|
|
1078
|
+
perfReportR: PerfReport;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
type ComparisonGroupKind = 'by-dataset' | 'by-scenario';
|
|
1082
|
+
type ComparisonGroupKey = string;
|
|
1083
|
+
/**
|
|
1084
|
+
* A group of comparison test summaries associated with a particular scenario or dataset.
|
|
1085
|
+
*/
|
|
1086
|
+
interface ComparisonGroup {
|
|
1087
|
+
/** The kind of group, either 'by-dataset' or 'by-scenario'. */
|
|
1088
|
+
kind: ComparisonGroupKind;
|
|
1089
|
+
/**
|
|
1090
|
+
* The unique key for this group (a `DatasetKey` if grouped by dataset, or a
|
|
1091
|
+
* `ComparisonScenarioKey` if grouped by scenario).
|
|
1092
|
+
*/
|
|
1093
|
+
key: ComparisonGroupKey;
|
|
1094
|
+
/** The comparison test summaries for this group. */
|
|
1095
|
+
testSummaries: ComparisonTestSummary[];
|
|
1096
|
+
}
|
|
1097
|
+
/** Describes the "root" or primary item for a group of comparisons. */
|
|
1098
|
+
type ComparisonGroupRoot = ComparisonDataset | ComparisonScenario;
|
|
1099
|
+
/** A summary of scores for a group of comparisons. */
|
|
1100
|
+
interface ComparisonGroupScores {
|
|
1101
|
+
/** The total number of comparisons (sample size) for this group. */
|
|
1102
|
+
totalDiffCount: number;
|
|
1103
|
+
/** The sum of the `maxDiff` values for each threshold bucket. */
|
|
1104
|
+
totalMaxDiffByBucket: number[];
|
|
1105
|
+
/** The number of comparisons that fall into each threshold bucket. */
|
|
1106
|
+
diffCountByBucket: number[];
|
|
1107
|
+
/** The percentage of comparisons that fall into each threshold bucket. */
|
|
1108
|
+
diffPercentByBucket: number[];
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* A summary of a group of comparisons that includes the resolved scenario/dataset metadata
|
|
1112
|
+
* and score information for the group.
|
|
1113
|
+
*/
|
|
1114
|
+
interface ComparisonGroupSummary {
|
|
1115
|
+
/** The metadata for the "root" or primary item for this group of comparisons. */
|
|
1116
|
+
root: ComparisonGroupRoot;
|
|
1117
|
+
/** The group containing the comparison summaries. */
|
|
1118
|
+
group: ComparisonGroup;
|
|
1119
|
+
/** The scores for this group, or undefined if comparisons were not performed for this group. */
|
|
1120
|
+
scores?: ComparisonGroupScores;
|
|
1121
|
+
}
|
|
1122
|
+
/**
|
|
1123
|
+
* Breaks down a set of by-scenario or by-dataset groupings into distinct categories.
|
|
1124
|
+
*/
|
|
1125
|
+
interface ComparisonGroupSummariesByCategory {
|
|
1126
|
+
/**
|
|
1127
|
+
* All groups in a map, keyed by "group key" (either a dataset key or scenario key).
|
|
1128
|
+
*/
|
|
1129
|
+
allGroupSummaries: Map<ComparisonGroupKey, ComparisonGroupSummary>;
|
|
1130
|
+
/**
|
|
1131
|
+
* Groups with items that have errors (are not valid) for both "left" and "right" models.
|
|
1132
|
+
*/
|
|
1133
|
+
withErrors: ComparisonGroupSummary[];
|
|
1134
|
+
/**
|
|
1135
|
+
* Groups with items that are only valid for the "left" model (for example, datasets that
|
|
1136
|
+
* were removed and no longer available in the "right" model).
|
|
1137
|
+
*/
|
|
1138
|
+
onlyInLeft: ComparisonGroupSummary[];
|
|
1139
|
+
/**
|
|
1140
|
+
* Groups with items that are only valid for the "right" model (for example, scenarios
|
|
1141
|
+
* for inputs that were added in the "right" model).
|
|
1142
|
+
*/
|
|
1143
|
+
onlyInRight: ComparisonGroupSummary[];
|
|
1144
|
+
/**
|
|
1145
|
+
* Groups with one or more comparisons that have non-zero `maxDiff` scores; the groups
|
|
1146
|
+
* will be sorted by `maxDiff`, with higher scores at the front of the array.
|
|
1147
|
+
*/
|
|
1148
|
+
withDiffs: ComparisonGroupSummary[];
|
|
1149
|
+
/**
|
|
1150
|
+
* Groups where all comparisons have `maxDiff` scores of zero (no differences between
|
|
1151
|
+
* "left" and "right").
|
|
1152
|
+
*/
|
|
1153
|
+
withoutDiffs: ComparisonGroupSummary[];
|
|
1154
|
+
}
|
|
1155
|
+
/**
|
|
1156
|
+
* Rolls up all by-scenario and by-dataset groupings.
|
|
1157
|
+
*/
|
|
1158
|
+
interface ComparisonCategorizedResults {
|
|
1159
|
+
/** All summaries for the comparison tests that were performed. */
|
|
1160
|
+
allTestSummaries: ComparisonTestSummary[];
|
|
1161
|
+
/** The full set of by-scenario groupings. */
|
|
1162
|
+
byScenario: ComparisonGroupSummariesByCategory;
|
|
1163
|
+
/** The full set of by-dataset groupings. */
|
|
1164
|
+
byDataset: ComparisonGroupSummariesByCategory;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
974
1167
|
/**
|
|
975
1168
|
* Provides access to the set of dataset definitions (`ComparisonDataset` instances) that are used
|
|
976
1169
|
* when comparing the two models.
|
|
@@ -1064,6 +1257,92 @@ interface ComparisonDatasetOptions {
|
|
|
1064
1257
|
*/
|
|
1065
1258
|
contextGraphIdsForDataset?: (dataset: ComparisonDataset, scenario: ComparisonScenario) => BundleGraphId[];
|
|
1066
1259
|
}
|
|
1260
|
+
/**
|
|
1261
|
+
* Describes a row in the comparison report summary view.
|
|
1262
|
+
*/
|
|
1263
|
+
interface ComparisonReportSummaryRow {
|
|
1264
|
+
/** The group summary represented by the row. */
|
|
1265
|
+
groupSummary: ComparisonGroupSummary;
|
|
1266
|
+
/** The custom title for the row (this overrides the default title derived from the summary). */
|
|
1267
|
+
title?: string;
|
|
1268
|
+
/** The custom subtitle for the row (this overrides the default subtitle derived from the summary). */
|
|
1269
|
+
subtitle?: string;
|
|
1270
|
+
}
|
|
1271
|
+
/**
|
|
1272
|
+
* Describes a section in the comparison report summary view.
|
|
1273
|
+
*/
|
|
1274
|
+
interface ComparisonReportSummarySection {
|
|
1275
|
+
/** The text to display for the section header. */
|
|
1276
|
+
headerText: string;
|
|
1277
|
+
/** The summary rows to display in the section. */
|
|
1278
|
+
rows: ComparisonReportSummaryRow[];
|
|
1279
|
+
/**
|
|
1280
|
+
* The initial expanded state of the section. If undefined, defaults to 'expanded-if-diffs',
|
|
1281
|
+
* meaning the section will be initially expanded only if any rows have differences, otherwise
|
|
1282
|
+
* it will be initially collapsed.
|
|
1283
|
+
*/
|
|
1284
|
+
initialState?: 'collapsed' | 'expanded' | 'expanded-if-diffs';
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* Describes an item (box) in the comparison report detail view.
|
|
1288
|
+
*/
|
|
1289
|
+
interface ComparisonReportDetailItem {
|
|
1290
|
+
/** The title of the item. */
|
|
1291
|
+
title: string;
|
|
1292
|
+
/** The subtitle of the item (if any). */
|
|
1293
|
+
subtitle?: string;
|
|
1294
|
+
/** The scenario for the item. */
|
|
1295
|
+
scenario: ComparisonScenario;
|
|
1296
|
+
/** The test summary for the item. */
|
|
1297
|
+
testSummary: ComparisonTestSummary;
|
|
1298
|
+
}
|
|
1299
|
+
/**
|
|
1300
|
+
* Describes a row in the comparison report detail view.
|
|
1301
|
+
*/
|
|
1302
|
+
interface ComparisonReportDetailRow {
|
|
1303
|
+
/** The title of the row. */
|
|
1304
|
+
title: string;
|
|
1305
|
+
/** The subtitle of the row (if any). */
|
|
1306
|
+
subtitle?: string;
|
|
1307
|
+
/** The score for the row (the meaning of the value depends on the chosen statistical method). */
|
|
1308
|
+
score: number;
|
|
1309
|
+
/** The items in this row (one item per box). */
|
|
1310
|
+
items: ComparisonReportDetailItem[];
|
|
1311
|
+
}
|
|
1312
|
+
interface ComparisonReportOptions {
|
|
1313
|
+
/**
|
|
1314
|
+
* An optional function that allows for customizing the order and grouping of
|
|
1315
|
+
* sections and rows in the "comparisons by scenario" summary view.
|
|
1316
|
+
*
|
|
1317
|
+
* @param summaries The comparison summaries, one summary per scenario.
|
|
1318
|
+
* @returns The sections to display in the "comparisons by scenario" summary view.
|
|
1319
|
+
*/
|
|
1320
|
+
summarySectionsForComparisonsByScenario?: (summaries: ComparisonGroupSummariesByCategory) => ComparisonReportSummarySection[];
|
|
1321
|
+
/**
|
|
1322
|
+
* An optional function that allows for customizing the order and grouping of
|
|
1323
|
+
* sections and rows in the "comparisons by dataset" summary view.
|
|
1324
|
+
*
|
|
1325
|
+
* @param summaries The comparison summaries, one summary per dataset.
|
|
1326
|
+
* @returns The sections to display in the "comparisons by dataset" summary view.
|
|
1327
|
+
*/
|
|
1328
|
+
summarySectionsForComparisonsByDataset?: (summaries: ComparisonGroupSummariesByCategory) => ComparisonReportSummarySection[];
|
|
1329
|
+
/**
|
|
1330
|
+
* An optional function that allows for customizing the order of rows and boxes
|
|
1331
|
+
* in the detail view for a scenario.
|
|
1332
|
+
*
|
|
1333
|
+
* @param rows The original rows to be displayed in the detail view for a scenario.
|
|
1334
|
+
* @returns The customized rows to display in the detail view for a scenario.
|
|
1335
|
+
*/
|
|
1336
|
+
detailRowsForScenario?: (rows: ComparisonReportDetailRow[]) => ComparisonReportDetailRow[];
|
|
1337
|
+
/**
|
|
1338
|
+
* An optional function that allows for customizing the order of rows and boxes
|
|
1339
|
+
* in the detail view for a dataset.
|
|
1340
|
+
*
|
|
1341
|
+
* @param rows The original rows to be displayed in the detail view for a dataset.
|
|
1342
|
+
* @returns The customized rows to display in the detail view for a dataset.
|
|
1343
|
+
*/
|
|
1344
|
+
detailRowsForDataset?: (rows: ComparisonReportDetailRow[]) => ComparisonReportDetailRow[];
|
|
1345
|
+
}
|
|
1067
1346
|
interface ComparisonOptions {
|
|
1068
1347
|
/** The left-side ("baseline") bundle being compared. */
|
|
1069
1348
|
baseline: NamedBundle;
|
|
@@ -1079,6 +1358,8 @@ interface ComparisonOptions {
|
|
|
1079
1358
|
specs: (ComparisonSpecs | ComparisonSpecsSource)[];
|
|
1080
1359
|
/** Optional configuration for the datasets that are compared for different scenarios. */
|
|
1081
1360
|
datasets?: ComparisonDatasetOptions;
|
|
1361
|
+
/** Options for customizing the comparison report. */
|
|
1362
|
+
report?: ComparisonReportOptions;
|
|
1082
1363
|
}
|
|
1083
1364
|
interface ComparisonConfig {
|
|
1084
1365
|
/** The loaded left-side ("baseline") bundle being compared. */
|
|
@@ -1096,6 +1377,8 @@ interface ComparisonConfig {
|
|
|
1096
1377
|
datasets: ComparisonDatasets;
|
|
1097
1378
|
/** The set of resolved view groups. */
|
|
1098
1379
|
viewGroups: ComparisonViewGroup[];
|
|
1380
|
+
/** Options for customizing the comparison report. */
|
|
1381
|
+
reportOptions?: ComparisonReportOptions;
|
|
1099
1382
|
}
|
|
1100
1383
|
|
|
1101
1384
|
type ComparisonDataRequestKey = string;
|
|
@@ -1114,85 +1397,6 @@ declare class ComparisonDataCoordinator {
|
|
|
1114
1397
|
cancelRequest(key: ComparisonDataRequestKey): void;
|
|
1115
1398
|
}
|
|
1116
1399
|
|
|
1117
|
-
interface DiffPoint {
|
|
1118
|
-
time: number;
|
|
1119
|
-
valueL: number;
|
|
1120
|
-
valueR: number;
|
|
1121
|
-
}
|
|
1122
|
-
type DiffValidity = 'neither' | 'left-only' | 'right-only' | 'both';
|
|
1123
|
-
interface DiffReport {
|
|
1124
|
-
validity: DiffValidity;
|
|
1125
|
-
minValue: number;
|
|
1126
|
-
maxValue: number;
|
|
1127
|
-
avgDiff: number;
|
|
1128
|
-
minDiff: number;
|
|
1129
|
-
maxDiff: number;
|
|
1130
|
-
maxDiffPoint: DiffPoint;
|
|
1131
|
-
}
|
|
1132
|
-
declare function diffDatasets(datasetL: Dataset | undefined, datasetR: Dataset | undefined): DiffReport;
|
|
1133
|
-
|
|
1134
|
-
interface PerfReport {
|
|
1135
|
-
readonly minTime: number;
|
|
1136
|
-
readonly maxTime: number;
|
|
1137
|
-
readonly avgTime: number;
|
|
1138
|
-
readonly allTimes: number[];
|
|
1139
|
-
}
|
|
1140
|
-
declare class PerfStats {
|
|
1141
|
-
private readonly times;
|
|
1142
|
-
addRun(timeInMillis: number): void;
|
|
1143
|
-
toReport(): PerfReport;
|
|
1144
|
-
}
|
|
1145
|
-
|
|
1146
|
-
/**
|
|
1147
|
-
* The report for a single comparison test (involving a dataset produced under
|
|
1148
|
-
* a specific input scenario). This includes the full `DiffReport`, whereas
|
|
1149
|
-
* a `ComparisonTestSummary` only includes the `maxDiff` value.
|
|
1150
|
-
*/
|
|
1151
|
-
interface ComparisonTestReport {
|
|
1152
|
-
scenarioKey: ComparisonScenarioKey;
|
|
1153
|
-
datasetKey: DatasetKey;
|
|
1154
|
-
diffReport: DiffReport;
|
|
1155
|
-
}
|
|
1156
|
-
/**
|
|
1157
|
-
* A simplified/terse version of `ComparisonTestReport` that is used when writing
|
|
1158
|
-
* results to a JSON file. The object keys are terse and it only includes the
|
|
1159
|
-
* minimum set of fields (only the `maxDiff` value instead of the full `DiffReport`)
|
|
1160
|
-
* to keep the file smaller when there are many reported differences.
|
|
1161
|
-
*/
|
|
1162
|
-
interface ComparisonTestSummary {
|
|
1163
|
-
/** Short for `scenarioKey`. */
|
|
1164
|
-
s: ComparisonScenarioKey;
|
|
1165
|
-
/** Short for `datasetKey`. */
|
|
1166
|
-
d: DatasetKey;
|
|
1167
|
-
/** Short for `maxDiff`. */
|
|
1168
|
-
md: number;
|
|
1169
|
-
}
|
|
1170
|
-
/**
|
|
1171
|
-
* The roll-up report that contains the results of all individual comparison tests.
|
|
1172
|
-
*/
|
|
1173
|
-
interface ComparisonReport {
|
|
1174
|
-
/** The set of all comparison test reports. */
|
|
1175
|
-
testReports: ComparisonTestReport[];
|
|
1176
|
-
/** The perf report for the "left" model. */
|
|
1177
|
-
perfReportL: PerfReport;
|
|
1178
|
-
/** The perf report for the "right" model. */
|
|
1179
|
-
perfReportR: PerfReport;
|
|
1180
|
-
}
|
|
1181
|
-
/**
|
|
1182
|
-
* A simplified/terse version of `ComparisonReport` that only includes the minimum set
|
|
1183
|
-
* of fields needed by the reporting app (to keep the file smaller when there are many
|
|
1184
|
-
* reported differences). This only includes comparison results for which there is
|
|
1185
|
-
* a non-zero `maxDiff` value.
|
|
1186
|
-
*/
|
|
1187
|
-
interface ComparisonSummary {
|
|
1188
|
-
/** The simplified set of all terse comparison test summaries. */
|
|
1189
|
-
testSummaries: ComparisonTestSummary[];
|
|
1190
|
-
/** The perf report for the "left" model. */
|
|
1191
|
-
perfReportL: PerfReport;
|
|
1192
|
-
/** The perf report for the "right" model. */
|
|
1193
|
-
perfReportR: PerfReport;
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
1400
|
type GraphInclusion = 'neither' | 'left-only' | 'right-only' | 'both';
|
|
1197
1401
|
interface GraphComparisonMetadataReport {
|
|
1198
1402
|
/** The key for the metadata field. */
|
|
@@ -1237,92 +1441,6 @@ declare function diffGraphs(graphL: BundleGraphSpec | undefined, graphR: BundleG
|
|
|
1237
1441
|
*/
|
|
1238
1442
|
declare function comparisonSummaryFromReport(comparisonReport: ComparisonReport): ComparisonSummary;
|
|
1239
1443
|
|
|
1240
|
-
type ComparisonGroupKind = 'by-dataset' | 'by-scenario';
|
|
1241
|
-
type ComparisonGroupKey = string;
|
|
1242
|
-
/**
|
|
1243
|
-
* A group of comparison test summaries associated with a particular scenario or dataset.
|
|
1244
|
-
*/
|
|
1245
|
-
interface ComparisonGroup {
|
|
1246
|
-
/** The kind of group, either 'by-dataset' or 'by-scenario'. */
|
|
1247
|
-
kind: ComparisonGroupKind;
|
|
1248
|
-
/**
|
|
1249
|
-
* The unique key for this group (a `DatasetKey` if grouped by dataset, or a
|
|
1250
|
-
* `ComparisonScenarioKey` if grouped by scenario).
|
|
1251
|
-
*/
|
|
1252
|
-
key: ComparisonGroupKey;
|
|
1253
|
-
/** The comparison test summaries for this group. */
|
|
1254
|
-
testSummaries: ComparisonTestSummary[];
|
|
1255
|
-
}
|
|
1256
|
-
/** Describes the "root" or primary item for a group of comparisons. */
|
|
1257
|
-
type ComparisonGroupRoot = ComparisonDataset | ComparisonScenario;
|
|
1258
|
-
/** A summary of scores for a group of comparisons. */
|
|
1259
|
-
interface ComparisonGroupScores {
|
|
1260
|
-
/** The total number of comparisons (sample size) for this group. */
|
|
1261
|
-
totalDiffCount: number;
|
|
1262
|
-
/** The sum of the `maxDiff` values for each threshold bucket. */
|
|
1263
|
-
totalMaxDiffByBucket: number[];
|
|
1264
|
-
/** The number of comparisons that fall into each threshold bucket. */
|
|
1265
|
-
diffCountByBucket: number[];
|
|
1266
|
-
/** The percentage of comparisons that fall into each threshold bucket. */
|
|
1267
|
-
diffPercentByBucket: number[];
|
|
1268
|
-
}
|
|
1269
|
-
/**
|
|
1270
|
-
* A summary of a group of comparisons that includes the resolved scenario/dataset metadata
|
|
1271
|
-
* and score information for the group.
|
|
1272
|
-
*/
|
|
1273
|
-
interface ComparisonGroupSummary {
|
|
1274
|
-
/** The metadata for the "root" or primary item for this group of comparisons. */
|
|
1275
|
-
root: ComparisonGroupRoot;
|
|
1276
|
-
/** The group containing the comparison summaries. */
|
|
1277
|
-
group: ComparisonGroup;
|
|
1278
|
-
/** The scores for this group, or undefined if comparisons were not performed for this group. */
|
|
1279
|
-
scores?: ComparisonGroupScores;
|
|
1280
|
-
}
|
|
1281
|
-
/**
|
|
1282
|
-
* Breaks down a set of by-scenario or by-dataset groupings into distinct categories.
|
|
1283
|
-
*/
|
|
1284
|
-
interface ComparisonGroupSummariesByCategory {
|
|
1285
|
-
/**
|
|
1286
|
-
* All groups in a map, keyed by "group key" (either a dataset key or scenario key).
|
|
1287
|
-
*/
|
|
1288
|
-
allGroupSummaries: Map<ComparisonGroupKey, ComparisonGroupSummary>;
|
|
1289
|
-
/**
|
|
1290
|
-
* Groups with items that have errors (are not valid) for both "left" and "right" models.
|
|
1291
|
-
*/
|
|
1292
|
-
withErrors: ComparisonGroupSummary[];
|
|
1293
|
-
/**
|
|
1294
|
-
* Groups with items that are only valid for the "left" model (for example, datasets that
|
|
1295
|
-
* were removed and no longer available in the "right" model).
|
|
1296
|
-
*/
|
|
1297
|
-
onlyInLeft: ComparisonGroupSummary[];
|
|
1298
|
-
/**
|
|
1299
|
-
* Groups with items that are only valid for the "right" model (for example, scenarios
|
|
1300
|
-
* for inputs that were added in the "right" model).
|
|
1301
|
-
*/
|
|
1302
|
-
onlyInRight: ComparisonGroupSummary[];
|
|
1303
|
-
/**
|
|
1304
|
-
* Groups with one or more comparisons that have non-zero `maxDiff` scores; the groups
|
|
1305
|
-
* will be sorted by `maxDiff`, with higher scores at the front of the array.
|
|
1306
|
-
*/
|
|
1307
|
-
withDiffs: ComparisonGroupSummary[];
|
|
1308
|
-
/**
|
|
1309
|
-
* Groups where all comparisons have `maxDiff` scores of zero (no differences between
|
|
1310
|
-
* "left" and "right").
|
|
1311
|
-
*/
|
|
1312
|
-
withoutDiffs: ComparisonGroupSummary[];
|
|
1313
|
-
}
|
|
1314
|
-
/**
|
|
1315
|
-
* Rolls up all by-scenario and by-dataset groupings.
|
|
1316
|
-
*/
|
|
1317
|
-
interface ComparisonCategorizedResults {
|
|
1318
|
-
/** All summaries for the comparison tests that were performed. */
|
|
1319
|
-
allTestSummaries: ComparisonTestSummary[];
|
|
1320
|
-
/** The full set of by-scenario groupings. */
|
|
1321
|
-
byScenario: ComparisonGroupSummariesByCategory;
|
|
1322
|
-
/** The full set of by-dataset groupings. */
|
|
1323
|
-
byDataset: ComparisonGroupSummariesByCategory;
|
|
1324
|
-
}
|
|
1325
|
-
|
|
1326
1444
|
/**
|
|
1327
1445
|
* Compute the overall scores for the given group of comparison test summaries.
|
|
1328
1446
|
*
|
|
@@ -1447,4 +1565,4 @@ declare function runSuite(config: Config, callbacks: RunSuiteCallbacks, options?
|
|
|
1447
1565
|
*/
|
|
1448
1566
|
declare function suiteSummaryFromReport(suiteReport: SuiteReport): SuiteSummary;
|
|
1449
1567
|
|
|
1450
|
-
export { type AllInputsSpec, type Bundle, type BundleGraphData, type BundleGraphDatasetSpec, type BundleGraphId, type BundleGraphSpec, type BundleGraphView, type BundleModel, CheckDataCoordinator, type CheckDataRequestKey, type CheckDatasetReport, type CheckGroupReport, type CheckKey, type CheckPredicateOp, type CheckPredicateOpConstantRef, type CheckPredicateOpDataRef, type CheckPredicateOpRef, type CheckPredicateReport, type CheckPredicateSummary, type CheckPredicateTimeOptions, type CheckPredicateTimeRange, type CheckPredicateTimeSingle, type CheckPredicateTimeSpec, type CheckReport, type CheckResult, type CheckResultErrorInfo, type CheckScenario, type CheckScenarioError, type CheckScenarioInputDesc, type CheckScenarioReport, type CheckStatus, type CheckSummary, type CheckTestReport, type ComparisonCategorizedResults, type ComparisonConfig, ComparisonDataCoordinator, type ComparisonDataRequestKey, type ComparisonDataset, type ComparisonDatasetName, type ComparisonDatasetOptions, type ComparisonDatasetSource, type ComparisonDatasetSpec, type ComparisonDatasets, type ComparisonGraphGroup, type ComparisonGraphGroupId, type ComparisonGraphGroupRefSpec, type ComparisonGraphGroupSpec, type ComparisonGraphId, type ComparisonGraphsArraySpec, type ComparisonGraphsPresetSpec, type ComparisonGroup, type ComparisonGroupKey, type ComparisonGroupKind, type ComparisonGroupRoot, type ComparisonGroupScores, type ComparisonGroupSummariesByCategory, type ComparisonGroupSummary, type ComparisonOptions, type ComparisonPlot, type ComparisonReport, type ComparisonResolverError, type ComparisonResolverInvalidValueError, type ComparisonResolverUnknownInputError, type ComparisonScenario, type ComparisonScenarioAllInputsSettings, type ComparisonScenarioGroup, type ComparisonScenarioGroupId, type ComparisonScenarioGroupRefSpec, type ComparisonScenarioGroupSpec, type ComparisonScenarioGroupTitle, type ComparisonScenarioId, type ComparisonScenarioInput, type ComparisonScenarioInputAtPositionSpec, type ComparisonScenarioInputAtValueSpec, type ComparisonScenarioInputName, type ComparisonScenarioInputPosition, type ComparisonScenarioInputSettings, type ComparisonScenarioInputSpec, type ComparisonScenarioInputState, type ComparisonScenarioKey, type ComparisonScenarioPresetMatrixSpec, type ComparisonScenarioRefSpec, type ComparisonScenarioSettings, type ComparisonScenarioSpec, type ComparisonScenarioSubtitle, type ComparisonScenarioTitle, type ComparisonScenarioWithAllInputsSpec, type ComparisonScenarioWithDistinctInputsSpec, type ComparisonScenarioWithInputsSpec, type ComparisonScenarios, type ComparisonSpecs, type ComparisonSpecsSource, type ComparisonSummary, type ComparisonTestReport, type ComparisonTestSummary, type ComparisonUnresolvedScenarioGroupRef, type ComparisonUnresolvedScenarioRef, type ComparisonUnresolvedView, type ComparisonView, type ComparisonViewBox, type ComparisonViewBoxSpec, type ComparisonViewGraphOrder, type ComparisonViewGraphsSpec, type ComparisonViewGroup, type ComparisonViewGroupSpec, type ComparisonViewGroupTitle, type ComparisonViewGroupWithScenariosSpec, type ComparisonViewGroupWithViewsSpec, type ComparisonViewItemSubtitle, type ComparisonViewItemTitle, type ComparisonViewRow, type ComparisonViewRowSpec, type ComparisonViewRowSubtitle, type ComparisonViewRowTitle, type ComparisonViewSpec, type ComparisonViewSubtitle, type ComparisonViewTitle, type Config, type ConfigInitOptions, type ConfigOptions, type DataSource, type Dataset, type DatasetGroupName, type DatasetKey, type DatasetMap, type DatasetsResult, type DiffPoint, type DiffReport, type DiffValidity, type Dimension, type GraphComparisonDatasetReport, type GraphComparisonMetadataReport, type GraphComparisonReport, type GraphInclusion, type ImplVar, type InputAliasName, type InputGroupName, type InputId, type InputPosition, type InputSetting, type InputSettingsSpec, type InputVar, type LegendItem, type LinkItem, type LoadedBundle, type ModelSpec, type NamedBundle, type OutputVar, type PerfReport, PerfRunner, PerfStats, type PositionSetting, type RelatedItem, type RunSuiteCallbacks, type RunSuiteOptions, type ScenarioSpec, type ScenarioSpecUid, type SourceName, type Subscript, type SuiteReport, type SuiteSummary, type ValueSetting, type VarId, categorizeComparisonTestSummaries, checkReportFromSummary, checkSummaryFromReport, comparisonSummaryFromReport, createConfig, datasetMessage, diffDatasets, diffGraphs, getScoresForTestSummaries, predicateMessage, runSuite, scenarioMessage, suiteSummaryFromReport };
|
|
1568
|
+
export { type AllInputsSpec, type Bundle, type BundleGraphData, type BundleGraphDatasetSpec, type BundleGraphId, type BundleGraphSpec, type BundleGraphView, type BundleModel, CheckDataCoordinator, type CheckDataRequestKey, type CheckDatasetReport, type CheckGroupReport, type CheckKey, type CheckPredicateOp, type CheckPredicateOpConstantRef, type CheckPredicateOpDataRef, type CheckPredicateOpRef, type CheckPredicateReport, type CheckPredicateSummary, type CheckPredicateTimeOptions, type CheckPredicateTimeRange, type CheckPredicateTimeSingle, type CheckPredicateTimeSpec, type CheckReport, type CheckResult, type CheckResultErrorInfo, type CheckScenario, type CheckScenarioError, type CheckScenarioInputDesc, type CheckScenarioReport, type CheckStatus, type CheckSummary, type CheckTestReport, type ComparisonCategorizedResults, type ComparisonConfig, ComparisonDataCoordinator, type ComparisonDataRequestKey, type ComparisonDataset, type ComparisonDatasetName, type ComparisonDatasetOptions, type ComparisonDatasetSource, type ComparisonDatasetSpec, type ComparisonDatasets, type ComparisonGraphGroup, type ComparisonGraphGroupId, type ComparisonGraphGroupRefSpec, type ComparisonGraphGroupSpec, type ComparisonGraphId, type ComparisonGraphsArraySpec, type ComparisonGraphsPresetSpec, type ComparisonGroup, type ComparisonGroupKey, type ComparisonGroupKind, type ComparisonGroupRoot, type ComparisonGroupScores, type ComparisonGroupSummariesByCategory, type ComparisonGroupSummary, type ComparisonOptions, type ComparisonPlot, type ComparisonReport, type ComparisonReportDetailItem, type ComparisonReportDetailRow, type ComparisonReportOptions, type ComparisonReportSummaryRow, type ComparisonReportSummarySection, type ComparisonResolverError, type ComparisonResolverInvalidValueError, type ComparisonResolverUnknownInputError, type ComparisonResolverUnknownInputSettingGroupError, type ComparisonScenario, type ComparisonScenarioAllInputsSettings, type ComparisonScenarioGroup, type ComparisonScenarioGroupId, type ComparisonScenarioGroupRefSpec, type ComparisonScenarioGroupSpec, type ComparisonScenarioGroupTitle, type ComparisonScenarioId, type ComparisonScenarioInput, type ComparisonScenarioInputAtPositionSpec, type ComparisonScenarioInputAtValueSpec, type ComparisonScenarioInputName, type ComparisonScenarioInputPosition, type ComparisonScenarioInputSettings, type ComparisonScenarioInputSpec, type ComparisonScenarioInputState, type ComparisonScenarioKey, type ComparisonScenarioPresetMatrixSpec, type ComparisonScenarioRefSpec, type ComparisonScenarioSettings, type ComparisonScenarioSpec, type ComparisonScenarioSubtitle, type ComparisonScenarioTitle, type ComparisonScenarioWithAllInputsSpec, type ComparisonScenarioWithDistinctInputsSpec, type ComparisonScenarioWithInputsSpec, type ComparisonScenarioWithSettingGroupSpec, type ComparisonScenarios, type ComparisonSpecs, type ComparisonSpecsSource, type ComparisonSummary, type ComparisonTestReport, type ComparisonTestSummary, type ComparisonUnresolvedScenarioGroupRef, type ComparisonUnresolvedScenarioRef, type ComparisonUnresolvedView, type ComparisonView, type ComparisonViewBox, type ComparisonViewBoxSpec, type ComparisonViewGraphOrder, type ComparisonViewGraphsSpec, type ComparisonViewGroup, type ComparisonViewGroupSpec, type ComparisonViewGroupTitle, type ComparisonViewGroupWithScenariosSpec, type ComparisonViewGroupWithViewsSpec, type ComparisonViewItemSubtitle, type ComparisonViewItemTitle, type ComparisonViewRow, type ComparisonViewRowSpec, type ComparisonViewRowSubtitle, type ComparisonViewRowTitle, type ComparisonViewSpec, type ComparisonViewSubtitle, type ComparisonViewTitle, type Config, type ConfigInitOptions, type ConfigOptions, type DataSource, type Dataset, type DatasetGroupName, type DatasetKey, type DatasetMap, type DatasetsResult, type DiffPoint, type DiffReport, type DiffValidity, type Dimension, type GraphComparisonDatasetReport, type GraphComparisonMetadataReport, type GraphComparisonReport, type GraphInclusion, type ImplVar, type InputAliasName, type InputGroupName, type InputId, type InputPosition, type InputSetting, type InputSettingGroupId, type InputSettingsSpec, type InputVar, type LegendItem, type LinkItem, type LoadedBundle, type ModelSpec, type NamedBundle, type OutputVar, type PerfReport, PerfRunner, PerfStats, type PositionSetting, type RelatedItem, type RunSuiteCallbacks, type RunSuiteOptions, type ScenarioSpec, type ScenarioSpecUid, type SourceName, type Subscript, type SuiteReport, type SuiteSummary, type ValueSetting, type VarId, categorizeComparisonTestSummaries, checkReportFromSummary, checkSummaryFromReport, comparisonSummaryFromReport, createConfig, datasetMessage, diffDatasets, diffGraphs, getScoresForTestSummaries, predicateMessage, runSuite, scenarioMessage, suiteSummaryFromReport };
|