# 导出和导入模型

运行 Pywr 模型不需要 WaterStrategy；它可以帮助用户更轻松地使用 Pywr 模型。如果你有 Pywr 模型输入文件（它们被称为 “JSON” 文件），并且你的计算机上安装了所需的 Python 和 Pywr 库，则可以在没有 WaterStrategy 的情况下运行 Pywr 模型（注意：需要 Python 技能）。同样，如果你有 Pywr 模型（一个 JSON 文件），你可以将其导入到 **1234567890**\_\_ 中。

本页介绍如何将模型从 WaterStrategy 导出到 Pywr JSON 文件中，以及如何将现有 Pywr 模型（JSON 文件）导入到 WaterStrategy

{% embed url="<https://www.youtube.com/watch?v=g85GWm-qPOA>" %}
展示如何将 Pywr JSON 文件导出和导入到 Water Strategy 的视频
{% endembed %}

## 导出和导入模型

### 导出 Pywr 文件

本节使用创建账户时提供的 “演示网络”。

<figure><img src="/files/Ab4e8xme51mFK1lTbqTA" alt=""><figcaption><p>演示一个网络</p></figcaption></figure>

首先点击下载按钮。

<figure><img src="/files/d7ighvuJjXvOoWoDt1Gl" alt="" width="213"><figcaption><p>点击下载按钮</p></figcaption></figure>

然后，我们将选择我们的格式。

<figure><img src="/files/9MMzawJ8SmBB6Ncd3zOO" alt="" width="266"><figcaption><p>选择 Hydra JSON 格式</p></figcaption></figure>

首先选择 Hydra JSON 格式。如果你想启用换行符，让你的代码或文本更易于阅读。如果它是一个大文件，你可以压缩它。

<figure><img src="/files/GDgDf22uIU117yCPM205" alt="" width="375"><figcaption><p>根据您的需要选择这些功能</p></figcaption></figure>

提交。

<figure><img src="/files/UYwab7dzOFoZv3ugzYu2" alt="" width="375"><figcaption><p>点击提交</p></figcaption></figure>

接下来，下载 Pywr JSON 格式。

<figure><img src="/files/cpTd1IaOMBPMK0x3Edzq" alt="" width="264"><figcaption><p>下载 Pywr JSON</p></figcaption></figure>

然后，你可以在你选择保存它们的文件夹中找到这两个文件。

<figure><img src="/files/dWYrd4KgjwY3JyGlUnYZ" alt="" width="375"><figcaption><p>Pywr 文件夹中的文件</p></figcaption></figure>

### 导入 Pywr 文件

让我们看看如何导入 Pywr 文件。

首先，点击 “创建项目”，在你的 Water Strategy 账户中创建一个项目文件夹。

<figure><img src="/files/AgWbQjSu4dNvkuPmFQ9R" alt=""><figcaption><p>创建项目</p></figcaption></figure>

为项目命名，然后单击 “添加”。

<figure><img src="/files/vCTct8UFGVADbfLsbb66" alt=""><figcaption><p>为项目命名并点击 “添加”</p></figcaption></figure>

点击创建的项目。

<figure><img src="/files/4PFBJSRyYjgJtadFRVQZ" alt=""><figcaption><p>点击创建的项目</p></figcaption></figure>

点击 “创建网络”。

<figure><img src="/files/1PvFgXEp479PiLZK42wT" alt=""><figcaption><p>点击 “创建网络”</p></figcaption></figure>

选择 “Hydra JSON”。

<figure><img src="/files/u6JEvqIBceilWKtFe8ay" alt="" width="375"><figcaption><p>选择 “Hydra JSON”</p></figcaption></figure>

点击 “选择文件”。

<figure><img src="/files/xC9U12QPbWerkb0A4nkj" alt="" width="375"><figcaption><p>点击 “选择文件”</p></figcaption></figure>

选择 Hydra JSON 文件。

<figure><img src="/files/nyN9zOoFwZ0bfyesvEh8" alt=""><figcaption><p>选择 Hydra JSON 文件</p></figcaption></figure>

选择模板。

<figure><img src="/files/YhQ0XXPEWXkznW4Yu1dn" alt="" width="375"><figcaption><p>选择模板</p></figcaption></figure>

点击 “提交”。

<figure><img src="/files/9HNtDOz67MTkGBItcZl0" alt="" width="375"><figcaption><p>点击 “提交”</p></figcaption></figure>

然后，你可以发现网络已导入。

<figure><img src="/files/E5bDymzGxZQufU77NEEK" alt="" width="375"><figcaption><p>网络已导入</p></figcaption></figure>

要导入 Pywr JSON 文件，您可以按照以下步骤操作。

再次点击 “创建网络”。

<figure><img src="/files/cPZGq6xQypVWegfLaT6y" alt=""><figcaption><p>点击 “创建网络”</p></figcaption></figure>

选择 “Pywr JSON”。

<figure><img src="/files/HvBwZKAuXedIv2Pgt5jH" alt="" width="370"><figcaption><p>选择 “Pywr JSON”</p></figcaption></figure>

点击 “选择文件”。

<figure><img src="/files/Z02JtLJokLF2t6hRenRb" alt="" width="375"><figcaption><p>点击 “选择文件”</p></figcaption></figure>

选择 Pywr JSON 文件。

<figure><img src="/files/Dsp576jYhs5jyafC2OGO" alt=""><figcaption><p>选择 Pywr JSON 文件</p></figcaption></figure>

选择模板。

<figure><img src="/files/J30BLhPN2vmryfOYwtKb" alt="" width="369"><figcaption><p>选择模板</p></figcaption></figure>

对于投影，您可以选择 “无”、“英国” 或 “世界”。在这种情况下，我们将选择 “世界”。

<figure><img src="/files/zEmOtk4XtyHKRRYA6mso" alt="" width="375"><figcaption><p>选择投影</p></figcaption></figure>

点击 “提交”。

<figure><img src="/files/Kw9zlnOn8z660icHM1q6" alt="" width="375"><figcaption><p>点击 “提交”</p></figcaption></figure>

最后，你可以在这里查看导入的网络。

<figure><img src="/files/527ACLvkU46Ur5nvKsNu" alt=""><figcaption><p>导入的网络</p></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://water-strategy.gitbook.io/waterstrategy/zhong-guo-ren/ru-men/exporting-and-importing-models.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
