File tree Expand file tree Collapse file tree 10 files changed +32
-30
lines changed Expand file tree Collapse file tree 10 files changed +32
-30
lines changed Original file line number Diff line number Diff line change 6
6
members:
7
7
- IterableNamedArrayDataset
8
8
- NamedArrayDataset
9
- - CylinderDataset
10
- - LorenzDataset
11
- - RosslerDataset
12
9
- CSVDataset
13
- - MatDataset
10
+ - IterableCSVDataset
14
11
- ERA5Dataset
15
12
- ERA5SampledDataset
13
+ - IterableMatDataset
14
+ - MatDataset
15
+ - CylinderDataset
16
+ - LorenzDataset
17
+ - RosslerDataset
18
+ - VtuDataset
16
19
show_root_heading: false
Original file line number Diff line number Diff line change 10
10
- NavierStokes
11
11
- NormalDotVec
12
12
- Poisson
13
+ - Vibration
13
14
show_root_heading: false
14
15
heading_level: 3
Original file line number Diff line number Diff line change 20
20
- TimeXGeometry
21
21
show_root_heading: false
22
22
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
- ``` -->
Original file line number Diff line number Diff line change 4
4
handler: python
5
5
options:
6
6
members:
7
- - ConstLR
8
7
- Linear
9
8
- Cosine
10
9
- Step
Original file line number Diff line number Diff line change 4
4
handler: python
5
5
options:
6
6
members:
7
+ - Metric
7
8
- MAE
8
9
- MSE
9
10
- RMSE
Original file line number Diff line number Diff line change 7
7
- initializer
8
8
- logger
9
9
- misc
10
- - reader
10
+ - load_csv_file
11
+ - load_mat_file
12
+ - load_vtk_file
11
13
- run_check
12
14
- AttrDict
13
15
- ExpressionSolver
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ def concat_to_tensor(
62
62
Returns:
63
63
Tuple[paddle.Tensor, ...]: Concatenated tensor.
64
64
"""
65
+ if len (keys ) == 1 :
66
+ return data_dict [keys [0 ]]
65
67
data = [data_dict [key ] for key in keys ]
66
68
return paddle .concat (data , axis )
67
69
@@ -78,6 +80,8 @@ def split_to_dict(
78
80
Returns:
79
81
Dict[str, paddle.Tensor]: Dict contains tensor.
80
82
"""
83
+ if len (keys ) == 1 :
84
+ return {keys [0 ]: data_tensor }
81
85
data = paddle .split (data_tensor , len (keys ), axis = axis )
82
86
return {key : data [i ] for i , key in enumerate (keys )}
83
87
Original file line number Diff line number Diff line change 22
22
from ppsci .utils .expression import ExpressionSolver
23
23
from ppsci .utils .misc import AverageMeter
24
24
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
25
29
from ppsci .utils .save_load import load_checkpoint
26
30
from ppsci .utils .save_load import load_pretrain
27
31
from ppsci .utils .save_load import save_checkpoint
31
35
"logger" ,
32
36
"misc" ,
33
37
"reader" ,
38
+ "load_csv_file" ,
39
+ "load_mat_file" ,
40
+ "load_vtk_file" ,
41
+ "load_vtk_with_time_file" ,
34
42
"dynamic_import_to_globals" ,
35
43
"run_check" ,
36
44
"AttrDict" ,
Original file line number Diff line number Diff line change 27
27
28
28
from ppsci .utils import logger
29
29
30
+ __all__ = [
31
+ "load_csv_file" ,
32
+ "load_mat_file" ,
33
+ "load_vtk_file" ,
34
+ "load_vtk_with_time_file" ,
35
+ ]
36
+
30
37
31
38
def load_csv_file (
32
39
file_path : str ,
@@ -119,7 +126,7 @@ def load_vtk_file(
119
126
input_keys : Tuple [str , ...],
120
127
label_keys : Optional [Tuple [str , ...]],
121
128
) -> Dict [str , np .ndarray ]:
122
- """load coordinates and attached label from the vtu file
129
+ """load coordinates and attached label from the *. vtu file.
123
130
124
131
Args:
125
132
filename_without_timeid (str): File name without time id.
Original file line number Diff line number Diff line change @@ -291,7 +291,6 @@ class Visualizer3D(base.Visualizer):
291
291
batch_size (int, optional): Batch size of data when computing result in visu.py. Defaults to 64.
292
292
label_dict (Dict[str, np.ndarray]): Label dict.
293
293
time_list (Optional[Tuple[float, ...]]): Time list.
294
- num_timestamps (int, optional): Number of timestamps.
295
294
prefix (str, optional): Prefix for output file.
296
295
"""
297
296
You can’t perform that action at this time.
0 commit comments