datalad / datalad-xnat

Track XNAT projects with DataLad
Other
3 stars 9 forks source link

How to deal with invalid project/subject identifiers #115

Open bpoldrack opened 2 years ago

bpoldrack commented 2 years ago

Observation from writing tests for _XNAT:

urllib3.connectionpool: DEBUG: https://central.xnat.org:443 "GET /data/experiments?format=json&project=Sample_DICOM&subject_ID=IDONOTEXIST_used_in_datalad-xnat_CI HTTP/1.1" 200 None

This 200 response results in simply an empty list being returned by _XNAT.get_experiments(_ids) when called with non-existent project and/or subject identifiers.

Leave it at that or should we try to detect this by matching against available project/subject combination as indicated by get_projects/get_subjects? WDYT, @mih , @loj ?

mih commented 2 years ago

This is the way the query is supposed to work. That being said, IF we have a project set, or IF we have a subject set, we could specifically re-query for them, in case we received no results.

Otherwise getting no response could very well be, given that any other constraint might also impact this. And maybe the data simply hasn't arrived yet.

Maybe the only practical approach would be to issue a single notneeded result at the very end, in case absolutely nothing happened.