Exporting and Importing Models

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

Video showing how to export and import Pywr JSON files into Water Strategy

Exporting and Importing Models

Export Pywr files

This section uses the 'demo one network' provided when you create an account.

Demo one network

First click the download button.

Click the download button

Then, we are going to choose our format.

Choose the Hydra JSON 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.

Select these functions according to your needs

Submit it.

Click to submit

Next, download the Pywr JSON format.

Download the Pywr JSON

Then, you can find the two files in the folder you chose to save them in.

Pywr files in the folder

Import Pywr files

Let's see how to import Pywr files.

First, click the 'Create Project' to create a project folder in your Water Strategy account.

Create a project

Name the project and click 'Add'.

Name the project and click 'Add'

Click the created project.

Click the created project

Click 'Create Network'.

Click 'Create Network'

Select 'Hydra JSON'.

Select 'Hydra JSON'

Click 'Choose File'.

Click 'Choose File'

Choose the Hydra JSON file.

Choose the Hydra JSON file

Select the template.

Select the template

Click 'Submit'.

Click 'Submit'

Then, you can find the network is imported.

Network has been imported

To import the Pywr JSON file, you can follow these steps.

Click 'Create Network' again.

Click 'Create Network'

Choose the 'Pywr JSON'.

Choose the 'Pywr JSON'

Click 'Choose File'.

Click 'Choose File'

Choose the Pywr JSON file.

Choose the Pywr JSON file

Choose the template.

Choose the template

For projection, you can choose 'None', 'UK', or 'World'. In this case, we will choose the 'World'.

Choose the projection

Click 'Submit'.

Click 'Submit'

Finally, you can the imported network here.

The imported network

Last updated

Was this helpful?