Skip to content

Commit bac040b

Browse files
Merge pull request #339 from HydrogenSulfate/fix_mesh_normal
Fix mesh normal
2 parents d1033d5 + f624fcc commit bac040b

File tree

12 files changed

+248
-180
lines changed

12 files changed

+248
-180
lines changed

docs/requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
numpy
2-
scipy
32
sympy
43
matplotlib
5-
vtk
64
scipy
75
pyyaml
86
Jinja2==3.0.3

docs/zh/install_setup.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828

2929
???+ Info "安装注意事项"
3030

31-
如需使用外部导入STL文件来构建几何,以及使用加密采样等功能,还需额外安装 [pymesh](https://pymesh.readthedocs.io/en/latest/installation.html#download-the-source)(推荐编译安装) 和 [open3d](https://github.com/isl-org/Open3D/tree/master#python-quick-start)(推荐pip安装)
31+
如需使用外部导入STL文件来构建几何,以及使用加密采样等功能,还需额外安装三个依赖库:
32+
[pymesh](https://pymesh.readthedocs.io/en/latest/installation.html#download-the-source)(推荐编译安装),
33+
[open3d](https://github.com/isl-org/Open3D/tree/master#python-quick-start)(推荐pip安装),
34+
[pysdf](https://github.com/sxyu/sdf)(推荐pip安装)
3235

3336
#### 1.2.2 pip 安装
3437

ppsci/autodiff/ad.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ def __call__(
8585
8686
Examples:
8787
>>> import ppsci
88-
>>> x = paddle.randn([4, 3])
88+
>>> x = paddle.randn([4, 1])
8989
>>> x.stop_gradient = False
90-
>>> y = (x * x).sum()
91-
>>> dy_dx = ppsci.autodiff.jacoian(y, x) # doctest: +SKIP
90+
>>> y = x * x
91+
>>> dy_dx = ppsci.autodiff.jacobian(y, x)
9292
"""
9393
key = (ys, xs)
9494
if key not in self.Js:
@@ -187,7 +187,7 @@ def __call__(
187187
>>> x = paddle.randn([4, 3])
188188
>>> x.stop_gradient = False
189189
>>> y = (x * x).sin()
190-
>>> dy_dxx = ppsci.autodiff.hessian(y, x, component=0) # doctest: +SKIP
190+
>>> dy_dxx = ppsci.autodiff.hessian(y, x, component=0)
191191
"""
192192
key = (ys, xs, component)
193193
if key not in self.Hs:

ppsci/constraint/boundary_constraint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class BoundaryConstraint(base.Constraint):
4747
Defaults to None.
4848
evenly (bool, optional): Whether to use evenly distribution sampling.
4949
Defaults to False.
50-
weight_dict (Optional[Dict[str, Callable]]): Define the weight of each
50+
weight_dict (Optional[Dict[str, Union[float, Callable]]]): Define the weight of each
5151
constraint variable. Defaults to None.
5252
name (str, optional): Name of constraint object. Defaults to "BC".
5353
@@ -78,7 +78,7 @@ def __init__(
7878
random: Literal["pseudo", "LHS"] = "pseudo",
7979
criteria: Optional[Callable] = None,
8080
evenly: bool = False,
81-
weight_dict: Optional[Dict[str, Callable]] = None,
81+
weight_dict: Optional[Dict[str, Union[float, Callable]]] = None,
8282
name: str = "BC",
8383
):
8484
self.output_expr = output_expr

ppsci/data/dataset/array_dataset.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ def __init__(
4949
super().__init__()
5050
self.input = input
5151
self.label = label
52+
self.input_keys = tuple(input.keys())
53+
self.label_keys = tuple(label.keys())
5254
self.weight = weight
5355
self.transforms = transforms
5456
self._len = len(next(iter(input.values())))

ppsci/data/dataset/csv_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def __init__(
178178
label_keys: Tuple[str, ...],
179179
alias_dict: Optional[Dict[str, str]] = None,
180180
weight_dict: Optional[Dict[str, Union[Callable, float]]] = None,
181-
timestamps: Optional[Tuple[Union[int, float], ...]] = None,
181+
timestamps: Optional[Tuple[float, ...]] = None,
182182
transforms: Optional[vision.Compose] = None,
183183
):
184184
super().__init__()

ppsci/data/dataset/mat_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def __init__(
178178
label_keys: Tuple[str, ...] = (),
179179
alias_dict: Optional[Dict[str, str]] = None,
180180
weight_dict: Optional[Dict[str, Union[Callable, float]]] = None,
181-
timestamps: Optional[Tuple[Union[int, float], ...]] = None,
181+
timestamps: Optional[Tuple[float, ...]] = None,
182182
transforms: Optional[vision.Compose] = None,
183183
):
184184
super().__init__()

ppsci/data/process/transform/preprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Translate:
3131
>>> translate = ppsci.data.transform.Translate({"x": 1.0, "y": -1.0})
3232
"""
3333

34-
def __init__(self, offset: Dict[str, Union[int, float]]):
34+
def __init__(self, offset: Dict[str, float]):
3535
self.offset = offset
3636

3737
def __call__(self, data_dict):
@@ -53,7 +53,7 @@ class Scale:
5353
>>> translate = ppsci.data.transform.Scale({"x": 1.5, "y": 2.0})
5454
"""
5555

56-
def __init__(self, scale: Dict[str, Union[int, float]]):
56+
def __init__(self, scale: Dict[str, float]):
5757
self.scale = scale
5858

5959
def __call__(self, data_dict):

0 commit comments

Comments
 (0)