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

Update load_mat_style.m #602

Merged
merged 8 commits into from
Nov 4, 2024
Merged

Conversation

ehennestad
Copy link
Collaborator

@ehennestad ehennestad commented Oct 16, 2024

Fix #601

Motivation

Fix issue which arise when loading 1D vectors in MATLAB R2024b due to changes to the ind2sub function as described here:
https://se.mathworks.com/help/releases/R2024b/matlab/ref/ind2sub.html?searchPort=49569#mw_463053e0-3bc5-40de-88c3-5887f667b5d3

How to test the behavior?

Loading NWB-file with a file-create date should not produce error in MATLAB R2024

Checklist

  • Have you ensured the PR description clearly describes the problem and solutions?
  • Have you checked to ensure that there aren't other open or previously closed Pull Requests for the same change?
  • If this PR fixes an issue, is the first line of the PR description fix #XX where XX is the issue number?

Add plot_read_basics to list of tutorials to skip. This tutorial does not produce NWB files that can be read with matnwb.
Copy link

codecov bot commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.91%. Comparing base (95b5e5e) to head (cbef1ef).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #602   +/-   ##
=======================================
  Coverage   90.90%   90.91%           
=======================================
  Files         107      107           
  Lines        4751     4753    +2     
=======================================
+ Hits         4319     4321    +2     
  Misses        432      432           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ehennestad ehennestad marked this pull request as ready for review October 31, 2024 19:24
Comment on lines +49 to +60

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you are saying, yes this is a simpler solution! Good observation

@ehennestad ehennestad merged commit 5aa27d9 into master Nov 4, 2024
7 checks passed
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.

[Bug]: New matnwb not reading files
2 participants