-
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.
Reset / remove files related to dynamic table refactor PR #612
- Loading branch information
1 parent
4825605
commit 533fce8
Showing
15 changed files
with
323 additions
and
436 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
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 |
---|---|---|
@@ -1,43 +1,41 @@ | ||
function addColumn(DynamicTable, varargin) | ||
% ADDCOLUMN Given a dynamic table and a keyword argument, add a column to the dynamic table. | ||
% | ||
% ADDCOLUMN(DT,NM,VD) | ||
% append specified column name NM and non-ragged VectorData VD to DynamicTable DT | ||
% | ||
% ADDCOLUMN(DT,NM, VD, VI) append specified column by col_name NM represented | ||
% by multiple VectorIndex references VI ordered in such a way where VI(n) references V(n-1) and | ||
% VI(1) references VectorData VD. | ||
% | ||
% This function asserts the following: | ||
% 1) DynamicTable is a valid dynamic table and has the correct | ||
% properties. | ||
% 2) The height of the columns to be appended matches the height of the | ||
% existing columns | ||
% ADDCOLUMN Given a dynamic table and a set of keyword arguments for one or | ||
% more columns, add one or more columns to the dynamic table by providing | ||
% either keywords or a MATLAB table | ||
% | ||
% ADDCOLUMN(DT,TABLE) append the columns of the MATLAB Table TABLE to the | ||
% DynamicTable | ||
% | ||
% ADDCOLUMN(DT,col_name1,col_vector1,...,col_namen,col_vectorn) | ||
% append specified column names and VectorData to table | ||
% | ||
% This function asserts the following: | ||
% 1) DynamicTable is a valid dynamic table and has the correct | ||
% properties. | ||
% 2) The height of the columns to be appended matches the height of the | ||
% existing columns | ||
|
||
validateattributes(DynamicTable ... | ||
, {'types.core.DynamicTable', 'types.hdmf_common.DynamicTable'} ... | ||
, {'scalar'}); | ||
validateattributes(DynamicTable,... | ||
{'types.core.DynamicTable', 'types.hdmf_common.DynamicTable'},... | ||
{'scalar'}); | ||
|
||
assert(nargin > 1, 'NWB:DynamicTable:AddColumn:NoData', 'Not enough arguments'); | ||
assert(nargin > 1, 'NWB:DynamicTable:AddColumn:NoData', 'Not enough arguments'); | ||
|
||
if isempty(DynamicTable.id) | ||
if 8 == exist('types.hdmf_common.ElementIdentifiers', 'class') | ||
DynamicTable.id = types.hdmf_common.ElementIdentifiers(); | ||
else % legacy Element Identifiers | ||
DynamicTable.id = types.core.ElementIdentifiers(); | ||
end | ||
if isempty(DynamicTable.id) | ||
if 8 == exist('types.hdmf_common.ElementIdentifiers', 'class') | ||
DynamicTable.id = types.hdmf_common.ElementIdentifiers(); | ||
else % legacy Element Identifiers | ||
DynamicTable.id = types.core.ElementIdentifiers(); | ||
end | ||
end | ||
|
||
assert(~isa(DynamicTable.id.data, 'types.untyped.DataStub') ... | ||
, 'NWB:DynamicTable:AddColumn:Uneditable' ... | ||
, [ ... | ||
'Cannot write to on-file Dynamic Tables without enabling data pipes. '... | ||
'If this was produced with pynwb, please enable chunking for this table.']); | ||
assert(~isa(DynamicTable.id.data, 'types.untyped.DataStub'),... | ||
'NWB:DynamicTable:AddColumn:Uneditable',... | ||
['Cannot write to on-file Dynamic Tables without enabling data pipes. '... | ||
'If this was produced with pynwb, please enable chunking for this table.']); | ||
|
||
assert(~istable(varargin{1}) ... | ||
, 'NWB:DynamicTable:AddColumn:InvalidArgument' ... | ||
, [ ... | ||
'Using MATLAB tables as input to the addColumn DynamicTable method has been deprecated. ' ... | ||
'Please, use key-value pairs instead.']); | ||
if istable(varargin{1}) | ||
types.util.dynamictable.addTableColumn(DynamicTable, varargin{:}); | ||
else | ||
types.util.dynamictable.addVarargColumn(DynamicTable, varargin{:}); | ||
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
Oops, something went wrong.