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

Use NWBInspector when testing livescript tutorials #618

Open
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

ehennestad
Copy link
Collaborator

@ehennestad ehennestad commented Nov 5, 2024

Fix #484

Motivation

More robust testing of NWB files created by tutorials

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 note about why dimension of SpatialSeries data is transposed wrt the type specification
- Fix typos
- Add explanation of why arrays are transposed relative to the type documentation
- Fix dimension order of AbstractFeatureSeries
Comment on lines +136 to +144
position_data = [linspace(0, 10, 50); linspace(0, 8, 50)]; % 2 x nT array
%%
% In <https://neurodatawithoutborders.github.io/matnwb/doc/+types/+core/SpatialSeries.html
% |SpatialSeries|> data, the first dimension is always time (in seconds), the
% second dimension represents the x, y position. <https://neurodatawithoutborders.github.io/matnwb/doc/+types/+core/SpatialSeries.html
% second dimension represents the x, y position. However, as described in the
% <https://neurodatawithoutborders.github.io/matnwb/tutorials/html/dimensionMapNoDataPipes.html
% dimensionMapNoDataPipes> tutorial, when a MATLAB array is exported to HDF5,
% the array is transposed. Therefore, in order to correctly export the data, in
% MATLAB the last dimension of an array should be time. <https://neurodatawithoutborders.github.io/matnwb/doc/+types/+core/SpatialSeries.html
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@bendichter Can you confirm that this change to the text makes this section more consistent?

Comment on lines 164 to +173
% Image data can be stored either in the HDF5 file or as an external image file.
% For this tutorial, we will use fake image data with shape of |('RGB', 'y', 'x',
% 'time') = (200, 50, 50, 3)|. As in all <https://neurodatawithoutborders.github.io/matnwb/doc/+types/+core/TimeSeries.html
% For this tutorial, we will use fake image data with shape of |('time', 'x',
% 'y', 'RGB') = (200, 50, 50, 3)|. As in all <https://neurodatawithoutborders.github.io/matnwb/doc/+types/+core/TimeSeries.html
% |*TimeSeries*|>, the first dimension is time. The second and third dimensions
% represent x and y. The fourth dimension represents the RGB value (length of
% 3) for color images.
% 3) for color images. *Please note*: As described in the <https://neurodatawithoutborders.github.io/matnwb/tutorials/html/dimensionMapNoDataPipes.html
% dimensionMapNoDataPipes> tutorial, when a MATLAB array is exported to HDF5,
% the array is transposed. Therefore, in order to correctly export the data, we
% will need to create a transposed array, where the dimensions are in reverse
% order compared to the type specification.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@bendichter Same here

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.84%. Comparing base (d970ef1) to head (8203973).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #618      +/-   ##
==========================================
+ Coverage   90.80%   90.84%   +0.04%     
==========================================
  Files         107      107              
  Lines        4774     4774              
==========================================
+ Hits         4335     4337       +2     
+ Misses        439      437       -2     

☔ 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 November 6, 2024 19:59
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.

[Documentation]: Tutorials following best practices specified by the NWBInspector
1 participant