Skip to content

Commit cdb3b54

Browse files
kshitij-mathsndem0
authored andcommitted
black format
1 parent f720f6a commit cdb3b54

29 files changed

Lines changed: 1199 additions & 851 deletions

pygem/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
"""
22
PyGeM init
33
"""
4+
45
__all__ = [
56
"deformation",
67
"ffd",
78
"rbf",
89
"idw",
910
"rbf_factory",
1011
"custom_deformation",
11-
"cffd"
12-
"bffd"
13-
"vffd"
12+
"cffd" "bffd" "vffd",
1413
]
1514

1615
from .deformation import Deformation
@@ -22,4 +21,4 @@
2221
from .custom_deformation import CustomDeformation
2322
from .meta import *
2423
from .bffd import BFFD
25-
from .vffd import VFFD
24+
from .vffd import VFFD

pygem/bffd.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
from pygem.cffd import CFFD
22
import numpy as np
3+
4+
35
class BFFD(CFFD):
4-
'''
6+
"""
57
Class that handles the Barycenter Free Form Deformation on the mesh points.
6-
8+
79
:param list n_control_points: number of control points in the x, y, and z
810
direction. Default is [2, 2, 2].
9-
11+
1012
:cvar numpy.ndarray box_length: dimension of the FFD bounding box, in the
1113
x, y and z direction (local coordinate system).
1214
:cvar numpy.ndarray box_origin: the x, y and z coordinates of the origin of
@@ -21,8 +23,8 @@ class BFFD(CFFD):
2123
z, normalized with the box length z.
2224
:cvar callable fun: it defines the F of the constraint F(x)=c. Default is the constant 1 function.
2325
: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+
:cvar numpy.ndarray mask: a boolean tensor that tells to the class
27+
which control points can be moved, and in what direction, to enforce the constraint.
2628
The tensor has shape (n_x,n_y,n_z,3), where the last dimension indicates movement
2729
on x,y,z respectively. Default is all true.
2830
@@ -36,7 +38,7 @@ class BFFD(CFFD):
3638
>>> bffd.adjust_control_points(original_mesh_points[:-4])
3739
>>> assert np.isclose(np.linalg.norm(bffd.fun(bffd.ffd(original_mesh_points[:-4])) - b), np.array([0.]))
3840
>>> new_mesh_points = bffd.ffd(original_mesh_points)
39-
'''
41+
"""
4042

4143
def __init__(self, fixval=None, n_control_points=None, ffd_mask=None):
4244
super().__init__(fixval, None, n_control_points, ffd_mask, None)
@@ -46,7 +48,6 @@ def linfun(x):
4648

4749
self.fun = linfun
4850
self.fixval = fixval
49-
self.fun_mask = np.array([[True, False, False], [False, True, False],
50-
[False, False, True]])
51-
52-
51+
self.fun_mask = np.array(
52+
[[True, False, False], [False, True, False], [False, False, True]]
53+
)

pygem/cad/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
try:
66
import OCC
77
except ModuleNotFoundError as e:
8-
print('\nOCC not found, but required to deal with CAD files')
9-
print('Install it using:')
10-
print('\tconda install -c conda-forge pythonocc-core=7.4.0')
11-
print('or visit https://github.com/tpaviot/pythonocc-core for more info\n')
8+
print("\nOCC not found, but required to deal with CAD files")
9+
print("Install it using:")
10+
print("\tconda install -c conda-forge pythonocc-core=7.4.0")
11+
print("or visit https://github.com/tpaviot/pythonocc-core for more info\n")
1212
raise e
1313

1414

0 commit comments

Comments
 (0)