Skip to content

Commit

Permalink
Add PROJECT_EXTRACTION_VERSION and TASK_VERSION to session JSON (issue
Browse files Browse the repository at this point in the history
  • Loading branch information
k1o0 committed Jan 14, 2025
1 parent 19c5ea5 commit fd7d998
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ibllib/oneibl/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ def register_session(self, ses_path, file_list=True, projects=None, procedures=N
procedures = [procedures] if isinstance(procedures, str) else (procedures or [])
json_fields_names = ['IS_MOCK', 'IBLRIG_VERSION']
json_field = {k: settings[0].get(k) for k in json_fields_names}
for field in ('PROJECT_EXTRACTION_VERSION', 'TASK_VERSION'):
if value := settings[0].get(field):
# Add these fields only if they exist and are not None
json_field[field] = value
# The poo count field is only updated if the field is defined in at least one of the settings
poo_counts = [md.get('POOP_COUNT') for md in settings if md.get('POOP_COUNT') is not None]
if poo_counts:
Expand Down

0 comments on commit fd7d998

Please sign in to comment.