Skip to content
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

Allow tags in name template regexp. #404

Merged
merged 3 commits into from
Jul 1, 2024

Conversation

JoeZiminski
Copy link
Member

@JoeZiminski JoeZiminski commented Jun 29, 2024

This PR improves the way name templates handle tags. Previously, if a tag was used in a name template when it was compared against the formatted subject or session name it would fail e.g.

project.make_folders("rawdata", "sub-001_@DATE@") with the name template sub-\d\d\d_@DATE@ will fail as it will compare sub-001_date-<some_date> to sub-\d\d\d_@DATE@. The solution here is to also pre-format the name templates to their regexp equivalent e.g. sub-\d\d\d_@DATE@ -> sub-\d\d\d_date-\d\d\d\d\d\d\d\d.

This reason this is implemented as it is very useful to use convenience tags in the name template as when autofilling the names in the TUI, if you could click to suggest next subject you would get sub-001_@DATE@ which you can immediately click to create the folder. Previously, youd have to use date-\d\d\d\d\d\d\d\d in the name template and the auto-fill would be sub-001_date-\d\d\d\d\d\d\d\d which you would have to manually replace with @DATE@.

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@JoeZiminski JoeZiminski requested a review from adamltyson June 29, 2024 13:58
@adamltyson adamltyson merged commit d331b2d into main Jul 1, 2024
23 checks passed
@adamltyson adamltyson deleted the allow_tags_in_name_template_regexp branch July 1, 2024 14:37
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.

2 participants