Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support SplitApplyCombine.jl methods #162

Open
bencottier opened this issue Feb 22, 2021 · 0 comments
Open

Support SplitApplyCombine.jl methods #162

bencottier opened this issue Feb 22, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@bencottier
Copy link

Named dims are not supported in SplitApplyCombine.jl, e.g. splitdimsview.

I haven't looked into what's required yet, I'm just assuming it can be supported in this package.

Example:

julia> using SplitApplyCombine, NamedDims

julia> M = NamedDimsArray{(:features, :observations)}([1 3; 5 7])

julia> map(x -> sum(x), splitdimsview(M, :features))
ERROR: MethodError: no method matching splitdimsview(::NamedDimsArray{(:features, :observations),Int64,2,Array{Int64,2}}, ::Symbol)
Closest candidates are:
  splitdimsview(::AbstractArray) at /Users/bencottier/.julia/packages/SplitApplyCombine/RS5bI/src/splitdims.jl:127
  splitdimsview(::AbstractArray, ::Int64) at /Users/bencottier/.julia/packages/SplitApplyCombine/RS5bI/src/splitdims.jl:129
  splitdimsview(::AbstractArray{var"#s46",N} where var"#s46", ::Tuple{Vararg{Int64,M}}) where {N, M} at /Users/bencottier/.julia/packages/SplitApplyCombine/RS5bI/src/splitdims.jl:130
Stacktrace:
 [1] top-level scope at REPL[4]:1

julia> map(x -> sum(x), splitdimsview(M, 1))
2-element Array{Int64,1}:
  4
 12

julia> map(x -> sum(x), eachslice(M; dims=:features))
2-element Array{Int64,1}:
  4
 12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant