Skip to content

Commit 828f150

Browse files
committed
update black
1 parent f934a25 commit 828f150

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repos:
55
- id: isort
66

77
- repo: https://github.com/psf/black
8-
rev: 21.8b0
8+
rev: 22.1.0
99
hooks:
1010
- id: black
1111
language_version: python3

src/dmsh/geometry/ellipse.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ def _boundary_step(self, x):
2424
ax = (x[0] - self.x0[0]) / self.a
2525
ay = (x[1] - self.x0[1]) / self.b
2626

27-
alpha = ax ** 2 + ay ** 2 - 1.0
27+
alpha = ax**2 + ay**2 - 1.0
2828
jac = np.array([4 * alpha * ax / self.a, 4 * alpha * ay / self.b])
2929

3030
dalpha_dx = 2 * ax / self.a
3131
dalpha_dy = 2 * ay / self.b
3232
hess = np.array(
3333
[
3434
[
35-
4 * dalpha_dx * ax / self.a + 4 * alpha / self.a ** 2,
35+
4 * dalpha_dx * ax / self.a + 4 * alpha / self.a**2,
3636
4 * dalpha_dy * ax / self.a,
3737
],
3838
[
3939
4 * dalpha_dx * ay / self.b,
40-
4 * dalpha_dy * ay / self.b + 4 * alpha / self.b ** 2,
40+
4 * dalpha_dy * ay / self.b + 4 * alpha / self.b**2,
4141
],
4242
]
4343
)

src/dmsh/geometry/halfspace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def p(self, t):
1919

2020
def dp_dt(self, t):
2121
with np.errstate(divide="ignore"):
22-
dt = 1 / t ** 2 + 1 / (1 - t) ** 2
22+
dt = 1 / t**2 + 1 / (1 - t) ** 2
2323
return np.multiply.outer(self.tangent, dt)
2424

2525

src/dmsh/geometry/rectangle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def dist(self, x):
4040
is_inside = (dx <= 0) & (dy <= 0)
4141
dx[dx < 0.0] = 0.0
4242
dy[dy < 0.0] = 0.0
43-
dist = np.sqrt(dx ** 2 + dy ** 2)
43+
dist = np.sqrt(dx**2 + dy**2)
4444
# inside dist
4545
a = np.array(
4646
[

src/dmsh/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def generate(
173173
diff = np.array([[pt - fp for fp in geo.feature_points] for pt in pts])
174174
dist = np.einsum("...k,...k->...", diff, diff)
175175
ftol = h0 / 10
176-
equals_feature_point = np.any(dist < ftol ** 2, axis=1)
176+
equals_feature_point = np.any(dist < ftol**2, axis=1)
177177
pts = pts[~equals_feature_point]
178178
# Add feature points
179179
pts = np.concatenate([geo.feature_points, pts])
@@ -333,7 +333,7 @@ def distmesh_smoothing(
333333
move2 = np.einsum("ij,ij->i", diff, diff)
334334
if verbose:
335335
print(f"max_move: {np.sqrt(np.max(move2)):.6e}")
336-
if np.all(move2 < tol ** 2):
336+
if np.all(move2 < tol**2):
337337
break
338338

339339
# The cell removal steps in _recell_and_boundary_step() might create points which

tests/compare-speed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def _compute_num_boundary_points(total_num_points):
3535
# for the number of boundary points.
3636
sqrt3_pi = np.sqrt(3) * np.pi
3737
num_boundary_points = -sqrt3_pi / 2 + np.sqrt(
38-
3 / 4 * np.pi ** 2 - (2 - 2 * total_num_points) * sqrt3_pi
38+
3 / 4 * np.pi**2 - (2 - 2 * total_num_points) * sqrt3_pi
3939
)
4040
return num_boundary_points
4141

tests/test_speed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def _pypathlib_contains_points(pts):
2323
perfplot.show(
2424
setup=lambda n: np.random.rand(n, 2),
2525
kernels=[_mpl_path, _pypathlib_contains_points],
26-
n_range=[2 ** k for k in range(n)],
26+
n_range=[2**k for k in range(n)],
2727
labels=["matplotlib.path.contains_points", "pypathlib.contains_points"],
2828
logx=True,
2929
logy=True,

0 commit comments

Comments
 (0)