Skip to content

Commit f1a6b7d

Browse files
committed
Merge branch 'develop'
2 parents 946e9b0 + eb9ed8b commit f1a6b7d

File tree

4 files changed

+44
-26
lines changed

4 files changed

+44
-26
lines changed

dlc/wheel_dlc_viewer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def process_key(self, event):
652652
import argparse
653653

654654
docstring = """
655-
Viewer to see the wheel data along side the video and DLC.
655+
Viewer to see the wheel data along label the video and DLC.
656656
657657
Below is list of key bindings:\n
658658
n plot movements of next trial

tests/test_alignment_qc_gui.py

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import unittest
2+
from pathlib import Path
3+
import re
4+
from inspect import getmembers, isfunction
5+
6+
import numpy as np
7+
28
from oneibl.one import ONE
39
from ibllib.atlas import AllenAtlas
410
from atlaselectrophysiology.load_data import LoadData
511
from ibllib.pipes.ephys_alignment import EphysAlignment
612
from ibllib.pipes.misc import create_alyx_probe_insertions
713
from ibllib.pipes.histology import register_track
8-
from pathlib import Path
9-
import numpy as np
1014

1115

1216
EPHYS_SESSION = 'b1c968ad-4874-468d-b2e4-5ffa9b9964e9'
@@ -49,7 +53,16 @@ def setUp(self) -> None:
4953
if traj:
5054
self.prev_traj_id = traj[0]['id']
5155

52-
def test_01_no_alignment(self):
56+
def test_alignments(self):
57+
checks = getmembers(TestsAlignmentQcGUI,
58+
lambda x: isfunction(x) and re.match(r'^_\d{2}_.*', x.__name__))
59+
# Run each function in order
60+
for name, fn in sorted(checks, key=lambda x: x[0]):
61+
if not name.startswith('_01_'):
62+
self.setUp()
63+
fn(self)
64+
65+
def _01_no_alignment(self):
5366

5467
prev_align = self.ld.get_previous_alignments()
5568
assert (len(prev_align) == 1)
@@ -60,7 +73,7 @@ def test_01_no_alignment(self):
6073
assert (not self.ld.alignments)
6174
assert (self.ld.resolved == 0)
6275

63-
def test_02_one_alignment(self):
76+
def _02_one_alignment(self):
6477
key = '2020-07-26T17:06:58_alejandro'
6578
feature = self.alignments[key][0]
6679
track = self.alignments[key][1]
@@ -86,7 +99,7 @@ def test_02_one_alignment(self):
8699
assert (insertion['json']['qc'] == 'NOT_SET')
87100
assert (self.ld.resolved == 0)
88101

89-
def test_03_same_user(self):
102+
def _03_same_user(self):
90103
key = '2020-08-26T17:06:58_alejandro'
91104
eval_str = 'PASS: Noise and artifact'
92105
feature = self.alignments[key][0]
@@ -116,7 +129,7 @@ def test_03_same_user(self):
116129
assert (insertion['json']['qc'] == 'PASS')
117130
assert (self.ld.resolved == 0)
118131

119-
def test_04_two_alignments(self):
132+
def _04_two_alignments(self):
120133
key = '2020-09-14T15:42:22_guido'
121134
feature = self.alignments[key][0]
122135
track = self.alignments[key][1]
@@ -147,7 +160,7 @@ def test_04_two_alignments(self):
147160
assert (insertion['json']['extended_qc']['alignment_qc'] < 0.8)
148161
assert (self.ld.resolved == 0)
149162

150-
def test_05_three_alignments(self):
163+
def _05_three_alignments(self):
151164

152165
key = '2020-09-14T15:44:56_nate'
153166
eval_str = 'WARNING: Drift'
@@ -181,7 +194,7 @@ def test_05_three_alignments(self):
181194
assert (insertion['json']['extended_qc']['alignment_qc'] > 0.8)
182195
assert(self.ld.resolved == 1)
183196

184-
def test_06_new_user_after_resolved(self):
197+
def _06_new_user_after_resolved(self):
185198
key = '2020-09-16T15:44:56_mayo'
186199
eval_str = 'PASS: Drift'
187200
feature = self.alignments[key][0]
@@ -213,7 +226,7 @@ def test_06_new_user_after_resolved(self):
213226
assert (insertion['json']['extended_qc']['alignment_qc'] > 0.8)
214227
assert (self.ld.resolved == 1)
215228

216-
def test_07_same_user_after_resolved(self):
229+
def _07_same_user_after_resolved(self):
217230
key = '2020-10-14T15:44:56_nate'
218231
eval_str = 'CRITICAL: Brain Damage'
219232
feature = self.alignments[key][0]
@@ -245,7 +258,7 @@ def test_07_same_user_after_resolved(self):
245258
assert (insertion['json']['extended_qc']['alignment_qc'] > 0.8)
246259
assert (self.ld.resolved == 1)
247260

248-
def test_08_starting_alignments(self):
261+
def _08_starting_alignments(self):
249262
key = '2020-10-14T15:44:56_nate'
250263
# Starting from original
251264
self.ld.probe_id = self.probe_id2

viewspikes/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# View Spikes
2+
Electrophysiology display tools for IBL insertions.
3+
4+
## Run instructions
5+
Look at the examples file at the root of the package.
6+
7+
## Install Instructions
8+
9+
Pre-requisites:
10+
- IBL environment installed https://github.com/int-brain-lab/iblenv
11+
- ONE parameters setup to download data
12+
13+
```
14+
conda activate iblenv
15+
pip install easyqc
16+
pip install -U pyqtgraph
17+
```

viewspikes/examples.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
from oneibl.one import ONE
88
from ibllib.ephys import neuropixel
99
from ibllib.dsp import voltage
10-
from ibllib.plots import color_cycle
1110
from brainbox.plot import driftmap
1211

13-
from iblapps.needles2 import run_needles2
14-
from iblapps.viewspikes.data import stream, get_ks2, get_spikes
15-
from iblapps.viewspikes.plots import plot_insertion, show_psd, overlay_spikes
12+
from needles2 import run_needles2
13+
from viewspikes.data import stream, get_ks2, get_spikes
14+
from viewspikes.plots import plot_insertion, show_psd, overlay_spikes
1615

1716
one = ONE()
1817

@@ -49,14 +48,3 @@
4948

5049
# Do the driftmap
5150
driftmap(spikes['times'], spikes['depths'], t_bin=0.1, d_bin=5, ax=axes[1])
52-
53-
54-
# eqc_concat = viewseis(np.r_[butt, destripe, ks2], si=1 / sr.fs, h=hhh, t0=t0, title='concat')
55-
# overlay_spikes(eqc_concat, spikes, clusters, channels)
56-
from easyqc import qt
57-
import datetime
58-
qtapp = qt.create_app()
59-
screenshot = qtapp.primaryScreen().grabWindow(eqc_butt.winId())
60-
61-
fn = datetime.datetime.now().strftime('%Y-%m-%dT%H-%M-%S')
62-
screenshot.save(f'/home/olivier/Pictures/{fn}.png', 'png')

0 commit comments

Comments
 (0)