> For the complete documentation index, see [llms.txt](https://water-strategy.gitbook.io/waterstrategy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://water-strategy.gitbook.io/waterstrategy/modeling-basics/scenarios/pywr-scenarios.md).

# Pywr-Scenarios

Pywr Scenarios offer a more advanced and comprehensive approach to water management modeling, particularly when working with uncertainty and asessing various combinations of data and system behaviors and data inputs. Unlike WaterStrategy Scenarios, which focus on localized adjustments, Pywr Scenarios allow you to experiment with a wide range of possibilities by varying multiple inputs and combinations simultaneously.

In Pywr Scenarios:

* Users can define multiple scenarios, with each scenario containing multiple variations (or sizes).
* The system will simulate all combinations of these variations unless a specific combination is selected for simulation.

For example, if two Pywr Scenarios are defined, each with three variations (size = 3), the total number of simulations will be 9 (3 x 3). This approach enables users to explore a wide range of potential outcomes and interactions between different factors in the model.

## 1.  Activating Pywr Scenarios

In a Network, click on *View Network Data* icon <img src="/files/PC20ihPELksRKrFpa6oW" alt="" data-size="line">

This will open the right panel. In the section **Inputs**, type "*scenarios"* and click on *Add an Input* icon <img src="/files/zJ3lJLUI7OC0ctEvgXzf" alt="" data-size="line">

<figure><img src="/files/OH7FDPzXtRTCcZKbgzYO" alt=""><figcaption></figcaption></figure>

A window will be displayed, type "*scenarios"*, select the **scenarios** attribute and click **Save** as shown in the following image

<figure><img src="/files/XoTOfXGYof24o6hrNb8s" alt=""><figcaption></figcaption></figure>

A new window will pop up, select **PYWR\_SCENARIOS** and click **Save**

<figure><img src="/files/U0hhQomP7QCJYPVMlDWq" alt=""><figcaption></figcaption></figure>

## 2.  Creating pywr-scenarios

Once the scenario customization panel is open, you can define as many Pywr Scenarios as needed. To create a new Pywr Scenario, follow these steps:

Click <img src="/files/XO1EjEBMVuD8Hdm09cTi" alt="" data-size="line">

<figure><img src="/files/GCXgTGBnIOLKO70V2brP" alt=""><figcaption></figcaption></figure>

Edit the current default scenario by clicking on <img src="/files/ZeZQus4TwMf6W3F9Fbn1" alt="" data-size="line">

Enter a **Name** for the Pywr-Scenario and specify the **Size** (number of variations).

The **Ensembles** attribute is optional and helps keep track of specific index scenarios within the Pywr Scenario

<figure><img src="/files/xCM3aMol9CfTR8s6R8Ei" alt=""><figcaption></figcaption></figure>

After creating the pywr-scenarios, the system will display the following information:

<figure><img src="/files/MOTsw1l4azceKOj6bLgm" alt=""><figcaption></figcaption></figure>

Clicking on the **JSON** tab will display the automatic JSON version of the **Pywr-Scenario** definition

<figure><img src="/files/W46FSlPsgud2iZzPm2qi" alt="" width="409"><figcaption></figcaption></figure>

To load the data as h5 DataFrameParameter, please refer to [HDF5 Parameter section](/waterstrategy/modeling-basics/parameters/hdf5-parameter.md) in order to access properly to the scenario data


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://water-strategy.gitbook.io/waterstrategy/modeling-basics/scenarios/pywr-scenarios.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
