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

Pregenerate class files in the repo #556

Merged
merged 12 commits into from
Jan 4, 2024
Merged

Conversation

lawrence-mbf
Copy link
Collaborator

Motivation

Fixes #555

How to test the behavior?

cloning the repo should not require generateCore when accessing classes.

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?

@lawrence-mbf lawrence-mbf self-assigned this Dec 20, 2023
@lawrence-mbf lawrence-mbf marked this pull request as ready for review December 20, 2023 18:06
@bendichter
Copy link
Contributor

Looks great. Let's also adjust the tutorials, since generating the classes is no longer necessary

@lawrence-mbf
Copy link
Collaborator Author

@bendichter I think I got most of them. There's one that is kind of necessary in the "Reading NWB Data in MATLAB" tutorial since that does cover what happens if you read a file that does not have an embedded schema.

Copy link

codecov bot commented Dec 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ec01001) 87.11% compared to head (87ce556) 87.11%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #556   +/-   ##
=======================================
  Coverage   87.11%   87.11%           
=======================================
  Files         104      104           
  Lines        4617     4617           
=======================================
  Hits         4022     4022           
  Misses        595      595           

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

@@ -385,7 +388,7 @@
%% Read
% We can then read the file back in using MatNWB and inspect its contents.

read_nwbfile = nwbRead('intro_tutorial.nwb')
read_nwbfile = nwbRead('intro_tutorial.nwb', 'ignorecache')
Copy link
Contributor

Choose a reason for hiding this comment

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

why ignore cache here?

Copy link
Collaborator Author

@lawrence-mbf lawrence-mbf Dec 20, 2023

Choose a reason for hiding this comment

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

The environment is already generated (we generated it in the section above) so we don't need to re-generate the cache. Furthermore, this preserves tests that probably run this tutorial.

Copy link
Collaborator Author

@lawrence-mbf lawrence-mbf Dec 20, 2023

Choose a reason for hiding this comment

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

To clarify, since we do need to switch between schema versions in the tutorials, we generate the cache locally in a working directory so we can easily clean it up later, ensuring that the test environment is empty before we run the next test (which could be using any environment). As a result, I believe all tests and tutorials should be using ignorecache and its variants, otherwise you will end up with strange class reference errors.

@bendichter bendichter self-requested a review January 3, 2024 22:01
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.

[Feature]: do we still need to require user to generateCore();?
2 participants