Skip to content

Commit

Permalink
convert all sh
Browse files Browse the repository at this point in the history
  • Loading branch information
HydrogenSulfate committed Jan 12, 2024
1 parent 98a561d commit 37f6f2a
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 24 deletions.
Binary file modified docs/images/quickstart/u_pred_case1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@

=== "方式2: pip安装"

``` shell
``` sh
pip install paddlesci
```

Expand Down
8 changes: 4 additions & 4 deletions docs/zh/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ if __name__ == "__main__":
PaddleScience 内置了一些常见的模型,如 `MLP` 模型,如果您想使用这些内置的模型,可以直接调用 [`ppsci.arch.*`](./api/arch.md) 下的 API,并填入模型实例化所需的参数,即可快速构建模型。
``` py title="examples/demo/demo.py"
``` py title="examples/demo/demo.py"
# create a MLP model
model = ppsci.arch.MLP(("x", "y"), ("u", "v", "p"), 9, 50, "tanh")
```
Expand Down Expand Up @@ -638,7 +638,7 @@ solver.visualize()
文档撰写过程中需进行即时渲染,预览文档内容以检查撰写的内容是否有误。因此需要按照如下命令,安装 mkdocs 相关依赖包。
``` shell
``` sh
pip install -r docs/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
```
Expand All @@ -650,7 +650,7 @@ PaddleScience 文档基于 [Mkdocs-Material](https://squidfunk.github.io/mkdocs-
`PaddleScience/` 目录下执行以下命令,等待构建完成后,点击显示的链接进入本地网页预览文档内容。
``` shell
``` sh
mkdocs serve
# ====== 终端打印信息如下 ======
Expand All @@ -667,7 +667,7 @@ mkdocs serve
若默认端口号 8000 被占用,则可以手动指定服务部署的地址和端口,示例如下。
``` shell
``` sh
# 指定 127.0.0.1 为地址,8687 为端口号
mkdocs serve -a 127.0.0.1:8687
```
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/examples/amgnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

执行以下命令,下载并解压数据集。

``` shell
``` sh
wget -nc https://paddle-org.bj.bcebos.com/paddlescience/datasets/AMGNet/data.zip
unzip data.zip
```
Expand Down
6 changes: 3 additions & 3 deletions docs/zh/examples/cfdgcn.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

执行以下命令,下载并解压数据集。

``` shell
``` sh
wget -nc https://paddle-org.bj.bcebos.com/paddlescience/datasets/CFDGCN/data.zip
unzip data.zip
wget https://paddle-org.bj.bcebos.com/paddlescience/datasets/CFDGCN/meshes.tar
Expand All @@ -74,14 +74,14 @@ SU2 流体模拟器以预编译库的形式嵌入在网络中,我们需要下

执行以下命令,下载并解压预编译库。

``` shell
``` sh
wget -nc -P https://paddle-org.bj.bcebos.com/paddlescience/datasets/CFDGCN/SU2Bin.tgz
tar -zxvf SU2Bin.tgz
```

预编译库下载完成后,设置 SU2 的环境变量。

``` shell
``` sh
export SU2_RUN=/absolute_path/to/SU2Bin/
export SU2_HOME=/absolute_path/to/SU2Bin/
export PATH=$PATH:$SU2_RUN
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/examples/deepcfd.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ $$u_x\frac{\partial u_y}{\partial x} + u_y\frac{\partial u_y}{\partial y} = - \f

