Skip to content

Commit 76a163b

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent e10c1be commit 76a163b

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

src/spikeinterface/widgets/drift_templates.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
from .unit_templates import UnitTemplatesWidget
1010
from ..core import Templates
1111

12+
1213
class DriftingTemplatesWidget(BaseWidget):
1314
"""
1415
Plot a drifting templates object to explore motion
1516
1617
Parameters
1718
----------
18-
drifting_templates :
19+
drifting_templates :
1920
A drifting templates object
2021
scale : float, default: 1
2122
Scale factor for the waveforms/templates (matplotlib backend)
@@ -45,7 +46,7 @@ def plot_ipywidgets(self, data_plot, **backend_kwargs):
4546
check_ipywidget_backend()
4647

4748
# self.next_data_plot = data_plot.copy()
48-
self.drifting_templates = data_plot['drifting_templates']
49+
self.drifting_templates = data_plot["drifting_templates"]
4950

5051
cm = 1 / 2.54
5152

@@ -68,9 +69,9 @@ def plot_ipywidgets(self, data_plot, **backend_kwargs):
6869

6970
self.slider = widgets.IntSlider(
7071
orientation="horizontal",
71-
value=arr.shape[0]//2,
72+
value=arr.shape[0] // 2,
7273
min=0,
73-
max=arr.shape[0]-1,
74+
max=arr.shape[0] - 1,
7475
readout=False,
7576
continuous_update=True,
7677
layout=widgets.Layout(width=f"100%"),
@@ -91,13 +92,13 @@ def plot_ipywidgets(self, data_plot, **backend_kwargs):
9192
if backend_kwargs["display"]:
9293
display(self.widget)
9394

94-
def _change_unit(self, change=None):
95+
def _change_unit(self, change=None):
9596
self._update_ipywidget(keep_lims=False)
9697

97-
def _change_displacement(self, change=None):
98+
def _change_displacement(self, change=None):
9899
self._update_ipywidget(keep_lims=True)
99100

100-
def _update_ipywidget(self,keep_lims=False):
101+
def _update_ipywidget(self, keep_lims=False):
101102
if keep_lims:
102103
xlim = self.ax.get_xlim()
103104
ylim = self.ax.get_ylim()
@@ -119,10 +120,9 @@ def _update_ipywidget(self,keep_lims=False):
119120
probe=self.drifting_templates.probe,
120121
)
121122

122-
UnitTemplatesWidget(templates, unit_ids=unit_ids, scale=5,
123-
plot_legend=False,
124-
backend="matplotlib", ax=self.ax, same_axis=True)
125-
123+
UnitTemplatesWidget(
124+
templates, unit_ids=unit_ids, scale=5, plot_legend=False, backend="matplotlib", ax=self.ax, same_axis=True
125+
)
126126

127127
displacement = self.drifting_templates.displacements[displacement_index]
128128
self.ax.set_title(f"{displacement_index}:{displacement} - untis:{unit_ids}")
@@ -134,4 +134,3 @@ def _update_ipywidget(self,keep_lims=False):
134134
fig = self.ax.get_figure()
135135
fig.canvas.draw()
136136
fig.canvas.flush_events()
137-

src/spikeinterface/widgets/unit_waveforms.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ def plot_matplotlib(self, data_plot, **backend_kwargs):
310310
ax.plot([xscale_bar[0], xscale_bar[0]], [min_wfs - offset, min_wfs - offset + length], color="k")
311311
ax.text(x_offset, min_wfs - offset + length // 3, f"{length_uv} $\\mu$V", fontsize=8, rotation=90)
312312

313-
314313
# plot template
315314
if dp.plot_templates:
316315
template = dp.templates[i, :, :][:, chan_inds] * dp.scale * y_scale + y_offset[:, chan_inds]

0 commit comments

Comments
 (0)