Skip to content

Commit

Permalink
Merge pull request #276 from NeurodataWithoutBorders/275-fix-datapipe…
Browse files Browse the repository at this point in the history
…-size-query

fix datapipe size query
  • Loading branch information
lawrence-mbf authored Apr 19, 2021
2 parents 71f39ab + faed8cc commit 96bbb7e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions +types/+untyped/DataPipe.m
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,14 @@
end

function sz = size(obj, varargin)
assert(isa(obj.internal, 'types.untyped.datapipe.BoundPipe'),...
'NWB:DataPipe:LoadingUnboundPipe',...
['DataPipe must be successfully exported before DataStub '...
'features are allowed.']);
sz = size(obj.internal, varargin{:});
if isa(obj.internal, 'types.untyped.datapipe.BoundPipe')
sz = size(obj.internal, varargin{:});
elseif isa(obj.internal, 'types.untyped.datapipe.BlueprintPipe')
sz = obj.internal.maxSize;
else
error('MatNWB:DataPipe:UnhandledPipe', ['Internal Datapipe of type `%s` does not '...
'have a handled size() method.'], class(obj.internal));
end
end

function append(obj, data)
Expand Down

0 comments on commit 96bbb7e

Please sign in to comment.