Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support legacy namespace names #403

Merged
merged 2 commits into from
Jul 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions nwbRead.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ function generateSpec(filename, specinfo, varargin)
Namespaces = spec.generate(namespaceText, schemaMap);
% Handle embedded namespaces.
Namespace = Namespaces(strcmp({Namespaces.name}, namespaceName));
if isempty(Namespace)
% legacy checks in case namespaceName is using the old underscore
% conversion name.
namespaceName = strrep(namespaceName, '_', '-');
Namespace = Namespaces(strcmp({Namespaces.name}, namespaceName));
end

assert(~isempty(Namespace), ...
'NWB:Namespace:NameNotFound', ...
'Namespace %s not found in schema. Perhaps an extension should be generated?', ...
namespaceName);

spec.saveCache(Namespace, saveDir);
specNames{iGroup} = Namespace.name;
Expand Down