Skip to content

Commit 9a4a7df

Browse files
committed
Blacken
1 parent e69f9c2 commit 9a4a7df

File tree

3 files changed

+31
-21
lines changed

3 files changed

+31
-21
lines changed

data_prototype/wrappers.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ def __setattr__(self, key, value):
170170
else:
171171
super().__setattr__(key, value)
172172

173+
173174
class LineWrapper(ProxyWrapper):
174175
_wrapped_class = _Line2D
175176
_privtized_methods = ("set_xdata", "set_ydata", "set_data", "get_xdata", "get_ydata", "get_data")
@@ -188,12 +189,21 @@ def draw(self, renderer):
188189
def _update_wrapped(self, data):
189190
self._wrapped_instance.set_data(data["x"], data["y"])
190191

192+
191193
class PathCollectionWrapper(ProxyWrapper):
192194
_wrapped_class = _PathCollection
193195
_privtized_methods = (
194-
"set_facecolors", "set_edgecolors", "set_offsets", "set_sizes", "set_paths",
195-
"get_facecolors", "get_edgecolors", "get_offsets", "get_sizes", "get_paths",
196-
)
196+
"set_facecolors",
197+
"set_edgecolors",
198+
"set_offsets",
199+
"set_sizes",
200+
"set_paths",
201+
"get_facecolors",
202+
"get_edgecolors",
203+
"get_offsets",
204+
"get_sizes",
205+
"get_paths",
206+
)
197207

198208
def __init__(self, data: DataContainer, nus=None, /, **kwargs):
199209
super().__init__(data, nus)
@@ -216,7 +226,6 @@ def _update_wrapped(self, data):
216226
self._wrapped_instance.set_sizes(data["sizes"])
217227

218228

219-
220229
class ImageWrapper(ProxyWrapper):
221230
_wrapped_class = _AxesImage
222231

examples/lissajous.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ def query(
4646
) -> Tuple[Dict[str, Any], Union[str, int]]:
4747
def next_time():
4848
cur_time = time.time()
49-
cur_time = np.array([cur_time, cur_time-.1, cur_time-.2, cur_time-0.3])
49+
cur_time = np.array([cur_time, cur_time - 0.1, cur_time - 0.2, cur_time - 0.3])
5050

51-
phase = 15*np.pi * (self.scale * cur_time % 60) / 150
51+
phase = 15 * np.pi * (self.scale * cur_time % 60) / 150
5252
marker_obj = mmarkers.MarkerStyle("o")
5353
return {
54-
"x": np.cos(5*phase),
55-
"y": np.sin(3*phase),
54+
"x": np.cos(5 * phase),
55+
"y": np.sin(3 * phase),
5656
"phase": phase[0],
5757
"sizes": np.array([256]),
5858
"paths": [marker_obj.get_path().transformed(marker_obj.get_transform())],
@@ -83,13 +83,13 @@ def update(frame, art):
8383
lw = PathCollectionWrapper(sot_c, offset_transform=ax.transData)
8484
ax.add_artist(lw)
8585
ax.add_artist(fc)
86-
#ax.set_xticks([])
87-
#ax.set_yticks([])
86+
# ax.set_xticks([])
87+
# ax.set_yticks([])
8888
ax.set_aspect(1)
8989
ani = FuncAnimation(
9090
fig,
9191
partial(update, art=(lw, fc)),
92-
frames=60*15,
92+
frames=60 * 15,
9393
interval=1000 / 100,
9494
# TODO: blitting does not work because wrappers do not inherent from Artist
9595
# blit=True,

examples/simple_scatter.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,24 @@
2525
def update(frame, art):
2626
return art
2727

28+
2829
marker_obj = mmarkers.MarkerStyle("o")
2930

3031
cont = ArrayContainer(
31-
x = np.array([0,1,2]),
32-
y = np.array([1,4,2]),
33-
paths = np.array([marker_obj.get_path()]),
34-
sizes = np.array([12]),
35-
edgecolors = np.array(["k"]),
36-
facecolors = np.array(["C3"]),
32+
x=np.array([0, 1, 2]),
33+
y=np.array([1, 4, 2]),
34+
paths=np.array([marker_obj.get_path()]),
35+
sizes=np.array([12]),
36+
edgecolors=np.array(["k"]),
37+
facecolors=np.array(["C3"]),
3738
)
3839

3940
fig, ax = plt.subplots()
40-
ax.set_xlim(-.5, 2.5)
41+
ax.set_xlim(-0.5, 2.5)
4142
ax.set_ylim(0, 5)
4243
lw = PathCollectionWrapper(cont, offset_transform=ax.transData)
4344
ax.add_artist(lw)
44-
#ax.set_xticks([])
45-
#ax.set_yticks([])
46-
#ax.set_aspect(1)
45+
# ax.set_xticks([])
46+
# ax.set_yticks([])
47+
# ax.set_aspect(1)
4748
plt.show()

0 commit comments

Comments
 (0)