Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/VervaekeLab/NANSEN
Browse files Browse the repository at this point in the history
  • Loading branch information
Eivind Hennestad committed Jun 9, 2022
2 parents d45be85 + a3f7d23 commit aee5906
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions code/+nansen/+dataio/+session/listSessionFolders.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

allDataLocationNames = {dataLocationModel.Data.Name};

% Get indicies for datalocation items to list session folders from
if ischar(dataLocationName) && strcmp(dataLocationName, 'all')
ind = 1:numel(dataLocationModel.Data);
elseif ischar(dataLocationName) || iscell(dataLocationName)
Expand Down
3 changes: 3 additions & 0 deletions code/+nansen/+manage/detectNewSessions.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
% Todo: This should not be necessary, just make sure from the get-go
% that all datalocations structs are "extended"
dataLocationOriginal = metaTable.entries{1, 'DataLocation'};
if iscell(dataLocationOriginal)
dataLocationOriginal = dataLocationOriginal{1};
end
fieldsOriginal = fieldnames(dataLocationOriginal);
dataLocationNew = sessionArray(1).DataLocation;
fieldNamesNew = fieldnames(dataLocationNew);
Expand Down
6 changes: 3 additions & 3 deletions code/+nansen/+metadata/+type/Session.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function constructFromDataLocationStruct(obj, dataLocationStruct)
%constructFromDataLocationStruct Construct object(s)

% Todo: Support vector of objects.
% Todo: Should I accept old and new dataLocation structure?
% Todo: Should I accept old and new dataLocation structure? NO

obj.DataLocation = dataLocationStruct;
obj.autoAssignPropertiesOnConstruction()
Expand Down Expand Up @@ -339,8 +339,8 @@ function fixDataLocations(obj)
rootPaths = {dataLocation.RootPath.Value};

for k = 1:numel(rootPaths)
tf = contains( obj(j).DataLocation.(name), rootPaths{k} );
if ~isempty(tf)
isMatched = contains( obj(j).DataLocation.(name), rootPaths{k} );
if isMatched
root = rootPaths{k};
rootIdx = k;
break
Expand Down

0 comments on commit aee5906

Please sign in to comment.