Skip to content

Commit 133b37a

Browse files
committed
report snapshot probe dynamic signatures
1 parent e0d5033 commit 133b37a

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

ibllib/plots/figures.py

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ class SpikeSorting(ReportSnapshotProbe):
2929
:param probe_id: str, UUID of the probe insertion for which to create the plot
3030
:param **kwargs: keyword arguments passed to tasks.Task
3131
"""
32-
signature = {
33-
'input_files': [], # see setUp method for declaration of inputs
34-
'output_files': [] # see setUp method for declaration of inputs
35-
}
3632

3733
def _run(self):
3834
"""runs for initiated PID, streams data, destripe and check bad channels"""
@@ -43,7 +39,7 @@ def get_probe_signature(self):
4339
('spikes.amps.npy', f'alf/{self.pname}', True),
4440
('spikes.depths.npy', f'alf/{self.pname}', True)]
4541
output_signature = [('spike_sorting_raster.png', f'snapshot/{self.pname}', True)]
46-
self.signature = {'input_files': input_signature, 'output_file': output_signature}
42+
self.signature = {'input_files': input_signature, 'output_files': output_signature}
4743

4844

4945
class BadChannelsAp(ReportSnapshotProbe):
@@ -54,24 +50,19 @@ class BadChannelsAp(ReportSnapshotProbe):
5450
:param probe_id: str, UUID of the probe insertion for which to create the plot
5551
:param **kwargs: keyword arguments passed to tasks.Task
5652
"""
57-
signature = {
58-
'input_files': [], # see setUp method for declaration of inputs
59-
'output_files': [] # see setUp method for declaration of inputs
60-
}
61-
62-
@staticmethod
63-
def get_probe_signature(pname=None):
64-
pname = pname if pname is not None else "probe*"
53+
54+
def get_probe_signature(self):
55+
pname = self.pname
6556
input_signature = [('*ap.meta', f'raw_ephys_data/{pname}', True),
66-
('*ap.ch', f'raw_ephys_data/{pname}', False),
67-
('*ap.cbin', f'raw_ephys_data/{pname}', False)]
57+
('*ap.ch', f'raw_ephys_data/{pname}', False)]
58+
# ('*ap.cbin', f'raw_ephys_data/{pname}', False)]
6859
output_signature = [('raw_ephys_bad_channels.png', f'snapshot/{pname}', True),
6960
('raw_ephys_bad_channels_highpass.png', f'snapshot/{pname}', True),
7061
('raw_ephys_bad_channels_highpass.png', f'snapshot/{pname}', True),
7162
('raw_ephys_bad_channels_destripe.png', f'snapshot/{pname}', True),
7263
('raw_ephys_bad_channels_difference.png', f'snapshot/{pname}', True),
7364
]
74-
return {'input_files': input_signature, 'output_files': output_signature}
65+
self.signature = {'input_files': input_signature, 'output_files': output_signature}
7566

7667
def _run(self):
7768
"""runs for initiated PID, streams data, destripe and check bad channels"""

ibllib/plots/snapshot.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,23 @@ def register_images(self, widths=None, function=None):
3636

3737
class ReportSnapshotProbe(ReportSnapshot):
3838

39+
signature = {
40+
'input_files': [], # see setUp method for declaration of inputs
41+
'output_files': [] # see setUp method for declaration of inputs
42+
}
43+
3944
def __init__(self, pid, one=None, **kwargs):
4045
assert one
4146
self.one = one
4247
self.content_type = 'probeinsertion'
4348
self.pid = pid
4449
self.eid, self.pname = self.one.pid2eid(self.pid)
4550
self.session_path = self.one.eid2path(self.eid)
46-
self.signature = self.get_probe_signature()
51+
self.get_probe_signature()
4752
super(ReportSnapshotProbe, self).__init__(self.session_path, object_id=pid, content_type=self.content_type, **kwargs)
4853

4954
@abc.abstractmethod
50-
def get_probe_signature(pname=None):
55+
def get_probe_signature(self):
5156
# method that gets input and output signatures from the probe name. The format is a dictionary as follows:
5257
# return {'input_files': input_signature, 'output_files': output_signature}
5358
pass

0 commit comments

Comments
 (0)