-
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
Ensure core
and hdmf-common
specifications are embedded in NWBFile by default
#674
base: main
Are you sure you want to change the base?
Changes from all commits
1e9c961
1fce887
e307dff
c98b898
8f44c79
b7632e3
429d0be
d761cd6
abf26da
d8af421
274745e
3fee57e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix unrelated bug in test suite |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,6 +123,7 @@ | |
arguments | ||
obj (1,1) NwbFile | ||
options.IncludeParentTypes (1,1) logical = false | ||
options.IncludeNwbFile (1,1) logical = false | ||
end | ||
|
||
objectMap = searchProperties(containers.Map, obj, '', ''); | ||
|
@@ -136,6 +137,14 @@ | |
|
||
nwbTypeNames = objectClassNames(keep & ~ignore); | ||
|
||
if options.IncludeNwbFile | ||
% Include class name for NWBFile superclass | ||
allSuperclasses = string(superclasses(obj)); | ||
nwbTypeNames = [... | ||
allSuperclasses(endsWith(allSuperclasses, 'NWBFile')), ... | ||
nwbTypeNames]; | ||
end | ||
|
||
if options.IncludeParentTypes | ||
includedNwbTypesWithParents = string.empty; | ||
for i = 1:numel(nwbTypeNames) | ||
|
@@ -152,12 +161,20 @@ | |
function embedSpecifications(obj, output_file_id) | ||
jsonSpecs = schemes.exportJson(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This works, but ideally namespaces would get parsed and saved in the mat-file cache in the schemes.exportJson() function if the are missing. This would require a bit more refactoring though, and not sure if that is worth it @bendichter ? |
||
|
||
if isempty(jsonSpecs) | ||
% Call generateCore to create cached namespaces | ||
generateCore(obj.nwb_version) | ||
jsonSpecs = schemes.exportJson(); | ||
end | ||
|
||
% Resolve the name of all types and parent types that are | ||
% included in this file. This will be used to filter the specs | ||
% to embed, so that only specs with used neurodata types are | ||
% embedded. | ||
includedNeurodataTypes = obj.listNwbTypes("IncludeParentTypes", true); | ||
|
||
includedNeurodataTypes = obj.listNwbTypes(... | ||
"IncludeParentTypes", true, ... | ||
"IncludeNwbFile", true); | ||
|
||
% Get the namespace names | ||
namespaceNames = getNamespacesForDataTypes(includedNeurodataTypes); | ||
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix unrelated issue. Make sure the path is actually a folder before calling rmdir |
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.
Improve warning message