> 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/russkii/uchebnye-posobiya/pywr-scenarios-reading-external-dataframe-and-adding-custom-rules.md).

# PyWR-сценарии, считывающие внешний DataFrame и добавляющие собственные правила

В этом уроке мы будем работать с **Сеть Темзы**, копию которого вы автоматически получаете при создании учетной записи WaterStrategy.

Охватываемые шаги включают:

1. **Обновление спроса в долине Ли**: Мы прочитаем и обновим данные о спросе в долине Ли из внешнего CSV-файла, содержащего временные ряды.
2. **Применение неопределенности в связи с изменением климата**: Неопределенности, связанные с изменением климата, будут введены путем активации **сценарии pywr-**. Эти неопределенности будут применены к двум водосборным узлам (притокам), при этом условия притока будут скорректированы на основе заданных сценариев.
3. **Добавление настраиваемого правила**: Вы узнаете, как создать настраиваемое правило — мощный инструмент, позволяющий расширить и интегрировать функциональность WaterStrategy. В этом примере будет создан новый параметр для динамического увеличения максимального объема резервуара в определенную дату, определенную пользователем.

К концу этого урока вы научитесь управлять и настраивать различные аспекты сети Темзы в WaterStrategy, используя данные временных рядов, сценарии неопределенности и специальные правила.

Необходимые файлы будут загружены вручную, поэтому обязательно сохраните их на своем компьютере для удобного доступа во время обучения.

* [Темза\ \_Ли\ \_Долина\ \_спрос](https://nexsysanalytics-my.sharepoint.com/:x:/g/personal/jgonzalez_nexsys-analytics_com/ERY5QXJtGQtFpo7PKUUykJEBI9g6adLvCwxG90xhZqgySQ?e=b4brjW)
* [Темза\ \_притоки\ \_PywrScenarios.h5](https://nexsysanalytics-my.sharepoint.com/:u:/g/personal/jgonzalez_nexsys-analytics_com/EV7TBf9J_WZDpF3Oy6HyNmoBj3F4Ew216OE9ltOCC1P8pw?e=YV1A3q)

Для начала, в **Учебные материалы по проекту**, открыть **Темза** сеть

<figure><img src="https://3817892601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn9Lkjv9vPu8czwmW2MeG%2Fuploads%2Fgit-blob-b4c7e0cfddce6b09a343bf0faf44c97cd0c47b91%2Fimage%20(29).png?alt=media" alt=""><figcaption></figcaption></figure>

Клон **Сценарий 1**

<figure><img src="https://3817892601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn9Lkjv9vPu8czwmW2MeG%2Fuploads%2Fgit-blob-dd671f64eae3427748517fbcc7192ea4b7e2d14d%2Fimage%20(27).png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

<figure><img src="https://3817892601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn9Lkjv9vPu8czwmW2MeG%2Fuploads%2Fgit-blob-e7698d7acd98322487738c85907812450a0e2b7e%2Fimage%20(28).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://water-strategy.gitbook.io/waterstrategy/russkii/uchebnye-posobiya/pywr-scenarios-reading-external-dataframe-and-adding-custom-rules.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
