Support alphanumeric sub or ses labels. #575
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On the NeuroBlueprint side, alphanumeric characters are now allowed for
sub-
andses-
key labels. In datashuttle validation (that occurs when validating a project, or folder creation) the requirement is for labels to be numeric. This also comes with additional checks:sub-01
andsub-002
.The former is not relevant for alphanumeric strings, only a direct comparison between the label string values is performed. Secondly, as per discussion, alphanumeric labels are designed to allow flexibility so there is no hard rule that mandates they must be the same length.
To handle this in datashuttle, the approach here is to introduce a new argument to validation (for project validation, validation from path and
create_folders
) to allow alphanumeric labels. If set, then labels such assub-abc
are allowed, duplicate sub/ses checks are on the string value, and labels must not all be the same length. Essentially this means that the packages behaves in the same way as previous, but now there is an option to add a little more flexibility. Checkboxes have been added to the TUI as required.It is not ideal that allowing alphanumeric characters implicitly relaxes other checks (e.g. that labels no longer need to be the same length). Eventually, the solution will be to have very flexible rule-sets that can be used when validating (e.g. allow alphanumeric, equal label lengths are separate). However, this will add a lot of arguments to validation and create folder function signatures, and its not clear how many rules we will have and how best to represent this in the software. For now, its easier just to allow the one argument for added flexibility for those who require it and formalize this properly down the line.
This PR tests: