We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b8c8183 commit 67666bfCopy full SHA for 67666bf
1 file changed
src/TensorStoreWrapper.jl
@@ -233,7 +233,11 @@ end
233
234
# IndexDomainWrapper methods
235
Base.size(w::IndexDomainWrapper) = pyconvert(Tuple, parent(w).shape)
236
-Base.size(w::IndexDomainWrapper, d::Integer) = d <= ndims(w) ? size(w)[d] : 1
+function Base.size(w::IndexDomainWrapper, d::Integer)
237
+ d < 1 && throw(ArgumentError("dimension must be ≥ 1"))
238
+ sz = size(w)
239
+ return d <= length(sz) ? sz[d] : 1
240
+end
241
Base.ndims(w::IndexDomainWrapper) = pyconvert(Int, parent(w).rank)
242
function Base.axes(w::IndexDomainWrapper)
243
rank = ndims(w)
0 commit comments