-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into add-nwb-install-extension
- Loading branch information
Showing
438 changed files
with
16,219 additions
and
33,686 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
function requiredPropertyNames = getRequiredPropertyNames(classprops) | ||
% getRequiredPropertyNames - Get name of required properties from props info | ||
|
||
allProperties = keys(classprops); | ||
requiredPropertyNames = {}; | ||
|
||
for iProp = 1:length(allProperties) | ||
|
||
propertyName = allProperties{iProp}; | ||
prop = classprops(propertyName); | ||
|
||
isRequired = ischar(prop) || isa(prop, 'containers.Map') || isstruct(prop); | ||
isPropertyRequired = false; | ||
if isa(prop, 'file.interface.HasProps') | ||
isPropertyRequired = false(size(prop)); | ||
for iSubProp = 1:length(prop) | ||
p = prop(iSubProp); | ||
isPropertyRequired(iSubProp) = p.required; | ||
end | ||
end | ||
|
||
if isRequired || all(isPropertyRequired) | ||
requiredPropertyNames = [requiredPropertyNames {propertyName}]; %#ok<AGROW> | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
function allProps = mergeProps(props, superClassProps) | ||
% merge_props - Merge maps containing props info for class and it's superclasses | ||
|
||
allPropsCell = [{props}, superClassProps]; | ||
allProps = containers.Map(); | ||
|
||
% Start from most remote ancestor and work towards current class. | ||
% Important to go in this order because subclasses can override | ||
% properties, and we need to keep the property definition for the superclass | ||
% that is closest to the current class or the property definition for the | ||
% class itself in the final map | ||
for i = numel(allPropsCell):-1:1 | ||
superPropNames = allPropsCell{i}.keys; | ||
for jProp = 1:numel(superPropNames) | ||
allProps(superPropNames{jProp}) = allPropsCell{i}(superPropNames{jProp}); | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.