ibllib.qc.critical_reasons

Prompt experimenter for reason for marking session/insertion as CRITICAL Choices are listed in the global variables. Multiple reasons can be selected. Places info in Alyx session note in a format that is machine retrievable (text->json)

Functions

main

Main function to call to input a reason for marking a session/insertion as CRITICAL programmatically.

main_gui

Main function to call to input a reason for marking an insertion as CRITICAL from the alignment GUI.

main_gui(eid, reasons_selected, one=None)[source]

Main function to call to input a reason for marking an insertion as CRITICAL from the alignment GUI. It will: - create note text, after deleting any similar notes existing already

Param

eid: insertion id

Param

reasons_selected: list of str, str are picked within REASONS_INS_CRIT_GUI

main(eid, one=None)[source]

Main function to call to input a reason for marking a session/insertion as CRITICAL programmatically. It will: - ask reasons for selection of critical status - check if ‘other’ reason has been selected, inquire why (free text) - create note text, checking whether similar notes exist already - upload note to Alyx if none exist previously or if overwrite is chosen Q&A are prompted via the Python terminal.

Example: # Retrieve Alyx note to test one = ONE(base_url=’https://dev.alyx.internationalbrainlab.org’) eid = ‘2ffd3ed5-477e-4153-9af7-7fdad3c6946b’ main(eid=eid, one=one)

# Get notes with pattern notes = one.alyx.rest(‘notes’, ‘list’,

django=f’text__icontains,{STR_NOTES_STATIC},’

f’object_id,{eid}’)

test_json_read = json.loads(notes[0][‘text’])

Parameters
  • eid – session/insertion eid

  • one – default: None -> ONE()

Returns