Skip to content

Commit

Permalink
[Fix] Fix doc and requirements.txt (PaddlePaddle#692)
Browse files Browse the repository at this point in the history
* fix(test=document_fix)

* replace wrong symbols

* enlarge readalbe page width to a relative ratio(70%), update document and requirements.txt
  • Loading branch information
HydrogenSulfate committed Dec 11, 2023
1 parent 9239eb8 commit 4b4b5c3
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
pip install paddlesci
```

=== "[完整安装流程](./zh/install_setup.md)"
- **完整安装流程**[安装与使用](./zh/install_setup.md)

--8<--
./README.md:feature
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Jinja2==3.0.3
Jinja2~=3.1
matplotlib
mkdocs
mkdocs-autorefs
Expand Down
2 changes: 1 addition & 1 deletion docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

.md-grid {
/* readable page width */
max-width: 1440px;
max-width: 70%;
}

.md-header__topic > .md-ellipsis {
Expand Down
4 changes: 2 additions & 2 deletions docs/zh/examples/labelfree_DNN_surrogate.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ examples/pipe/poiseuille_flow.py:152:164

1. 在 $x=0$ 截面速度 $u(y)$$y$ 在四种不同的动力粘性系数 ${\nu}$ 采样下的曲线和解析解的对比

2. 当我们选取截断高斯分布的动力粘性系数 ${\nu}$ 采样(均值为 $\hat{\nu} = 10^{−3}$, 方差 $\sigma_{\nu}​=2.67×10^{−4}$),中心处速度的概率密度函数和解析解对比
2. 当我们选取截断高斯分布的动力粘性系数 ${\nu}$ 采样(均值为 $\hat{\nu} = 10^{−3}$, 方差 $\sigma_{\nu}​=2.67 \times 10^{−4}$),中心处速度的概率密度函数和解析解对比

``` py linenums="166"
--8<--
Expand All @@ -253,7 +253,7 @@ examples/pipe/poiseuille_flow.py

<figure markdown>
![laplace 2d]( https://paddle-org.bj.bcebos.com/paddlescience/docs/labelfree_DNN_surrogate/pipe_result.png){ loading=lazy }
<figcaption>(左)在 x=0 截面速度 u(y) 随 y 在四种不同的动力粘性系数采样下的曲线和解析解的对比 (右)当我们选取截断高斯分布的动力粘性系数 nu 采样(均值为 nu=0.001, 方差 sigma​=2.67×10e4),中心处速度的概率密度函数和解析解对比</figcaption>
<figcaption>(左)在 x=0 截面速度 u(y) 随 y 在四种不同的动力粘性系数采样下的曲线和解析解的对比 (右)当我们选取截断高斯分布的动力粘性系数 nu 采样(均值为 nu=0.001, 方差 sigma​=2.67 x 10e4),中心处速度的概率密度函数和解析解对比</figcaption>
</figure>

DNN代理模型的结果如左图所示,和泊肃叶流动的精确解(论文公式13)进行比较:
Expand Down
6 changes: 3 additions & 3 deletions docs/zh/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pip install hydra-core

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

``` shell title=">>> python bracket.py {++-c job++}"
``` shell title="$ python bracket.py {++-c job++}"
mode: train
seed: 2023
output_dir: ${hydra:run.dir}
Expand Down Expand Up @@ -95,7 +95,7 @@ TRAIN:

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

``` shell title=">>> python bracket.py {++-m seed=42,1024 TRAIN.epochs=10,20++}"
``` shell 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/"
``` shell title="$ tree PaddleScience/examples/bracket/outputs_bracket/"
PaddleScience/examples/bracket/outputs_bracket/
└──2023-10-14 # (1)
└── 04-01-52 # (2)
Expand Down
4 changes: 2 additions & 2 deletions ppsci/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,13 @@ def cartesian_product(*arrays: np.ndarray) -> np.ndarray:
Reference: https://stackoverflow.com/questions/11144513/cartesian-product-of-x-and-y-array-points-into-single-array-of-2d-points
Assume shapes of input arrays are: $(N_1,), (N_2,), (N_3,), ..., (N_M,)$,
then the cartesian product result will be shape of $(N_1×N_2×N_3×...×N_M, M)$.
then the cartesian product result will be shape of $(N_1xN_2xN_3x...xN_M, M)$.
Args:
arrays (np.ndarray): Input arrays.
Returns:
np.ndarray: Cartesian product result of shape $(N_1×N_2×N_3×...×N_M, M)$.
np.ndarray: Cartesian product result of shape $(N_1xN_2xN_3x...xN_M, M)$.
Examples:
>>> t = np.array([1, 2])
Expand Down
25 changes: 12 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,25 @@ classifiers = [
"Topic :: Scientific/Engineering :: Mathematics",
]
dependencies = [
"numpy>=1.20.0,<=1.23.1",
"sympy",
"colorlog",
"h5py",
"hydra-core",
"imageio",
"matplotlib",
"vtk",
"meshio==5.3.4",
"numpy>=1.20.0,<=1.23.1",
"pyevtk",
"wget",
"scipy",
"visualdl",
"pyvista==0.37.0",
"pyyaml",
"scikit-optimize",
"h5py",
"meshio==5.3.4",
"scipy",
"seaborn",
"sympy",
"tqdm",
"imageio",
"typing-extensions",
"seaborn",
"colorlog",
"hydra-core",
"opencv-python",
"visualdl",
"vtk",
"wget",
]

[project.urls]
Expand Down

0 comments on commit 4b4b5c3

Please sign in to comment.