Skip to content

Commit 96bbb7e

Browse files
authored
Merge pull request #276 from NeurodataWithoutBorders/275-fix-datapipe-size-query
fix datapipe size query
2 parents 71f39ab + faed8cc commit 96bbb7e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

+types/+untyped/DataPipe.m

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,14 @@
232232
end
233233

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

242245
function append(obj, data)

0 commit comments

Comments
 (0)