Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PROJECT_EXTRACTION_VERSION and TASK_VERSION to session JSON #906

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading