-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add functions for inferring directory of generated types #681
base: main
Are you sure you want to change the base?
Conversation
…ses are generated
Make generatedTypesDirectory optional. If not provided, it will be inferred from MATLAB's search path Improve docstring, variablenames and error message
Throw error from caller instead
Add property type constraints because name (and version?) are expected to be character types
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #681 +/- ##
=======================================
Coverage 95.29% 95.29%
=======================================
Files 139 141 +2
Lines 5332 5360 +28
=======================================
+ Hits 5081 5108 +27
- Misses 251 252 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes to loadNamespace
function
- Make generatedTypesDirectory optional. If not provided, it will be inferred from MATLAB's search path
- Improve docstring, variablenames and error message
|
||
if numel(generatedTypeLocation) > 1 | ||
warning('NWB:Types:MultipleGeneratedTypesFound', ... | ||
['Multiple generated types was found for %s.\n', ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['Multiple generated types was found for %s.\n', ... | |
['Multiple generated types were found for %s.\n', ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you indicate the paths for each?
Motivation
Generated neurodata type classes and format specifications (namespace) caches are saved in the root MatNWB directory by default.
However, it is possible to generate types and caches in other locations by specifying a
savedir
argument when runninggenerateCore
/generateExtension
(for example temporary locations which can be useful during testing).For the function
schemes.loadNamespace
, the default behavior was to look for the format specifications (namespace) caches in the root MatNWB directory. This PR changes this default behavior to instead find the directory where thetypes.core.NWBFile
is located by looking at MATLAB's search path.This makes the
schemes.loadNamespace
function more robust when used during testing where the namespace caches might be present in a different location than the root MatNWB directory.Checklist
fix #XX
whereXX
is the issue number?