feat(preflight): check session completeness for MeRID collections - #146
feat(preflight): check session completeness for MeRID collections#146cbueth wants to merge 1 commit into
Conversation
Detect sessions per participant by grouping on Sid.base_id and warn when a participant is missing one or more expected ET sessions. - Preflight: new _check_session_completeness() warns about incomplete participants. Auto-detects expected session count from data pattern, so it works regardless of whether the config is MultiplEYE or MeRID. - Dataset overview: new _compute_session_completeness() adds Session_completeness stats (expected/total/complete/incomplete) to the dataset overview YAML. - Tests: 2 parametrized tests covering all-present, missing-ET1/ET2, single-session skip, pilot exclusion, 3-session detection, and empty sessions edge case. Closes #142
|
"Add a preflight warning that reports whether participants in multi-session (MeRID) data collections have all expected ET sessions. If this should rather be an error and stop the pipeline from being executed, let me know." - should NOT be an error, e.g. if I am still collecting data and want to evaluate data quality from first session, to potentially troubleshoot before the participant's second session. Also depending on local consent, data protection, ethics laws, rules and guidelines, some labs may be allowed to keep data from only one session, if the second session was never performed b/c of dropout. |
|
Thanks for the comment @ntyresen! Along these lines, I now classified it as a warning aggreeing with your choice. @theDebbister will still review it next week and then we merge. |
There was a problem hiding this comment.
I totally agree with the warning. That is sufficient.
About the general session completeness: What happens if a MultiplEYE session has two sessions? Or in general if a data collection where number of expected sessions is 1 has more than 1 session for a session base id? This is not handled currently if I understand it correctly?
I will reassure and add this as a check. This allows multiple sessions per user, but it should not have the Merid format. I will also add a hint to the warning that mentions the config parameter. |
What
Add a preflight warning that reports whether participants in multi-session (MeRID) data collections have all expected ET sessions. If this should rather be an error and stop the pipeline from being executed, let me know.
In case labs upload only one of the two required MeRID sessions or only one had been recorded. The preflight check now detects this and warns, so labs can be contacted before processing.
How
_check_session_completeness()inpreflight.py: groups sessions bySid.base_id, auto-detects the expected session count from the data pattern, and warns about incomplete participants. Works regardless of whether config says MultiplEYE or MeRID._compute_session_completeness()inmultipleye_data_collection.py: addsSession_completenessstats to the dataset overview YAML._print_warnings()updated to render the new warning.Example output:
Closes #142