Skip to content

Commit 229edfa

Browse files
committed
Fix formatting
1 parent 756bb4a commit 229edfa

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/expipe_plugin_cinpla/scripts/unittracking.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88

99
from expipe_plugin_cinpla.scripts.utils import _get_data_path
1010
from expipe_plugin_cinpla.tools.data_loader import load_spiketrains
11-
12-
from expipe_plugin_cinpla.tools.track_units_tools import order_waveforms_by_electrode_names
11+
from expipe_plugin_cinpla.tools.track_units_tools import (
12+
order_waveforms_by_electrode_names,
13+
)
1314

1415
warnings.filterwarnings("ignore")
1516

src/expipe_plugin_cinpla/tools/track_units_tools.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def order_waveforms_by_electrode_names(templates, names):
1818

1919
uq_names = set().union(*[set(name) for name in names]).difference({-1})
2020

21-
assert len(uq_names) <= templates[0].shape[1] # number of names can be max number of electrodes
21+
assert len(uq_names) <= templates[0].shape[1] # number of names can be max number of electrodes
2222

2323
# order of the waveforms
2424
order = sorted(uq_names)
@@ -34,16 +34,15 @@ def order_waveforms_by_electrode_names(templates, names):
3434
if num_dead > 0:
3535
dead_index = dead_channels[0].item()
3636

37-
3837
order_indices = [np.nonzero(name == order_name)[0] for order_name in order]
3938
order_indices = [ind.item() if ind.size == 1 else dead_index for ind in order_indices]
4039

4140
# in case some channel is missing from all trials
4241
if len(order_indices) < num_electrodes:
43-
order_indices.extend([dead_index]*(num_electrodes - len(order_indices)))
42+
order_indices.extend([dead_index] * (num_electrodes - len(order_indices)))
4443

4544
action_orders.append(order_indices)
46-
new_templates.append(template[:,order_indices])
45+
new_templates.append(template[:, order_indices])
4746

4847
return new_templates, action_orders
4948

src/expipe_plugin_cinpla/tools/trackunitcomparison.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
make_best_match,
1616
make_hungarian_match,
1717
make_possible_match,
18-
order_waveforms_by_electrode_names
18+
order_waveforms_by_electrode_names,
1919
)
2020

2121

@@ -67,15 +67,15 @@ def __init__(
6767

6868
self.unit_ids[channel_group] = [
6969
[int(u.annotations["name"]) for u in us_0],
70-
[int(u.annotations["name"]) for u in us_1]
70+
[int(u.annotations["name"]) for u in us_1],
7171
]
7272
self.templates[channel_group] = [
7373
[u.annotations["waveform_mean"] for u in us_0],
74-
[u.annotations["waveform_mean"] for u in us_1]
74+
[u.annotations["waveform_mean"] for u in us_1],
7575
]
7676
self.electrode_names[channel_group] = [
7777
[u.annotations["electrode_names"] for u in us_0],
78-
[u.annotations["electrode_names"] for u in us_1]
78+
[u.annotations["electrode_names"] for u in us_1],
7979
]
8080

8181
if len(us_0) > 0 and len(us_1) > 0:

0 commit comments

Comments
 (0)