Skip to content

Commit eaee439

Browse files
update code
1 parent 761ee8b commit eaee439

File tree

10 files changed

+32
-30
lines changed

10 files changed

+32
-30
lines changed

docs/zh/api/data/dataset.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66
members:
77
- IterableNamedArrayDataset
88
- NamedArrayDataset
9-
- CylinderDataset
10-
- LorenzDataset
11-
- RosslerDataset
129
- CSVDataset
13-
- MatDataset
10+
- IterableCSVDataset
1411
- ERA5Dataset
1512
- ERA5SampledDataset
13+
- IterableMatDataset
14+
- MatDataset
15+
- CylinderDataset
16+
- LorenzDataset
17+
- RosslerDataset
18+
- VtuDataset
1619
show_root_heading: false

docs/zh/api/equation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
- NavierStokes
1111
- NormalDotVec
1212
- Poisson
13+
- Vibration
1314
show_root_heading: false
1415
heading_level: 3

docs/zh/api/geometry.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,3 @@
2020
- TimeXGeometry
2121
show_root_heading: false
2222
heading_level: 3
23-
24-
<!-- # Geometry
25-
26-
::: ppsci.arch
27-
28-
This is on a separate line
29-
30-
$$
31-
\operatorname{ker} f=\{g\in G:f(g)=e_{H}\}{\mbox{.}}
32-
$$
33-
34-
The homomorphism $f$ is injective if and only if its kernel is only the
35-
singleton set $e_G$, because otherwise $\exists a,b\in G$ with $a\neq b$ such
36-
that $f(a)=f(b)$.
37-
38-
```python
39-
40-
--8<--
41-
./ppsci/data/dataset/array_dataset.py:16:49
42-
--8<--
43-
44-
``` -->

docs/zh/api/lr_scheduler.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
handler: python
55
options:
66
members:
7-
- ConstLR
87
- Linear
98
- Cosine
109
- Step

docs/zh/api/metric.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
handler: python
55
options:
66
members:
7+
- Metric
78
- MAE
89
- MSE
910
- RMSE

docs/zh/api/utils.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
- initializer
88
- logger
99
- misc
10-
- reader
10+
- load_csv_file
11+
- load_mat_file
12+
- load_vtk_file
1113
- run_check
1214
- AttrDict
1315
- ExpressionSolver

ppsci/arch/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ def concat_to_tensor(
6262
Returns:
6363
Tuple[paddle.Tensor, ...]: Concatenated tensor.
6464
"""
65+
if len(keys) == 1:
66+
return data_dict[keys[0]]
6567
data = [data_dict[key] for key in keys]
6668
return paddle.concat(data, axis)
6769

@@ -78,6 +80,8 @@ def split_to_dict(
7880
Returns:
7981
Dict[str, paddle.Tensor]: Dict contains tensor.
8082
"""
83+
if len(keys) == 1:
84+
return {keys[0]: data_tensor}
8185
data = paddle.split(data_tensor, len(keys), axis=axis)
8286
return {key: data[i] for i, key in enumerate(keys)}
8387

ppsci/utils/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
from ppsci.utils.expression import ExpressionSolver
2323
from ppsci.utils.misc import AverageMeter
2424
from ppsci.utils.misc import set_random_seed
25+
from ppsci.utils.reader import load_csv_file
26+
from ppsci.utils.reader import load_mat_file
27+
from ppsci.utils.reader import load_vtk_file
28+
from ppsci.utils.reader import load_vtk_with_time_file
2529
from ppsci.utils.save_load import load_checkpoint
2630
from ppsci.utils.save_load import load_pretrain
2731
from ppsci.utils.save_load import save_checkpoint
@@ -31,6 +35,10 @@
3135
"logger",
3236
"misc",
3337
"reader",
38+
"load_csv_file",
39+
"load_mat_file",
40+
"load_vtk_file",
41+
"load_vtk_with_time_file",
3442
"dynamic_import_to_globals",
3543
"run_check",
3644
"AttrDict",

ppsci/utils/reader.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727

2828
from ppsci.utils import logger
2929

30+
__all__ = [
31+
"load_csv_file",
32+
"load_mat_file",
33+
"load_vtk_file",
34+
"load_vtk_with_time_file",
35+
]
36+
3037

3138
def load_csv_file(
3239
file_path: str,
@@ -119,7 +126,7 @@ def load_vtk_file(
119126
input_keys: Tuple[str, ...],
120127
label_keys: Optional[Tuple[str, ...]],
121128
) -> Dict[str, np.ndarray]:
122-
"""load coordinates and attached label from the vtu file
129+
"""load coordinates and attached label from the *.vtu file.
123130
124131
Args:
125132
filename_without_timeid (str): File name without time id.

ppsci/visualize/visualizer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ class Visualizer3D(base.Visualizer):
291291
batch_size (int, optional): Batch size of data when computing result in visu.py. Defaults to 64.
292292
label_dict (Dict[str, np.ndarray]): Label dict.
293293
time_list (Optional[Tuple[float, ...]]): Time list.
294-
num_timestamps (int, optional): Number of timestamps.
295294
prefix (str, optional): Prefix for output file.
296295
"""
297296

0 commit comments

Comments
 (0)