Exporting and Importing Models
Last updated
Last updated
WaterStrategy isn't required to run a Pywr model; it is there to help make it easier to use Pywr models. If you have a Pywr model input file (they are called 'JSON' files), and you have the required Python and Pywr libraries installed on your computer, you can run your Pywr model without WaterStrategy (Note: Python skills are required). Equally, if you have an existing Pywr model (a JSON file), you can import it into WaterStrategy.
This page shows how to export models from WaterStrategy into a Pywr JSON files and how to import existing Pywr models (JSON files) into WaterStrategy
This section uses the 'demo one network' provided when you create an account.
First click the download button.
Then, we are going to choose our format.
Choose the Hydra JSON format first. If you want to enable line breaks that makes your code or text easier to read. If it's a large file you can zip it.
Submit it.
Next, download the Pywr JSON format.
Then, you can find the two files in the folder you chose to save them in.
Let's see how to import Pywr files.
First, click the 'Create Project' to create a project folder in your Water Strategy account.
Name the project and click 'Add'.
Click the created project.
Click 'Create Network'.
Select 'Hydra JSON'.
Click 'Choose File'.
Choose the Hydra JSON file.
Select the template.
Click 'Submit'.
Then, you can find the network is imported.
To import the Pywr JSON file, you can follow these steps.
Click 'Create Network' again.
Choose the 'Pywr JSON'.
Click 'Choose File'.
Choose the Pywr JSON file.
Choose the template.
For projection, you can choose 'None', 'UK', or 'World'. In this case, we will choose the 'World'.
Click 'Submit'.
Finally, you can the imported network here.