-
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 607-fix-namespace-embedding-in-file
- Loading branch information
Showing
443 changed files
with
16,314 additions
and
33,689 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
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,16 @@ | ||
function tf = isNeurodataType(value) | ||
% isNeurodataType - Check if a value / object is a neurodata type. | ||
% | ||
% tf = matnwb.utility.isNeurodataType(value) returns true if the value | ||
% is an object of a class representing a neurodata type of the NWB Format. | ||
% If the input is a string representing the class name of a neurodata | ||
% type, the function will also return true. | ||
|
||
tf = false; | ||
if isa(value, 'char') || isa(value, 'string') | ||
tf = matnwb.utility.isNeurodataTypeClassName(value); | ||
elseif isa(value, 'types.untyped.MetaClass') | ||
className = class(value); | ||
tf = matnwb.utility.isNeurodataTypeClassName(className); | ||
end | ||
end |
Oops, something went wrong.