Skip to content

Support alphanumeric sub or ses labels. #575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

JoeZiminski
Copy link
Member

@JoeZiminski JoeZiminski commented Aug 6, 2025

On the NeuroBlueprint side, alphanumeric characters are now allowed for sub- and ses- 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:

  • checking for duplicate sub/ses labels is extended to consider the integer value, rather than string comparison. For example "sub-001" and "sub-01" are considered equal.
  • numeric characters must all be the same length, zero padded if necessary (e.g. sub-01 and sub-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 as sub-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:

  • the new entry to the tui persistent settings
  • validation for alphanumeric keys acts as expected
  • the new checkboxes in the TUI are set correctly and pass through to the underlying datashuttle functions correctly.

@JoeZiminski JoeZiminski force-pushed the allow_alphanumeric_sub_ses_values branch from bb2db57 to 6766271 Compare August 21, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant