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

Indexing with unsorted vectors #14

Closed
mbauman opened this issue Mar 5, 2015 · 3 comments
Closed

Indexing with unsorted vectors #14

mbauman opened this issue Mar 5, 2015 · 3 comments

Comments

@mbauman
Copy link
Member

mbauman commented Mar 5, 2015

I'm not sure what to do here, but this is a problem:

julia> A = AxisArray(1:10)
10-element AxisArrays.AxisArray{Int64,1,UnitRange{Int64},(AxisArrays.Axis{:row,UnitRange{Int64}},)}:
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10

julia> A[[3,2,1]]
ERROR: Dimensional axes must be monotonically increasing
 in checkaxis at /Users/mbauman/.julia/v0.4/AxisArrays/src/core.jl:290
 in anonymous at /Users/mbauman/.julia/v0.4/AxisArrays/src/core.jl:155
 in anonymous at /Users/mbauman/.julia/v0.4/AxisArrays/src/indexing.jl:51
@tshort
Copy link
Collaborator

tshort commented Mar 5, 2015

I'd call it a feature!

We could turn A[[3,2,1]] into A[sort([3,2,1])], but I'm not sure we should do that automatically.

@mbauman
Copy link
Member Author

mbauman commented Jun 11, 2017

Hm, this seems to no longer error:

julia> A = AxisArray(1:5, [4,6,5,2,6])
1-dimensional AxisArray{Int64,1,...} with axes:
    :row, [4, 6, 5, 2, 6]
And data, a 5-element UnitRange{Int64}:
 1
 2
 3
 4
 5

julia> A[5:-1:1]
1-dimensional AxisArray{Int64,1,...} with axes:
    :row, [6, 2, 5, 6, 4]
And data, a 5-element StepRange{Int64,Int64}:
 5
 4
 3
 2
 1

@kmsquire
Copy link

kmsquire commented Apr 1, 2019

Close? Doesn't seem to have been an error for a year and a half now...

@iamed2 iamed2 closed this as completed Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants