Skip to content

Commit c1b043e

Browse files
committed
new black
1 parent 5282cb5 commit c1b043e

File tree

8 files changed

+19
-23
lines changed

8 files changed

+19
-23
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.12b0
8+
rev: 22.1.0
99
hooks:
1010
- id: black
1111
language_version: python3

src/tikzplotlib/_text.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,15 @@ def draw_text(data, obj):
9090
# ‘light’, ‘normal’, ‘regular’, ‘book’, ‘medium’, ‘roman’, ‘semibold’,
9191
# ‘demibold’, ‘demi’, ‘bold’, ‘heavy’, ‘extra bold’, ‘black’
9292
weight = obj.get_weight()
93-
if (
94-
weight
95-
in [
96-
"semibold",
97-
"demibold",
98-
"demi",
99-
"bold",
100-
"heavy",
101-
"extra bold",
102-
"black",
103-
]
104-
or (isinstance(weight, int) and weight > 550)
105-
):
93+
if weight in [
94+
"semibold",
95+
"demibold",
96+
"demi",
97+
"bold",
98+
"heavy",
99+
"extra bold",
100+
"black",
101+
] or (isinstance(weight, int) and weight > 550):
106102
style.append("\\bfseries")
107103

108104
# \lfseries isn't that common yet

tests/test_cleanfigure.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def test_hist(self):
9595
def test_plot3d(self):
9696
theta = np.linspace(-4 * np.pi, 4 * np.pi, 100)
9797
z = np.linspace(-2, 2, 100)
98-
r = z ** 2 + 1
98+
r = z**2 + 1
9999
x = r * np.sin(theta)
100100
y = r * np.cos(theta)
101101

@@ -121,7 +121,7 @@ def test_plot3d(self):
121121
def test_scatter3d(self):
122122
theta = np.linspace(-4 * np.pi, 4 * np.pi, 100)
123123
z = np.linspace(-2, 2, 100)
124-
r = z ** 2 + 1
124+
r = z**2 + 1
125125
x = r * np.sin(theta)
126126
y = r * np.cos(theta)
127127

@@ -169,7 +169,7 @@ def test_surface3D(self):
169169
X = np.arange(-5, 5, 0.25)
170170
Y = np.arange(-5, 5, 0.25)
171171
X, Y = np.meshgrid(X, Y)
172-
R = np.sqrt(X ** 2 + Y ** 2)
172+
R = np.sqrt(X**2 + Y**2)
173173
Z = np.sin(R)
174174

175175
with plt.rc_context(rc=RC_PARAMS):

tests/test_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def plot():
44
import numpy as np
55

66
x, y = np.meshgrid(np.linspace(0, 1), np.linspace(0, 1))
7-
z = x ** 2 - y ** 2
7+
z = x**2 - y**2
88

99
fig = plt.figure()
1010
plt.pcolormesh(x, y, z, cmap=cm.viridis, shading="gouraud")

tests/test_dual_axis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ def plot():
66
fig = plt.figure()
77
ax = fig.add_subplot(111)
88
dat = np.linspace(0, 10, 20)
9-
ax.plot(dat, dat ** 2)
9+
ax.plot(dat, dat**2)
1010
ax2 = ax.twinx()
11-
ax2.plot(20 * dat, 20 * dat ** 2)
11+
ax2.plot(20 * dat, 20 * dat**2)
1212
ax.xaxis.tick_top()
1313
return fig
1414

tests/test_loglogplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
def plot():
66
fig = plt.figure()
77
x = np.logspace(0, 6, num=5)
8-
plt.loglog(x, x ** 2, lw=2.1)
8+
plt.loglog(x, x**2, lw=2.1)
99
return fig
1010

1111

tests/test_text_overlay.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def plot():
66
fig = plt.figure()
77

88
xxx = np.linspace(0, 5)
9-
yyy = xxx ** 2
9+
yyy = xxx**2
1010
plt.text(
1111
1,
1212
5,

tests/test_viridis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def plot():
44
import numpy as np
55

66
x, y = np.meshgrid(np.linspace(0, 1), np.linspace(0, 1))
7-
z = x ** 2 - y ** 2
7+
z = x**2 - y**2
88

99
fig = plt.figure()
1010
plt.pcolormesh(x, y, z, cmap=cm.viridis, shading="gouraud")

0 commit comments

Comments
 (0)