运行本问题代码前请按照下方命令下载 [dataX](https://paddle-org.bj.bcebos.com/paddlescience/datasets/DeepCFD/dataX.pkl)[dataY](https://paddle-org.bj.bcebos.com/paddlescience/datasets/DeepCFD/dataY.pkl)

``` shell
``` sh
wget -nc -P ./datasets/ https://paddle-org.bj.bcebos.com/paddlescience/datasets/DeepCFD/dataX.pkl
wget -nc -P ./datasets/ https://paddle-org.bj.bcebos.com/paddlescience/datasets/DeepCFD/dataY.pkl
```
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/examples/hpinns.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ $$

运行本问题代码前请按照下方命令下载 [训练数据集](https://paddle-org.bj.bcebos.com/paddlescience/datasets/hPINNs/hpinns_holo_train.mat)[验证数据集](https://paddle-org.bj.bcebos.com/paddlescience/datasets/hPINNs/hpinns_holo_valid.mat)

``` shell
``` sh
wget -nc -P ./datasets/ https://paddle-org.bj.bcebos.com/paddlescience/datasets/hPINNs/hpinns_holo_train.mat
wget -nc -P ./datasets/ https://paddle-org.bj.bcebos.com/paddlescience/datasets/hPINNs/hpinns_holo_valid.mat
```
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/examples/phylstm.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ DeepPhyLSTM 参数 input_size 是输入大小,output_size 是输出大小,hi

运行本问题代码前请按照下方命令下载 [data_boucwen.mat](https://paddle-org.bj.bcebos.com/paddlescience/datasets/PhyLSTM/data_boucwen.mat)

``` shell
``` sh
wget -nc -P ./ https://paddle-org.bj.bcebos.com/paddlescience/datasets/PhyLSTM/data_boucwen.mat
```

Expand Down
10 changes: 5 additions & 5 deletions docs/zh/install_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

执行以下命令以 pip 的方式安装 PaddleScience。

``` shell
``` sh
pip install paddlesci
```

Expand Down Expand Up @@ -139,7 +139,7 @@ pybind11、pysdf、PyMesh 四个依赖库。

- 执行以下代码,验证安装的 PaddleScience 基础功能是否正常。

``` shell
``` sh
python -c "import ppsci; ppsci.run_check()"
```

Expand All @@ -148,7 +148,7 @@ pybind11、pysdf、PyMesh 四个依赖库。
- [可选]如果已按照 [1.4.3 额外依赖安装](#143) 正确安装了 4 个额外依赖库,则可以执行以下代码,
验证 PaddleScience 的 `ppsci.geometry.Mesh` 模块是否能正常运行。

``` shell
``` sh
python -c "import ppsci; ppsci.run_check_mesh()"
```

Expand All @@ -158,7 +158,7 @@ pybind11、pysdf、PyMesh 四个依赖库。

- 运行内置的案例(以 **ldc2d_unsteady_Re10.py** 为例)

``` shell
``` sh
cd examples/ldc/
python ./ldc2d_unsteady_Re10.py
```
Expand All @@ -175,7 +175,7 @@ pybind11、pysdf、PyMesh 四个依赖库。

编写完毕后运行你的代码

``` shell
``` sh
cd examples/demo
python ./demo.py
```
Expand Down
12 changes: 6 additions & 6 deletions docs/zh/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ PaddleScience 推荐使用 [YAML](https://pyyaml.org/wiki/PyYAMLDocumentation)

在使用 hydra 配置运行参数前,请先执行以下命令检查是否已安装 `hydra`

``` shell
``` sh
pip show hydra-core
```

如未安装,则需执行以下命令安装 `hydra`

``` shell
``` sh
pip install hydra-core
```

Expand All @@ -28,7 +28,7 @@ pip install hydra-core

以 bracket 案例为例,其正常运行命令为:`python bracket.py`。若在其运行命令末尾加上 `-c job`,则可以打印出从运行配置文件 `conf/bracket.yaml` 中解析出的配置参数,如下所示。

``` shell title="$ python bracket.py {++-c job++}"
``` sh title="$ python bracket.py {++-c job++}"
mode: train
seed: 2023
output_dir: ${hydra:run.dir}
Expand Down Expand Up @@ -74,7 +74,7 @@ TRAIN:
- 将上述配置文件中的 `learning_rate: 0.001` 改为 `learning_rate: 0.002`,然后再运行程序。这种方式虽然简单,但在实验较多时容易造成实验混乱,因此不推荐使用。
- 通过命令行参数的方式进行修改,如下所示。

``` shell
``` sh
python bracket.py {++TRAIN.lr_scheduler.learning_rate=0.002++}
```

Expand All @@ -95,7 +95,7 @@ TRAIN:

执行如下命令即可按顺序自动运行这 4 组实验。

``` shell title="$ python bracket.py {++-m seed=42,1024 TRAIN.epochs=10,20++}"
``` sh title="$ python bracket.py {++-m seed=42,1024 TRAIN.epochs=10,20++}"
[HYDRA] Launching 4 jobs locally
[HYDRA] #0 : seed=42 TRAIN.epochs=10
....
Expand All @@ -109,7 +109,7 @@ TRAIN:

多组实验各自的参数文件、日志文件则保存在以不同参数组合为名称的子文件夹中,如下所示。

``` shell title="$ tree PaddleScience/examples/bracket/outputs_bracket/"
``` sh title="$ tree PaddleScience/examples/bracket/outputs_bracket/"
PaddleScience/examples/bracket/outputs_bracket/
└──2023-10-14 # (1)
└── 04-01-52 # (2)
Expand Down
2 changes: 1 addition & 1 deletion examples/quick_start/case1.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def sin_compute_func(data: dict):
visual_input_dict = {
"x": np.linspace(l_limit, r_limit, 1000, dtype="float32").reshape(1000, 1)
}
visual_input_dict["u_ref"] = np.sin(visual_input_dict["x"]) + 2.0
visual_input_dict["u_ref"] = np.sin(visual_input_dict["x"])
visualizer = {
"visualize_u": ppsci.visualize.VisualizerScatter1D(
visual_input_dict,
Expand Down

0 comments on commit 37f6f2a

Please sign in to comment.