Commit 486b9d30 authored by pacome's avatar pacome
Browse files

80 char per line compliance

parent 8ef830a3
......@@ -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')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment