Skip to content

Commit 8f70186

Browse files
committed
reverted pygem/
1 parent 6c253e9 commit 8f70186

29 files changed

+1425
-1721
lines changed

pygem/__init__.py

Lines changed: 16 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
"""PyGeM init."""
1+
"""
2+
PyGeM init
3+
"""
4+
__all__ = [
5+
"deformation",
6+
"ffd",
7+
"rbf",
8+
"idw",
9+
"rbf_factory",
10+
"custom_deformation",
11+
"cffd"
12+
"bffd"
13+
"vffd"
14+
]
215

316
from .deformation import Deformation
417
from .ffd import FFD
@@ -7,47 +20,6 @@
720
from .idw import IDW
821
from .rbf_factory import RBFFactory
922
from .custom_deformation import CustomDeformation
23+
from .meta import *
1024
from .bffd import BFFD
11-
from .vffd import VFFD
12-
13-
from .meta import (
14-
__project__,
15-
__title__,
16-
__author__,
17-
__copyright__,
18-
__license__,
19-
__version__,
20-
__mail__,
21-
__maintainer__,
22-
__status__,
23-
)
24-
25-
__all__ = [
26-
"Deformation",
27-
"FFD",
28-
"CFFD",
29-
"RBF",
30-
"IDW",
31-
"RBFFactory",
32-
"CustomDeformation",
33-
"BFFD",
34-
"VFFD",
35-
"deformation",
36-
"ffd",
37-
"rbf",
38-
"idw",
39-
"rbf_factory",
40-
"custom_deformation",
41-
"cffd",
42-
"bffd",
43-
"vffd",
44-
"__project__",
45-
"__title__",
46-
"__author__",
47-
"__copyright__",
48-
"__license__",
49-
"__version__",
50-
"__mail__",
51-
"__maintainer__",
52-
"__status__",
53-
]
25+
from .vffd import VFFD

pygem/bffd.py

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
import numpy as np
2-
31
from pygem.cffd import CFFD
4-
5-
2+
import numpy as np
63
class BFFD(CFFD):
7-
"""Class that handles the Barycenter Free Form Deformation on the mesh
8-
points.
9-
4+
'''
5+
Class that handles the Barycenter Free Form Deformation on the mesh points.
6+
107
:param list n_control_points: number of control points in the x, y, and z
118
direction. Default is [2, 2, 2].
12-
9+
1310
:cvar numpy.ndarray box_length: dimension of the FFD bounding box, in the
1411
x, y and z direction (local coordinate system).
1512
:cvar numpy.ndarray box_origin: the x, y and z coordinates of the origin of
@@ -22,15 +19,11 @@ class BFFD(CFFD):
2219
y, normalized with the box length y.
2320
:cvar numpy.ndarray array_mu_z: collects the displacements (weights) along
2421
z, normalized with the box length z.
25-
:cvar callable fun: it defines the F of the constraint F(x)=c.
26-
Default is the constant 1 function.
27-
:cvar numpy.ndarray fixval: it defines the c of the constraint
28-
F(x)=c. Default is 1.
29-
:cvar numpy.ndarray mask: a boolean tensor that tells to the class
30-
which control points can be moved, and in what direction,
31-
to enforce the constraint.
32-
The tensor has shape (n_x,n_y,n_z,3), where the last
33-
dimension indicates movement
22+
:cvar callable fun: it defines the F of the constraint F(x)=c. Default is the constant 1 function.
23+
:cvar numpy.ndarray fixval: it defines the c of the constraint F(x)=c. Default is 1.
24+
:cvar numpy.ndarray mask: a boolean tensor that tells to the class
25+
which control points can be moved, and in what direction, to enforce the constraint.
26+
The tensor has shape (n_x,n_y,n_z,3), where the last dimension indicates movement
3427
on x,y,z respectively. Default is all true.
3528
3629
:Example:
@@ -39,13 +32,11 @@ class BFFD(CFFD):
3932
>>> b = np.random.rand(3)
4033
>>> bffd = BFFD(b, [2, 2, 2])
4134
>>> bffd.read_parameters('tests/test_datasets/parameters_test_cffd')
42-
>>> original_mesh_points =
43-
np.load("tests/test_datasets/test_sphere_cffd.npy")
35+
>>> original_mesh_points = np.load("tests/test_datasets/test_sphere_cffd.npy")
4436
>>> bffd.adjust_control_points(original_mesh_points[:-4])
45-
>>> assert np.isclose(np.linalg.norm(bffd.fun(bffd.ffd(
46-
... original_mesh_points[:-4])) - b), np.array([0.]))
37+
>>> assert np.isclose(np.linalg.norm(bffd.fun(bffd.ffd(original_mesh_points[:-4])) - b), np.array([0.]))
4738
>>> new_mesh_points = bffd.ffd(original_mesh_points)
48-
"""
39+
'''
4940

5041
def __init__(self, fixval=None, n_control_points=None, ffd_mask=None):
5142
super().__init__(fixval, None, n_control_points, ffd_mask, None)
@@ -55,6 +46,7 @@ def linfun(x):
5546

5647
self.fun = linfun
5748
self.fixval = fixval
58-
self.fun_mask = np.array(
59-
[[True, False, False], [False, True, False], [False, False, True]]
60-
)
49+
self.fun_mask = np.array([[True, False, False], [False, True, False],
50+
[False, False, True]])
51+
52+

pygem/cad/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414

1515
from .ffd import FFD
1616
from .rbf import RBF
17-
from .idw import IDW # noqa: F401
18-
from .custom_deformation import CustomDeformation # noqa: F401
19-
from .cad_deformation import CADDeformation # noqa: F401
17+
from .idw import IDW
18+
from .custom_deformation import CustomDeformation
19+
from .cad_deformation import CADDeformation

0 commit comments

Comments
 (0)