Skip to content

Commit

Permalink
Update SparseAxisArray.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Feb 17, 2024
1 parent 1786691 commit 052db1b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Containers/SparseAxisArray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ function SparseAxisArray(
return SparseAxisArray(od, names)
end

function SparseAxisArray(d::AbstractDict{K,T}) where {T,N,K<:NTuple{N,Any}}
function SparseAxisArray(
d::AbstractDict{K,T},
::Nothing = nothing,
) where {T,N,K<:NTuple{N,Any}}
return SparseAxisArray(d, ntuple(n -> Symbol("#$n"), N))
end

SparseAxisArray(d::AbstractDict, ::Nothing) = SparseAxisArray(d)

Base.length(sa::SparseAxisArray) = length(sa.data)

Base.IteratorSize(::Type{<:SparseAxisArray}) = Base.HasLength()
Expand Down

0 comments on commit 052db1b

Please sign in to comment.