-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
If a project is initialized from a data location where session files/folders have the same name across different different subjects, the default selection of session ids (from folder/file name) will result in non-unique session ids.
In nansen.config.initializeSessionTable this will then cause an error in the following code block:
NANSEN/code/+nansen/+config/initializeSessionTable.m
Lines 73 to 91 in 459353b
| sessionIDs = {sessionArray.sessionID}; | |
| if numel(sessionIDs) ~= numel(unique(sessionIDs)) | |
| [sessionArray, wasAborted] = nansen.manage.uiresolveDuplicateSessions(sessionArray, hFigure); | |
| numSessionPostExclusion = numel(sessionArray); | |
| % Todo: Why are all duplicates excluded? I.e keep first one... | |
| if numSessionPostExclusion == 0 | |
| % Todo: Add more detailed how-to solution | |
| error('NANSEN:InitializeSessionArray:DuplicateSessionIDs', ... | |
| ['%d sessions were excluded because they share duplicate session IDs:\n%s\n' ... | |
| 'Please ensure all session IDs are unique before continuing.'], ... | |
| numel(sessionIDs), strjoin(unique(sessionIDs), ', ')); | |
| end | |
| % Todo: Rerun initialization from here if sessions were resolved | |
| if wasAborted | |
| return | |
| end |
There are two problems here:
- When duplicate session ids are identified, all the sessions are excluded, not just the duplicates
- The procedure for resolving duplicates is poorly documented and not user friendly.
Proposed solution:
When creating a session table, all the detected sessions should get assigned a unique internal identifier, and then it is up to the user (potentially via some provided utilities) to clean up duplicated sessions after creating a project.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels