-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Schema refs to v1 params that are converted to timeseries inputs…
… are now updated to timeseries refs (#191)
- Loading branch information
Showing
5 changed files
with
231 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 116 additions & 0 deletions
116
pywr-schema/src/test_models/v1/timeseries-converted.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
{ | ||
"metadata": { | ||
"title": "Simple timeseries", | ||
"description": null, | ||
"minimum_version": null | ||
}, | ||
"timestepper": { | ||
"start": "2021-01-01", | ||
"end": "2021-01-31", | ||
"timestep": 1 | ||
}, | ||
"scenarios": null, | ||
"network": { | ||
"nodes": [ | ||
{ | ||
"type": "Input", | ||
"name": "input1", | ||
"max_flow": { | ||
"type": "Timeseries", | ||
"name": "inflow", | ||
"columns": { | ||
"type": "Column", | ||
"name": "inflow1" | ||
} | ||
}, | ||
"min_flow": null, | ||
"cost": null | ||
}, | ||
{ | ||
"type": "Input", | ||
"name": "input2", | ||
"max_flow": { | ||
"type": "Parameter", | ||
"name": "factored_flow", | ||
"key": null | ||
}, | ||
"min_flow": null, | ||
"cost": null | ||
}, | ||
{ | ||
"type": "Link", | ||
"name": "link1", | ||
"max_flow": null, | ||
"min_flow": null, | ||
"cost": null | ||
}, | ||
{ | ||
"type": "Output", | ||
"name": "output1", | ||
"max_flow": { | ||
"type": "Parameter", | ||
"name": "demand", | ||
"key": null | ||
}, | ||
"min_flow": null, | ||
"cost": { | ||
"type": "Constant", | ||
"value": -10.0 | ||
} | ||
} | ||
], | ||
"edges": [ | ||
{ | ||
"from_node": "input1", | ||
"to_node": "link1" | ||
}, | ||
{ | ||
"from_node": "input2", | ||
"to_node": "link1" | ||
}, | ||
{ | ||
"from_node": "link1", | ||
"to_node": "output1" | ||
} | ||
], | ||
"parameters": [ | ||
{ | ||
"type": "Constant", | ||
"name": "demand", | ||
"value": 100.0 | ||
}, | ||
{ | ||
"type": "Aggregated", | ||
"name": "factored_flow", | ||
"agg_func": "product", | ||
"metrics": [ | ||
{ | ||
"type": "Timeseries", | ||
"name": "inflow", | ||
"columns": { | ||
"type": "Column", | ||
"name": "inflow1" | ||
} | ||
}, | ||
{ | ||
"type": "Constant", | ||
"value": 0.5 | ||
} | ||
] | ||
} | ||
], | ||
"tables": null, | ||
"timeseries": [ | ||
{ | ||
"name": "inflow", | ||
"provider": { | ||
"type": "Polars", | ||
"time_col": null, | ||
"url": "inflow.csv" | ||
} | ||
} | ||
], | ||
"metric_sets": null, | ||
"outputs": null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"metadata": { | ||
"title": "Simple timeseries" | ||
}, | ||
"timestepper": { | ||
"start": "2021-01-01", | ||
"end": "2021-01-31", | ||
"timestep": 1 | ||
}, | ||
"nodes": [ | ||
{ | ||
"name": "input1", | ||
"type": "Input", | ||
"max_flow": "inflow" | ||
}, | ||
{ | ||
"name": "input2", | ||
"type": "Input", | ||
"max_flow": "factored_flow" | ||
}, | ||
{ | ||
"name": "link1", | ||
"type": "Link" | ||
}, | ||
{ | ||
"name": "output1", | ||
"type": "Output", | ||
"max_flow": "demand", | ||
"cost": -10 | ||
} | ||
], | ||
"edges": [ | ||
["input1", "link1"], | ||
["input2", "link1"], | ||
["link1", "output1"] | ||
], | ||
"parameters": { | ||
"demand": { | ||
"type": "constant", | ||
"value": 100.0 | ||
}, | ||
"inflow": { | ||
"type": "dataframe", | ||
"url" : "inflow.csv", | ||
"parse_dates": true, | ||
"dayfirst": true, | ||
"index_col": 0, | ||
"column": "inflow1" | ||
}, | ||
"factored_flow": { | ||
"type": "aggregated", | ||
"agg_func":"product", | ||
"parameters": [ | ||
"inflow", | ||
0.5 | ||
] | ||
} | ||
} | ||
} |