Skip to content

Commit 2ac55de

Browse files
committed
add alignment resolved date to keep track of manual resolution
1 parent 297c736 commit 2ac55de

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

ibllib/qc/alignment_qc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import numpy as np
44
from pathlib import Path
5+
from datetime import date
56

67
from neuropixel import trace_header
78
import spikeglx
@@ -166,7 +167,7 @@ def run(self, update=True, upload_alyx=True, upload_flatiron=True):
166167

167168
return results
168169

169-
def resolve_manual(self, align_key, update=True, upload_alyx=True, upload_flatiron=True,
170+
def resolve_manual(self, align_key, update=True, upload_alyx=True, upload_flatiron=False,
170171
force=False):
171172
"""
172173
Method to manually resolve the alignment of a probe insertion with a given alignment
@@ -193,6 +194,7 @@ def resolve_manual(self, align_key, update=True, upload_alyx=True, upload_flatir
193194
results['alignment_resolved'] = True
194195
results['alignment_stored'] = align_key
195196
results['alignment_resolved_by'] = 'experimenter'
197+
results['alignment_resolved_date'] = date.today().isoformat()
196198

197199
if update:
198200
self.update_extended_qc(results)

ibllib/tests/qc/test_alignment_qc.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import copy
88
import random
99
import string
10+
from datetime import date
1011

1112
from one.api import ONE
1213
from neuropixel import trace_header
@@ -322,7 +323,8 @@ def _02_manual_resolution_latest(self):
322323
alignment_stored='2020-09-28T15:57:25_mayo',
323324
alignment_count=3,
324325
trajectory_created=False,
325-
alignment_qc=0.604081)
326+
alignment_qc=0.604081,
327+
alignment_date=date.today().isoformat())
326328

327329
def _03_manual_resolution_not_latest(self):
328330
align_qc = AlignmentQC(self.probe_id, one=one, brain_atlas=brain_atlas, channels=False)
@@ -338,7 +340,8 @@ def _03_manual_resolution_not_latest(self):
338340
alignment_stored='2020-09-28T10:03:06_alejandro',
339341
alignment_count=3,
340342
trajectory_created=True,
341-
alignment_qc=0.604081)
343+
alignment_qc=0.604081,
344+
alignment_date=date.today().isoformat())
342345

343346
@classmethod
344347
def tearDownClass(cls) -> None:
@@ -347,7 +350,7 @@ def tearDownClass(cls) -> None:
347350

348351

349352
def _verify(tc, alignment_resolved=None, alignment_count=None,
350-
alignment_stored=None, trajectory_created=False, alignment_qc=None):
353+
alignment_stored=None, trajectory_created=False, alignment_qc=None, alignment_date=None):
351354
"""
352355
For a given test case with a `probe_id` attribute, check that Alyx returns insertion records
353356
that match the provided parameters.
@@ -382,6 +385,8 @@ def _verify(tc, alignment_resolved=None, alignment_count=None,
382385
f'&probe_id={tc.probe_id}'
383386
'&provenance=Ephys aligned histology track', clobber=True)
384387
tc.assertNotEqual(tc.prev_traj_id == traj[0]['id'], trajectory_created)
388+
if alignment_date:
389+
tc.assertEqual(insertion['json']['extended_qc']['alignment_resolved_date'], alignment_date)
385390

386391

387392
class TestUploadToFlatIron(unittest.TestCase):

0 commit comments

Comments
 (0)