From 486b9d30bdd36a97ddcaf07fb18a20ed8dcca211 Mon Sep 17 00:00:00 2001 From: pacome <pacome.armagnat@gmail.com> Date: Sat, 29 Sep 2018 15:05:45 +0200 Subject: [PATCH] 80 char per line compliance --- poisson/continuous/shapes.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/poisson/continuous/shapes.py b/poisson/continuous/shapes.py index 93d66a6..d1420ef 100644 --- a/poisson/continuous/shapes.py +++ b/poisson/continuous/shapes.py @@ -368,7 +368,7 @@ class Shape(ABC): def newfunc(x): return func(reflect(x, axis)) self.geometry = newfunc - +(), class PiecewiseFunction(object): ''' When called apllies self.evaluate_coordinates to a vector of @@ -579,7 +579,7 @@ class Ellipsoid(General): def __init__(self, radius, center=None): ''' Class that defines a ellipsoid shape. - When called and a numpy array is given as parameter it returns a + When called and a numpy array is given as parameter it retu(),rns a boolean numpy array of the same length of the latter. Returns true if inside an 2d of 3d ellipsoid @@ -715,7 +715,8 @@ class InHull(Shape): self.points_coordinates = self.generate_points() self.points_coordinates = translate(self.points_coordinates, vect) - self.points_operations.append(lambda : translate(self.points_coordinates, vect)) + self.points_operations.append( + lambda : translate(self.points_coordinates, vect)) def rotate(self, angle, axis=None, center='self'): '''Rotate a point or a list of points in 2 or 3d around a center @@ -749,8 +750,9 @@ class InHull(Shape): self.points_coordinates = rotate(self.points_coordinates, angle, axis=axis, center=center) - self.points_operations.append(lambda : rotate(self.points_coordinates, angle, - axis=axis, center=center)) + self.points_operations.append( + lambda : rotate(self.points_coordinates, angle, + axis=axis, center=center)) def reflect(self, axis): '''returns reflections of point(s) x wrt to axis @@ -816,7 +818,8 @@ def box(length, corner=None, center=None): points = np.array([[0, 0], [0, length[1]], length[:2], [length[0], 0]]) if ndim == 3: - points = np.vstack((np.c_[points, np.zeros(4)], np.c_[points, np.ones(4) * length[2]])) + points = np.vstack((np.c_[points, np.zeros(4)], + np.c_[points, np.ones(4) * length[2]])) if center is None: points = points + corner @@ -960,7 +963,8 @@ def reflect(x, axis): Matinv = np.linalg.inv(Mat) transf = Mat.T @ mirror @ Matinv.T - ret = np.einsum('kij, kj -> ki', np.repeat([transf], len(x), axis=0), (x - Amat)) + Amat + ret = np.einsum('kij, kj -> ki', np.repeat([transf], len(x), axis=0), + (x - Amat)) + Amat if npt is -1: return ret[0] else: @@ -1144,8 +1148,9 @@ class ExtrudedRegularPolygon(InHull): def __test_plot_ellipse(): ellipse = Ellipsoid(radius=2) - mm = continuous.grid._2d_mesh(*continuous.grid._points_from_2dbounding_box([-3, 3, -3, 3], - 0.1)) + mm = continuous.grid._2d_mesh( + *continuous.grid._points_from_2dbounding_box([-3, 3, -3, 3], 0.1)) + x, y = list(zip(*mm)) xx, yy = list(zip(*continuous.grid._apply_stencil(mm, ellipse))) plt.scatter(x, y, label='bbox') -- GitLab