|
10 | 10 | from one.registration import RegistrationClient, get_dataset_type |
11 | 11 | from one.remote.globus import get_local_endpoint_id, get_lab_from_endpoint_id |
12 | 12 | from one.webclient import AlyxClient, no_cache |
13 | | -from one.converters import ConversionMixin |
| 13 | +from one.converters import ConversionMixin, datasets2records |
14 | 14 | import one.alf.exceptions as alferr |
15 | 15 | from one.api import ONE |
16 | | -try: |
17 | | - from one.util import datasets2records |
18 | | -except ImportError: |
19 | | - from one.converters import datasets2records |
20 | 16 | from iblutil.util import ensure_list |
21 | 17 |
|
22 | 18 | import ibllib |
@@ -249,13 +245,13 @@ def register_session(self, ses_path, file_list=True, projects=None, procedures=N |
249 | 245 | missing = [k for k in required if not session_details[k]] |
250 | 246 | assert not any(missing), 'missing session information: ' + ', '.join(missing) |
251 | 247 | task_protocols = task_data = settings = [] |
252 | | - json_field = end_time = None |
| 248 | + json_field = start_time = end_time = None |
253 | 249 | users = session_details['users'] |
254 | 250 | n_trials = n_correct_trials = 0 |
255 | 251 | else: # Get session info from task data |
256 | | - collections = ensure_list(collections) |
| 252 | + collections = sorted(ensure_list(collections)) |
257 | 253 | # read meta data from the rig for the session from the task settings file |
258 | | - task_data = (raw.load_bpod(ses_path, collection) for collection in sorted(collections)) |
| 254 | + task_data = (raw.load_bpod(ses_path, collection) for collection in collections) |
259 | 255 | # Filter collections where settings file was not found |
260 | 256 | if not (task_data := list(zip(*filter(lambda x: x[0] is not None, task_data)))): |
261 | 257 | raise ValueError(f'_iblrig_taskSettings.raw.json not found in {ses_path} Abort.') |
@@ -342,6 +338,8 @@ def register_session(self, ses_path, file_list=True, projects=None, procedures=N |
342 | 338 | data['task_protocol'] = '/'.join(task_protocols) |
343 | 339 | if end_time: |
344 | 340 | data['end_time'] = self.ensure_ISO8601(end_time) |
| 341 | + if start_time: |
| 342 | + data['start_time'] = self.ensure_ISO8601(start_time) |
345 | 343 |
|
346 | 344 | session = self.one.alyx.rest('sessions', 'partial_update', id=session_id[0], data=data) |
347 | 345 | if json_field: |
|
0 commit comments