Supported formats
Models
Section titled “Models”| Pywr v2 | Pywr v1 | |
|---|---|---|
| Library | pywr-next | pywr |
| A JSON file is recognised when it has | the metadata, time and network sections |
a timestepper section and a list of nodes, and no network section |
| Shown in the status bar as | Pywr v2 model | Pywr v1 model |
| Checked against | the Pywr schema | a schema of the pywr types written for the extension |
| Components | nodes, virtual nodes, edges, parameters, metric sets, outputs, timeseries, tables, scenario groups | nodes, edges, parameters, recorders, tables, scenarios, included files |
| Custom components | Python parameters | Python classes in the files listed in includes, and in compiled Cython modules |
The extension supports Pywr v2 from version 2.0.0-rc1. A Pywr v2 model with more than one network is not supported.
Running
Section titled “Running”| Pywr v2 | Pywr v1 | |
|---|---|---|
| Runs with | the Pywr engine built into the extension | pywr 1 installed in your Python environment |
| Python | an environment with Python 3.10 or later | an environment with pywr 1 |
| Solvers | CLP (default), HiGHS, CBC, microlp | GLPK, GLPK edge, lp_solve |
| Scenarios to run | a range (0:2) or a list of positions (0, 2, 4) |
a range (0:2) |
| Results saved in | a new dated folder in results, next to the model |
the files set in the recorders of the model |
The Python environment must be a virtual environment or a conda environment. A system-wide Python and a free-threaded build of Python are not supported.
Results files
Section titled “Results files”The results viewer reads these files. The format it found is shown at the top of the viewer.
| Format | Written by | File |
|---|---|---|
| HDF5 | The HDF5 output of Pywr v2 |
.h5, .hdf5 |
| CSV, wide format | The CSV output of Pywr v2 with the Wide format |
.csv |
| CSV, long format | The CSV output of Pywr v2 with the Long format |
.csv |
| Arrow stream | The ArrowStream output of Pywr v2 |
.arrow |
| HDF5, pywr-1 TablesRecorder | The TablesRecorder of Pywr v1, including scenario combinations and slices |
.h5, .hdf5 |
| HDF5, pywr-1 TablesRecorder | The TablesRecorder2 of Pywr v1, with the minimum and maximum of each node |
.h5, .hdf5 |
| CSV, pywr-1 CSVRecorder | The CSVRecorder of Pywr v1 |
.csv |
An .h5, .hdf5 or .arrow file opens in the viewer when you click it. A .csv file opens as
text; right-click it and pick Open the results chart.
Compression of HDF5 files
Section titled “Compression of HDF5 files”| Read | Not read |
|---|---|
| zlib, lzf, and blosc with blosclz, lz4, lz4hc, zlib or zstd | blosc2, bzip2, lzo |
Data files
Section titled “Data files”- Tables and timeseries can read the files Pywr supports. The preview in a form is for CSV files only.
- The preview reads the start of the file and shows its first 50 rows.
The QA report
Section titled “The QA report”| Pywr v2 | Pywr v1 | |
|---|---|---|
| Components on a chart | nodes, virtual nodes, parameters and edges | nodes and named parameters |
| What a node shows | the attribute you pick, or the default one | its flow, or its volume when it is a storage node |
| Exported with | a metric set and an HDF5 output | a TablesRecorder, which needs PyTables |
| Outputs of the model | not written during the run of the report | written in results/qa, not over your results |
For both, the report is saved in <model>.qa.json next to the model, its results in
results/qa and replaced at each run, and the charts are exported as PDF.
Requirements
Section titled “Requirements”- VS Code 1.110 or later.
- The Python extension, installed with this one.
- An internet connection only for the map of the schematic.