JuliaArrays / JuliaArrays/AxisArrays.jl

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

Open
#185 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
207
Forks
41
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Julia 1.4.1 example with AxisArrays 0.4.3, then inspect the referenced NamedDims.jl implementation in src/wrapper_array.jl and compare its dotview behavior. Confirm the expected approach and verify that named-axis dot-assignment no longer raises the reported MethodError.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.