Skip to content

Commit

Permalink
more depwarn fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnychen94 committed Jul 25, 2021
1 parent 3b3d620 commit b13994c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ end

# Keyword indexing, reconstructs the Axis{}() objects
@propagate_inbounds Base.view(A::AxisArray; kw...) =
view(A, kw_to_axes(parent(A), kw.data)...)
view(A, kw_to_axes(parent(A), values(kw))...)
@propagate_inbounds Base.getindex(A::AxisArray; kw...) =
getindex(A, kw_to_axes(parent(A), kw.data)...)
getindex(A, kw_to_axes(parent(A), values(kw))...)
@propagate_inbounds Base.setindex!(A::AxisArray, val; kw...) =
setindex!(A, val, kw_to_axes(parent(A), kw.data)...)
setindex!(A, val, kw_to_axes(parent(A), values(kw))...)

function kw_to_axes(A::AbstractArray, nt::NamedTuple)
length(nt) == 0 && throw(BoundsError(A, ())) # Trivial case A[] lands here
Expand Down
4 changes: 2 additions & 2 deletions test/intervals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ v = [1 .. 2, 3.0 .. 4.0]
@test 4 in 2.0 .. 6.0
@test 4 in 4.0 .. 4.0
@test 4 in 4.0 .. 5
@test (1..2) in (0.5 .. 2.5)
@test !((1..2) in (1.5 .. 2.5))
@test (1..2) (0.5 .. 2.5)
@test !((1..2) (1.5 .. 2.5))

@test maximum(1..2) === 2
@test minimum(1..2) === 1
Expand Down

0 comments on commit b13994c

Please sign in to comment.