@swmmrs/swmmrs 0.1.0 → 0.2.0

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.
@@ -1,79 +1,79 @@
1
- export { Simulation, runSwmm, runSwmm as default } from "./simulation.js";
2
- export { Node } from "./objects/nodes.js";
3
- export { Link } from "./objects/links.js";
4
- export { Subcatchment, RainGage } from "./objects/subcatchments.js";
5
- export { Definition, Aquifer, SnowmeltParameterSet } from "./objects/definitions.js";
6
- export { AmmModel } from "./objects/amm.js";
7
- export { UnitHydrograph } from "./objects/rtk.js";
8
- export { LidControl, LidUnit, LidUnitCollection } from "./objects/lids.js";
9
- export type {
10
- StorageShapeKind, StorageShape, StorageShapePatch, StorageExfiltration,
11
- StorageExfiltrationPatch, OutfallBoundaryKind, OutfallBoundary, OutfallBoundaryPatch,
12
- DividerRuleKind, DividerRule, DividerRulePatch, NodePatch,
13
- NodeConfiguration, NodeQuality, NodeQualitySnapshot, NodeStatistics,
14
- StorageStatistics, OutfallStatistics, NodeStatisticsSnapshot, PollutantValues,
15
- } from "./objects/nodes.js";
16
- export type {
17
- FunctionalOutletRating, TabularOutletRating, OutletRating, OutletRatingPatch,
18
- CircularCrossSection, StandardCrossSection, CustomCrossSection, IrregularCrossSection,
19
- StreetCrossSection, CrossSection, CrossSectionPatch, InletConfiguration,
20
- InletPatch, InletResults, ConduitConfiguration, PumpConfiguration,
21
- OrificeConfiguration, WeirConfiguration, OutletConfiguration, LinkSubtypeConfiguration,
22
- LinkConfiguration, ConduitPatch, PumpPatch, OrificePatch,
23
- WeirPatch, OutletPatch, LinkSubtypePatch, LinkPatch,
24
- LinkQuality, LinkQualitySnapshot, LinkStatistics, PumpStatistics,
25
- LinkStatisticsSnapshot,
26
- } from "./objects/links.js";
27
- export type {
28
- SubcatchmentOutlet, HortonInfiltrationSettings, ModifiedHortonInfiltrationSettings, GreenAmptInfiltrationSettings,
29
- ModifiedGreenAmptInfiltrationSettings, CurveNumberInfiltrationSettings, SubcatchmentInfiltrationConfiguration, SubcatchmentInfiltrationPatch,
30
- SubcatchmentGroundwaterConfiguration, SubcatchmentGroundwaterPatch, SubcatchmentPatch, SubcatchmentConfiguration,
31
- SubcatchmentQuality, SubcatchmentQualitySnapshot, SubcatchmentStatistics, SubcatchmentStatisticsSnapshot,
32
- SubcatchmentPrecipitationScaleFactors, SubcatchmentExternalForcing, SubcatchmentNamedSettingsKind, SubcatchmentNamedValues,
33
- SubcatchmentPollutantValues,
34
- } from "./objects/subcatchments.js";
35
- export type {
36
- Pollutant, LandUse, TimePattern, Curve,
37
- TimeSeries, ControlRule, Transect, CustomShape,
38
- Street, InletDesign, AquiferConfiguration, AquiferPatch,
39
- SnowmeltSurfaceName, SnowmeltSurfaceConfiguration, SnowmeltSurfacePatch, SnowmeltParameterSetConfiguration,
40
- SnowmeltParameterSetPatch,
41
- } from "./objects/definitions.js";
42
- export type {
43
- AmmComponentKind, AmmStandardComponent, AmmBaseflowComponent, AmmComponent,
44
- AmmModelConfiguration, AmmModelPatch, AmmAssignment,
45
- } from "./objects/amm.js";
46
- export type {
47
- UnitHydrographResponse, UnitHydrographMonth, UnitHydrographConfiguration, UnitHydrographPatch,
48
- RdiiAssignment,
49
- } from "./objects/rtk.js";
50
- export type {
51
- LidRelationshipKind, LidRelationship, LidControlRelationship, LidDrainDestination,
52
- LidCurveRelationship, LidUnitConfiguration, LidSurfaceConfiguration, LidSoilConfiguration,
53
- LidStorageConfiguration, LidPavementConfiguration, LidDrainConfiguration, LidDrainageMatConfiguration,
54
- LidControlConfiguration, LidSurfacePatch, LidSoilPatch, LidStoragePatch,
55
- LidPavementPatch, LidDrainPatch, LidDrainageMatPatch, LidLayerName,
56
- LidLayerPatch, LidUnitPatch, LidUnitSnapshot, SubcatchmentLidSnapshot,
57
- } from "./objects/lids.js";
58
- export type {
59
- CheckpointBundle, ScenarioMethod, ScenarioArgs, ScenarioResult,
60
- } from "./scenarios.js";
61
- export { OutputReader, OutputError, OutputName, ReportTiming, BulkSeriesResult } from "./output.js";
62
- export type {
63
- ResultElementType, ConcentrationUnits, OutputFlowUnits, OutputUnitSystem,
64
- UnknownCode, ResultAttributeCode, PollutantAttribute, SubcatchmentResultAttribute,
65
- NodeResultAttribute, LinkResultAttribute, SystemResultAttribute, SubcatchmentSchemaEntry,
66
- NodeSchemaEntry, LinkSchemaEntry, SystemSchemaEntry, OutputAttribute,
67
- OutputElementSelector, SeriesSelection, RunStatus, SubcatchmentMetadata,
68
- NodeMetadata, LinkMetadata, PollutantMetadata, ResultSchema,
69
- OutputMetadata, OutputValueSeries, OutputTimeSeries, OutputReadOptions,
70
- OutputRange, OutputReaderOptions,
71
- } from "./output.js";
72
- export { ObjectCollection, NodeCollection, LinkCollection, SubcatchmentCollection, RainGageCollection } from "./objects/collections.js";
73
- export { SimulationOptionsView } from "./objects/options.js";
74
- export { SwmmError, SolverError, LifecycleError, StaleViewError, ValidationError, ConfigurationError, ObjectNotFoundError, WorkerError, InternalSimulationError } from "./exceptions.js";
75
- export type { ErrorDetails, ConfigurationDiagnostic, ConfigurationObjectIdentity } from "./exceptions.js";
76
- export type * from "./enums.js";
77
- export type * from "./types.js";
78
- export type * from "./snapshots.js";
79
- export type { ModelOptions, ModelOptionsPatch, SchedulePatch, SweepDay } from "./objects/options.js";
1
+ export { Simulation, runSwmm, runSwmm as default } from "./simulation.js";
2
+ export { Node } from "./objects/nodes.js";
3
+ export { Link } from "./objects/links.js";
4
+ export { Subcatchment, RainGage } from "./objects/subcatchments.js";
5
+ export { Definition, Aquifer, SnowmeltParameterSet } from "./objects/definitions.js";
6
+ export { AmmModel } from "./objects/amm.js";
7
+ export { UnitHydrograph } from "./objects/rtk.js";
8
+ export { LidControl, LidUnit, LidUnitCollection } from "./objects/lids.js";
9
+ export type {
10
+ StorageShapeKind, StorageShape, StorageShapePatch, StorageExfiltration,
11
+ StorageExfiltrationPatch, OutfallBoundaryKind, OutfallBoundary, OutfallBoundaryPatch,
12
+ DividerRuleKind, DividerRule, DividerRulePatch, NodePatch,
13
+ NodeConfiguration, NodeQuality, NodeQualitySnapshot, NodeStatistics,
14
+ StorageStatistics, OutfallStatistics, NodeStatisticsSnapshot, PollutantValues,
15
+ } from "./objects/nodes.js";
16
+ export type {
17
+ FunctionalOutletRating, TabularOutletRating, OutletRating, OutletRatingPatch,
18
+ CircularCrossSection, StandardCrossSection, CustomCrossSection, IrregularCrossSection,
19
+ StreetCrossSection, CrossSection, CrossSectionPatch, InletConfiguration,
20
+ InletPatch, InletResults, ConduitConfiguration, PumpConfiguration,
21
+ OrificeConfiguration, WeirConfiguration, OutletConfiguration, LinkSubtypeConfiguration,
22
+ LinkConfiguration, ConduitPatch, PumpPatch, OrificePatch,
23
+ WeirPatch, OutletPatch, LinkSubtypePatch, LinkPatch,
24
+ LinkQuality, LinkQualitySnapshot, LinkStatistics, PumpStatistics,
25
+ LinkStatisticsSnapshot,
26
+ } from "./objects/links.js";
27
+ export type {
28
+ SubcatchmentOutlet, HortonInfiltrationSettings, ModifiedHortonInfiltrationSettings, GreenAmptInfiltrationSettings,
29
+ ModifiedGreenAmptInfiltrationSettings, CurveNumberInfiltrationSettings, SubcatchmentInfiltrationConfiguration, SubcatchmentInfiltrationPatch,
30
+ SubcatchmentGroundwaterConfiguration, SubcatchmentGroundwaterPatch, SubcatchmentPatch, SubcatchmentConfiguration,
31
+ SubcatchmentQuality, SubcatchmentQualitySnapshot, SubcatchmentStatistics, SubcatchmentStatisticsSnapshot,
32
+ SubcatchmentPrecipitationScaleFactors, SubcatchmentExternalForcing, SubcatchmentNamedSettingsKind, SubcatchmentNamedValues,
33
+ SubcatchmentPollutantValues,
34
+ } from "./objects/subcatchments.js";
35
+ export type {
36
+ Pollutant, LandUse, TimePattern, Curve,
37
+ TimeSeries, ControlRule, Transect, CustomShape,
38
+ Street, InletDesign, AquiferConfiguration, AquiferPatch,
39
+ SnowmeltSurfaceName, SnowmeltSurfaceConfiguration, SnowmeltSurfacePatch, SnowmeltParameterSetConfiguration,
40
+ SnowmeltParameterSetPatch,
41
+ } from "./objects/definitions.js";
42
+ export type {
43
+ AmmComponentKind, AmmStandardComponent, AmmBaseflowComponent, AmmComponent,
44
+ AmmModelConfiguration, AmmModelPatch, AmmAssignment,
45
+ } from "./objects/amm.js";
46
+ export type {
47
+ UnitHydrographResponse, UnitHydrographMonth, UnitHydrographConfiguration, UnitHydrographPatch,
48
+ RdiiAssignment,
49
+ } from "./objects/rtk.js";
50
+ export type {
51
+ LidRelationshipKind, LidRelationship, LidControlRelationship, LidDrainDestination,
52
+ LidCurveRelationship, LidUnitConfiguration, LidSurfaceConfiguration, LidSoilConfiguration,
53
+ LidStorageConfiguration, LidPavementConfiguration, LidDrainConfiguration, LidDrainageMatConfiguration,
54
+ LidControlConfiguration, LidSurfacePatch, LidSoilPatch, LidStoragePatch,
55
+ LidPavementPatch, LidDrainPatch, LidDrainageMatPatch, LidLayerName,
56
+ LidLayerPatch, LidUnitPatch, LidUnitSnapshot, SubcatchmentLidSnapshot,
57
+ } from "./objects/lids.js";
58
+ export type {
59
+ CheckpointBundle, ScenarioMethod, ScenarioArgs, ScenarioResult,
60
+ } from "./scenarios.js";
61
+ export { OutputReader, OutputError, OutputName, ReportTiming, BulkSeriesResult } from "./output.js";
62
+ export type {
63
+ ResultElementType, ConcentrationUnits, OutputFlowUnits, OutputUnitSystem,
64
+ UnknownCode, ResultAttributeCode, PollutantAttribute, SubcatchmentResultAttribute,
65
+ NodeResultAttribute, LinkResultAttribute, SystemResultAttribute, SubcatchmentSchemaEntry,
66
+ NodeSchemaEntry, LinkSchemaEntry, SystemSchemaEntry, OutputAttribute,
67
+ OutputElementSelector, SeriesSelection, RunStatus, SubcatchmentMetadata,
68
+ NodeMetadata, LinkMetadata, PollutantMetadata, ResultSchema,
69
+ OutputMetadata, OutputValueSeries, OutputTimeSeries, OutputReadOptions,
70
+ OutputRange, OutputReaderOptions,
71
+ } from "./output.js";
72
+ export { ObjectCollection, NodeCollection, LinkCollection, SubcatchmentCollection, RainGageCollection } from "./objects/collections.js";
73
+ export { SimulationOptionsView } from "./objects/options.js";
74
+ export { SwmmError, SolverError, LifecycleError, StaleViewError, ValidationError, ConfigurationError, ObjectNotFoundError, WorkerError, InternalSimulationError } from "./exceptions.js";
75
+ export type { ErrorDetails, ConfigurationDiagnostic, ConfigurationObjectIdentity } from "./exceptions.js";
76
+ export type * from "./enums.js";
77
+ export type * from "./types.js";
78
+ export type * from "./snapshots.js";
79
+ export type { ModelOptions, ModelOptionsPatch, SchedulePatch, SweepDay } from "./objects/options.js";
@@ -1,113 +1,113 @@
1
- import type { Call } from "../protocol.js";
2
-
3
- /** Standard runoff-response or seasonal baseflow AMM component. */
4
- export type AmmComponentKind = "standard" | "baseflow";
5
-
6
- /** Detached standard AMM component. `kind` is exactly `"standard"`. */
7
- export interface AmmStandardComponent {
8
- /** Standard response discriminator. */
9
- readonly kind: "standard";
10
- /** Component identity within this model. */
11
- readonly id: string;
12
- /** Dry-weather capture parameter in the model's native capture units. */
13
- readonly dryCapture: number;
14
- /** Precipitation averaging window in hours. */
15
- readonly precipitationWindowHours: number;
16
- /** Response hydrograph half-life in hours. */
17
- readonly hydrographHalfLifeHours: number;
18
- /** Initial wet capture parameter in native capture units. */
19
- readonly initialWetCapture: number;
20
- /** Antecedent moisture half-life in hours. */
21
- readonly moistureHalfLifeHours: number;
22
- /** Temperature averaging window in hours. */
23
- readonly temperatureWindowHours: number;
24
- /** Spring cold seasonal hydrograph capture factor. */
25
- readonly springColdShcf: number;
26
- /** Hot seasonal hydrograph capture factor. */
27
- readonly hotShcf: number;
28
- /** Fall cold seasonal hydrograph capture factor. */
29
- readonly fallColdShcf: number;
30
- }
31
-
32
- /** Detached baseflow AMM component. `kind` is exactly `"baseflow"`. */
33
- export interface AmmBaseflowComponent {
34
- /** Seasonal baseflow discriminator. */
35
- readonly kind: "baseflow";
36
- /** Component identity within this model. */
37
- readonly id: string;
38
- /** Precipitation averaging window in hours. */
39
- readonly precipitationWindowHours: number;
40
- /** Response hydrograph half-life in hours. */
41
- readonly hydrographHalfLifeHours: number;
42
- /** Temperature averaging window in hours. */
43
- readonly temperatureWindowHours: number;
44
- /** Spring cold capture parameter in native capture units. */
45
- readonly springColdCapture: number;
46
- /** Hot capture parameter in native capture units. */
47
- readonly hotCapture: number;
48
- /** Fall cold capture parameter in native capture units. */
49
- readonly fallColdCapture: number;
50
- }
51
-
52
- /** AMM component discriminated by `kind`; component arrays are replaced as a whole. */
53
- export type AmmComponent = AmmStandardComponent | AmmBaseflowComponent;
54
-
55
- /** Complete AMM model configuration in native project units. */
56
- export interface AmmModelConfiguration {
57
- /** Canonical rain-gage ID. */
58
- readonly rainGage: string;
59
- /** Cold reference temperature in the model's configured temperature units. */
60
- readonly coldTemperature: number;
61
- /** Hot reference temperature in the model's configured temperature units. */
62
- readonly hotTemperature: number;
63
- /** Complete ordered standard/baseflow component list. */
64
- readonly components: readonly AmmComponent[];
65
- }
66
-
67
- /** Sparse AMM model update. Omitted fields retain their current values. */
68
- export interface AmmModelPatch {
69
- /** {@inheritDoc AmmModelConfiguration.rainGage} */
70
- rainGage?: string;
71
- /** {@inheritDoc AmmModelConfiguration.coldTemperature} */
72
- coldTemperature?: number;
73
- /** {@inheritDoc AmmModelConfiguration.hotTemperature} */
74
- hotTemperature?: number;
75
- /** Replacement complete component array; omission retains it. */
76
- components?: readonly AmmComponent[];
77
- }
78
-
79
- /** Detached AMM node assignment in native project units. IDs are canonical. */
80
- export interface AmmAssignment {
81
- /** Canonical receiving node ID. */
82
- readonly node: string;
83
- /** Canonical AMM-model ID. */
84
- readonly model: string;
85
- /** Assigned land area in acres (US) or hectares (SI). */
86
- readonly area: number;
87
- }
88
-
89
- export interface AmmOperations {
90
- ammModelConfiguration: { args: [string]; result: AmmModelConfiguration };
91
- configureAmmModel: { args: [string, AmmModelPatch]; result: void };
92
- ammAssignments: { args: []; result: readonly AmmAssignment[] };
93
- replaceAmmAssignments: { args: [readonly AmmAssignment[]]; result: void };
94
- }
95
-
96
- /** Editable AMM definition from `simulation.ammModels`; node assignments are managed on the simulation. */
97
- export class AmmModel {
98
- /** Canonical configured model ID. */
99
- readonly id: string;
100
- readonly #call: Call;
101
- private constructor(id: string, call: Call) { this.id = id; this.#call = call; Object.freeze(this); }
102
- /** @internal */
103
- static create(id: string, call: Call): AmmModel { return new AmmModel(id, call); }
104
- /** Read the definition in any healthy owner state.
105
- * @returns Detached complete AMM configuration.
106
- */
107
- configuration(): Promise<AmmModelConfiguration> { return this.#call("ammModelConfiguration", this.id); }
108
- /** Atomically update an AMM definition in `open` or `ended`; accepted edits return the owner to `open`.
109
- * @param patch - Sparse fields; supplying components replaces the complete array.
110
- * @returns Resolves after all fields are accepted.
111
- */
112
- configure(patch: AmmModelPatch): Promise<void> { return this.#call("configureAmmModel", this.id, patch); }
113
- }
1
+ import type { Call } from "../protocol.js";
2
+
3
+ /** Standard runoff-response or seasonal baseflow AMM component. */
4
+ export type AmmComponentKind = "standard" | "baseflow";
5
+
6
+ /** Detached standard AMM component. `kind` is exactly `"standard"`. */
7
+ export interface AmmStandardComponent {
8
+ /** Standard response discriminator. */
9
+ readonly kind: "standard";
10
+ /** Component identity within this model. */
11
+ readonly id: string;
12
+ /** Dry-weather capture parameter in the model's native capture units. */
13
+ readonly dryCapture: number;
14
+ /** Precipitation averaging window in hours. */
15
+ readonly precipitationWindowHours: number;
16
+ /** Response hydrograph half-life in hours. */
17
+ readonly hydrographHalfLifeHours: number;
18
+ /** Initial wet capture parameter in native capture units. */
19
+ readonly initialWetCapture: number;
20
+ /** Antecedent moisture half-life in hours. */
21
+ readonly moistureHalfLifeHours: number;
22
+ /** Temperature averaging window in hours. */
23
+ readonly temperatureWindowHours: number;
24
+ /** Spring cold seasonal hydrograph capture factor. */
25
+ readonly springColdShcf: number;
26
+ /** Hot seasonal hydrograph capture factor. */
27
+ readonly hotShcf: number;
28
+ /** Fall cold seasonal hydrograph capture factor. */
29
+ readonly fallColdShcf: number;
30
+ }
31
+
32
+ /** Detached baseflow AMM component. `kind` is exactly `"baseflow"`. */
33
+ export interface AmmBaseflowComponent {
34
+ /** Seasonal baseflow discriminator. */
35
+ readonly kind: "baseflow";
36
+ /** Component identity within this model. */
37
+ readonly id: string;
38
+ /** Precipitation averaging window in hours. */
39
+ readonly precipitationWindowHours: number;
40
+ /** Response hydrograph half-life in hours. */
41
+ readonly hydrographHalfLifeHours: number;
42
+ /** Temperature averaging window in hours. */
43
+ readonly temperatureWindowHours: number;
44
+ /** Spring cold capture parameter in native capture units. */
45
+ readonly springColdCapture: number;
46
+ /** Hot capture parameter in native capture units. */
47
+ readonly hotCapture: number;
48
+ /** Fall cold capture parameter in native capture units. */
49
+ readonly fallColdCapture: number;
50
+ }
51
+
52
+ /** AMM component discriminated by `kind`; component arrays are replaced as a whole. */
53
+ export type AmmComponent = AmmStandardComponent | AmmBaseflowComponent;
54
+
55
+ /** Complete AMM model configuration in native project units. */
56
+ export interface AmmModelConfiguration {
57
+ /** Canonical rain-gage ID. */
58
+ readonly rainGage: string;
59
+ /** Cold reference temperature in the model's configured temperature units. */
60
+ readonly coldTemperature: number;
61
+ /** Hot reference temperature in the model's configured temperature units. */
62
+ readonly hotTemperature: number;
63
+ /** Complete ordered standard/baseflow component list. */
64
+ readonly components: readonly AmmComponent[];
65
+ }
66
+
67
+ /** Sparse AMM model update. Omitted fields retain their current values. */
68
+ export interface AmmModelPatch {
69
+ /** {@inheritDoc AmmModelConfiguration.rainGage} */
70
+ rainGage?: string;
71
+ /** {@inheritDoc AmmModelConfiguration.coldTemperature} */
72
+ coldTemperature?: number;
73
+ /** {@inheritDoc AmmModelConfiguration.hotTemperature} */
74
+ hotTemperature?: number;
75
+ /** Replacement complete component array; omission retains it. */
76
+ components?: readonly AmmComponent[];
77
+ }
78
+
79
+ /** Detached AMM node assignment in native project units. IDs are canonical. */
80
+ export interface AmmAssignment {
81
+ /** Canonical receiving node ID. */
82
+ readonly node: string;
83
+ /** Canonical AMM-model ID. */
84
+ readonly model: string;
85
+ /** Assigned land area in acres (US) or hectares (SI). */
86
+ readonly area: number;
87
+ }
88
+
89
+ export interface AmmOperations {
90
+ ammModelConfiguration: { args: [string]; result: AmmModelConfiguration };
91
+ configureAmmModel: { args: [string, AmmModelPatch]; result: void };
92
+ ammAssignments: { args: []; result: readonly AmmAssignment[] };
93
+ replaceAmmAssignments: { args: [readonly AmmAssignment[]]; result: void };
94
+ }
95
+
96
+ /** Editable AMM definition from `simulation.ammModels`; node assignments are managed on the simulation. */
97
+ export class AmmModel {
98
+ /** Canonical configured model ID. */
99
+ readonly id: string;
100
+ readonly #call: Call;
101
+ private constructor(id: string, call: Call) { this.id = id; this.#call = call; Object.freeze(this); }
102
+ /** @internal */
103
+ static create(id: string, call: Call): AmmModel { return new AmmModel(id, call); }
104
+ /** Read the definition in any healthy owner state.
105
+ * @returns Detached complete AMM configuration.
106
+ */
107
+ configuration(): Promise<AmmModelConfiguration> { return this.#call("ammModelConfiguration", this.id); }
108
+ /** Atomically update an AMM definition in `open` or `ended`; accepted edits return the owner to `open`.
109
+ * @param patch - Sparse fields; supplying components replaces the complete array.
110
+ * @returns Resolves after all fields are accepted.
111
+ */
112
+ configure(patch: AmmModelPatch): Promise<void> { return this.#call("configureAmmModel", this.id, patch); }
113
+ }