Use regex in `_convert_subject_to_rid()`
Closed this issue · 0 comments
NicolasGensollen commented
The small function _convert_subject_to_rid()
is not as robust as we'd hope since it implicitly assumes a string in the format "XXX_S_XXXX" and should return the last 4 digits:
Returning the slice [-4:]
works as long as the input string is correctly formatted but could return crazy results if badly formatted. Currently, there is no guarantee that this will be the case as the subject input string comes from the subjects
list, which is simply extracted from a CSV file:
Using a regex like mentioned in the TODO could improve the function robustness a bit.