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:
[X] The code has been tested locally
[X] Tests have been added to cover all new functionality
[X] The documentation has been updated to reflect any changes
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 templatesub-\d\d\d_@DATE@
will fail as it will comparesub-001_date-<some_date>
tosub-\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 usedate-\d\d\d\d\d\d\d\d
in the name template and the auto-fill would besub-001_date-\d\d\d\d\d\d\d\d
which you would have to manually replace with@DATE@.
Checklist: