Skip to content

Commit

Permalink
Merge branch 'master' into 484-use-nwb-inspector-for-tutorial-files
Browse files Browse the repository at this point in the history
  • Loading branch information
ehennestad committed Nov 6, 2024
2 parents 0c8c551 + 5aa27d9 commit f65da8f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
5 changes: 3 additions & 2 deletions +tests/+unit/PynwbTutorialTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
properties (Constant)
% SkippedTutorials - Tutorials from pynwb to skip
SkippedTutorials = {...
'plot_read_basics.py', ... % Downloads file from dandi archive, does not export nwb file
'streaming.py', ... % Requires that HDF5 library is installed with the ROS3 driver enabled which is not a given
'object_id.py', ... % Does not export nwb file
'plot_configurator.py', ... % Does not export nwb file
Expand All @@ -31,7 +32,7 @@
SkippedFiles = {'family_nwb_file_0.nwb'} % requires family driver from h5py

% PythonDependencies - Package dependencies for running pynwb tutorials
PythonDependencies = {'hdmf-zarr', 'dataframe-image', 'matplotlib', 'dandi'}
PythonDependencies = {'hdmf-zarr', 'dataframe-image', 'matplotlib'}
end

properties (Access = private)
Expand Down Expand Up @@ -101,7 +102,7 @@ function testTutorial(testCase, tutorialFile)

pythonPath = tests.util.getPythonPath();

cmd = sprintf('"%s" %s', pythonPath, tutorialFile );
cmd = sprintf('%s %s', pythonPath, tutorialFile);
[status, cmdout] = system(cmd);

if status == 1
Expand Down
14 changes: 13 additions & 1 deletion +types/+untyped/@DataStub/load_mat_style.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@
end

points = cell(length(dataDimensions), 1);

if isscalar(dataDimensions)
% Starting in MATLAB R2024b, the input argument for the size
% of an array in ind2sub must be a vector of positive integers
% with two or more elements. This fix replicates the behavior of
% older MATLAB versions, where it was assumed that the a scalar
% size referred to the row dimension. For scalar dimensions
% (i.e., row or column vectors), we can still assume this
% to be true in matnwb.
dataDimensions = [dataDimensions, 1];
end

[points{:}] = ind2sub(dataDimensions, orderedSelection);
readSpaceId = H5S.copy(spaceId);
H5S.select_none(readSpaceId);
Expand Down Expand Up @@ -187,4 +199,4 @@
indexKeyIndex(indexKeyIndexNextIndex) = indexKeyIndex(indexKeyIndexNextIndex) + 1;
indexKeyIndex((indexKeyIndexNextIndex+1):end) = 1;
end
end
end

0 comments on commit f65da8f

Please sign in to comment.