@sdeverywhere/check-core 0.1.4 → 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 +129 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -3
- package/dist/index.d.ts +31 -3
- package/dist/index.js +129 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
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 {
|
|
@@ -1537,4 +1565,4 @@ declare function runSuite(config: Config, callbacks: RunSuiteCallbacks, options?
|
|
|
1537
1565
|
*/
|
|
1538
1566
|
declare function suiteSummaryFromReport(suiteReport: SuiteReport): SuiteSummary;
|
|
1539
1567
|
|
|
1540
|
-
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 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 };
|
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 {
|
|
@@ -1537,4 +1565,4 @@ declare function runSuite(config: Config, callbacks: RunSuiteCallbacks, options?
|
|
|
1537
1565
|
*/
|
|
1538
1566
|
declare function suiteSummaryFromReport(suiteReport: SuiteReport): SuiteSummary;
|
|
1539
1567
|
|
|
1540
|
-
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 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 };
|
package/dist/index.js
CHANGED
|
@@ -3084,6 +3084,7 @@ import { assertNever as assertNever11 } from "assert-never";
|
|
|
3084
3084
|
// src/bundle/model-inputs.ts
|
|
3085
3085
|
var ModelInputs = class {
|
|
3086
3086
|
constructor(modelSpec) {
|
|
3087
|
+
this.modelSpec = modelSpec;
|
|
3087
3088
|
/** All inputs keyed by lookup name (lowercase variable name or alias). */
|
|
3088
3089
|
this.inputsByLookupName = /* @__PURE__ */ new Map();
|
|
3089
3090
|
/** All input ID aliases. */
|
|
@@ -3130,6 +3131,14 @@ var ModelInputs = class {
|
|
|
3130
3131
|
getInputVarForName(name) {
|
|
3131
3132
|
return this.inputsByLookupName.get(name.toLowerCase());
|
|
3132
3133
|
}
|
|
3134
|
+
/**
|
|
3135
|
+
* Return the `InputVar` that matches the requested variable ID.
|
|
3136
|
+
*
|
|
3137
|
+
* @param varId The variable identifier to match.
|
|
3138
|
+
*/
|
|
3139
|
+
getInputVarForVarId(varId) {
|
|
3140
|
+
return this.modelSpec.inputVars.get(varId);
|
|
3141
|
+
}
|
|
3133
3142
|
};
|
|
3134
3143
|
|
|
3135
3144
|
// src/comparison/config/resolve/comparison-scenario-specs.ts
|
|
@@ -3351,6 +3360,19 @@ function resolveScenariosFromSpec(modelInputsL, modelInputsR, scenarioSpec, genK
|
|
|
3351
3360
|
)
|
|
3352
3361
|
];
|
|
3353
3362
|
}
|
|
3363
|
+
case "scenario-with-setting-group": {
|
|
3364
|
+
return [
|
|
3365
|
+
resolveScenarioForSettingGroup(
|
|
3366
|
+
modelInputsL,
|
|
3367
|
+
modelInputsR,
|
|
3368
|
+
genKey(),
|
|
3369
|
+
scenarioSpec.id,
|
|
3370
|
+
scenarioSpec.title,
|
|
3371
|
+
scenarioSpec.subtitle,
|
|
3372
|
+
scenarioSpec.settingGroupId
|
|
3373
|
+
)
|
|
3374
|
+
];
|
|
3375
|
+
}
|
|
3354
3376
|
default:
|
|
3355
3377
|
assertNever11(scenarioSpec);
|
|
3356
3378
|
}
|
|
@@ -3480,6 +3502,113 @@ function resolveScenarioForDistinctInputSpecs(modelInputsL, modelInputsR, key, i
|
|
|
3480
3502
|
specR
|
|
3481
3503
|
};
|
|
3482
3504
|
}
|
|
3505
|
+
function resolveScenarioForSettingGroup(modelInputsL, modelInputsR, key, id, title, subtitle, settingGroupId) {
|
|
3506
|
+
var _a, _b;
|
|
3507
|
+
function inputVarNameForVarId(modelInputs, varId) {
|
|
3508
|
+
const inputVar = modelInputs.getInputVarForVarId(varId);
|
|
3509
|
+
if (inputVar !== void 0) {
|
|
3510
|
+
return inputVar.varName;
|
|
3511
|
+
} else {
|
|
3512
|
+
return varId;
|
|
3513
|
+
}
|
|
3514
|
+
}
|
|
3515
|
+
function inputPositionForPosition(position) {
|
|
3516
|
+
switch (position) {
|
|
3517
|
+
case "at-minimum":
|
|
3518
|
+
return "min";
|
|
3519
|
+
case "at-maximum":
|
|
3520
|
+
return "max";
|
|
3521
|
+
case "at-default":
|
|
3522
|
+
return "default";
|
|
3523
|
+
default:
|
|
3524
|
+
throw new Error(`Unknown input position: ${position}`);
|
|
3525
|
+
}
|
|
3526
|
+
}
|
|
3527
|
+
function inputSpecForSetting(modelInputs, inputSetting) {
|
|
3528
|
+
switch (inputSetting.kind) {
|
|
3529
|
+
case "position":
|
|
3530
|
+
return {
|
|
3531
|
+
kind: "input-at-position",
|
|
3532
|
+
inputName: inputVarNameForVarId(modelInputs, inputSetting.inputVarId),
|
|
3533
|
+
position: inputPositionForPosition(inputSetting.position)
|
|
3534
|
+
};
|
|
3535
|
+
case "value":
|
|
3536
|
+
return {
|
|
3537
|
+
kind: "input-at-value",
|
|
3538
|
+
inputName: inputVarNameForVarId(modelInputs, inputSetting.inputVarId),
|
|
3539
|
+
value: inputSetting.value
|
|
3540
|
+
};
|
|
3541
|
+
default:
|
|
3542
|
+
throw new Error(`Unknown input setting kind: ${inputSetting}`);
|
|
3543
|
+
}
|
|
3544
|
+
}
|
|
3545
|
+
function inputSpecsForSettingGroup(modelInputs, inputSettings) {
|
|
3546
|
+
return inputSettings.map((inputSetting) => inputSpecForSetting(modelInputs, inputSetting));
|
|
3547
|
+
}
|
|
3548
|
+
const inputSettingsL = ((_a = modelInputsL.modelSpec.inputSettingGroups) == null ? void 0 : _a.get(settingGroupId)) || [];
|
|
3549
|
+
const inputSettingsR = ((_b = modelInputsR.modelSpec.inputSettingGroups) == null ? void 0 : _b.get(settingGroupId)) || [];
|
|
3550
|
+
const inputsL = inputSpecsForSettingGroup(modelInputsL, inputSettingsL);
|
|
3551
|
+
const inputsR = inputSpecsForSettingGroup(modelInputsR, inputSettingsR);
|
|
3552
|
+
const scenario = resolveScenarioForDistinctInputSpecs(
|
|
3553
|
+
modelInputsL,
|
|
3554
|
+
modelInputsR,
|
|
3555
|
+
key,
|
|
3556
|
+
id,
|
|
3557
|
+
title,
|
|
3558
|
+
subtitle,
|
|
3559
|
+
inputsL,
|
|
3560
|
+
inputsR
|
|
3561
|
+
);
|
|
3562
|
+
function scenarioString(scenario2) {
|
|
3563
|
+
if (scenario2.kind === "input-settings") {
|
|
3564
|
+
const settings = scenario2.settings.map((setting) => {
|
|
3565
|
+
switch (setting.kind) {
|
|
3566
|
+
case "position":
|
|
3567
|
+
return `${setting.inputVarId}=${setting.position}`;
|
|
3568
|
+
case "value":
|
|
3569
|
+
return `${setting.inputVarId}=${setting.value}`;
|
|
3570
|
+
default:
|
|
3571
|
+
throw new Error(`Unexpected input setting kind: ${setting}`);
|
|
3572
|
+
}
|
|
3573
|
+
});
|
|
3574
|
+
return settings.sort().join("__");
|
|
3575
|
+
} else {
|
|
3576
|
+
throw new Error(`Unexpected scenario spec kind: ${scenario2.kind}`);
|
|
3577
|
+
}
|
|
3578
|
+
}
|
|
3579
|
+
function scenariosAreEqual(scenarioL, scenarioR) {
|
|
3580
|
+
return scenarioString(scenarioL) === scenarioString(scenarioR);
|
|
3581
|
+
}
|
|
3582
|
+
function errorState(inputSettings) {
|
|
3583
|
+
if (inputSettings.length === 0) {
|
|
3584
|
+
return { error: { kind: "unknown-input-setting-group" } };
|
|
3585
|
+
} else {
|
|
3586
|
+
return {};
|
|
3587
|
+
}
|
|
3588
|
+
}
|
|
3589
|
+
if (inputSettingsL.length === 0 || inputSettingsR.length === 0) {
|
|
3590
|
+
if (scenario.settings.kind === "input-settings") {
|
|
3591
|
+
const errorSetting = {
|
|
3592
|
+
requestedName: settingGroupId,
|
|
3593
|
+
stateL: errorState(inputSettingsL),
|
|
3594
|
+
stateR: errorState(inputSettingsR)
|
|
3595
|
+
};
|
|
3596
|
+
scenario.settings.inputs.unshift(errorSetting);
|
|
3597
|
+
}
|
|
3598
|
+
if (inputSettingsL.length === 0) {
|
|
3599
|
+
scenario.specL = void 0;
|
|
3600
|
+
}
|
|
3601
|
+
if (inputSettingsR.length === 0) {
|
|
3602
|
+
scenario.specR = void 0;
|
|
3603
|
+
}
|
|
3604
|
+
}
|
|
3605
|
+
if (scenario.settings.kind === "input-settings") {
|
|
3606
|
+
if (scenario.specL && scenario.specR && !scenariosAreEqual(scenario.specL, scenario.specR)) {
|
|
3607
|
+
scenario.settings.settingsDiffer = true;
|
|
3608
|
+
}
|
|
3609
|
+
}
|
|
3610
|
+
return scenario;
|
|
3611
|
+
}
|
|
3483
3612
|
function resolveInputForName(modelInputsL, modelInputsR, inputName, at) {
|
|
3484
3613
|
return {
|
|
3485
3614
|
requestedName: inputName,
|