JuliaArrays / AxisArrays.jl

Performant arrays where each dimension can have a named axis with values
http://JuliaArrays.github.io/AxisArrays.jl/latest/
Other
200 stars 41 forks source link

Dot-assignment fails with `MethodError: no method matching dotview` #185

Open sdl1 opened 4 years ago

sdl1 commented 4 years ago
julia> using AxisArrays

julia> x = AxisArray(rand(3, 3));

julia> x[row=1:2] .= 1
ERROR: MethodError: no method matching dotview(::AxisArray{Float64,2,Array{Float64,2},Tuple{Axis{:row,Base.OneTo{Int64}},Axis{:col,Base.OneTo{Int64}}}}; row=1:2)
Closest candidates are:
  dotview(::Any...) at broadcast.jl:1138 got unsupported keyword argument "row"
  dotview(::BitArray, ::BitArray) at broadcast.jl:1108 got unsupported keyword argument "row"
Stacktrace:
 [1] top-level scope at REPL[4]:1
 [2] eval(::Module, ::Any) at ./boot.jl:331
 [3] eval_user_input(::Any, ::REPL.REPLBackend) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:86
 [4] run_backend(::REPL.REPLBackend) at /Users/sean/.julia/packages/Revise/C272c/src/Revise.jl:1075
 [5] top-level scope at none:0

(Julia 1.4.1, AxisArrays 0.4.3)

In NamedDims.jl the dotview method was defined to give this functionality, see comment here, is this needed here?

oxinabox commented 4 years ago

@mbauman did we ever progress on this? I think we may have stopped in https://github.com/JuliaLang/julia/issues/31729 https://github.com/JuliaLang/julia/pull/31732