After fixing 1629, it occurred to me that IDL still has an indexing mode which I'd like to pick up:
IDL> lookup= [.1,.2,.3,.4,.5,.4,.3,.2,.1]
IDL> t1= [[3,4,5,6],[4,5,6,7]]
IDL> print, lookup[t1]
0.400000 0.500000 0.400000 0.300000
0.500000 0.400000 0.300000 0.200000
Right now, only rank 1 datasets can be used to index in Autoplot, and it should be possible to work out the logic which supports this case. (There are modes supported here different than IDL or SciPy indexing, such as implicit slicing:vap+inline:ds=rand(20,30)&ds[2:12], which may make this non-trivial.)
I suspect there are other modes needs to complete the set, and this ticket will be closed when they done.
See http://jfaden.net/jenkins/job/autoplot-test037/ws/indexing.jy
See also https://sourceforge.net/p/autoplot/bugs/1629/
Another challenge with this is where a rank 2 list-of-indeces might be confused with a rank 2 array of indeces. For example:
Last edit: Jeremy Faden 2019-04-03
I had a mistake where the writable dataset was checked for dimensionality, and the read-only one (always present) should be used.
The last mode of the example needs to be considered.
Here's another bug:
This fails because while this should be the same as ds.slice(188).slice(192), the code attempts to use a rank 0 access of a rank 3 dataset, when this should result in rank 1.
And it looks like negative stride, used to flip arrays, isn't solidly supported. For example:
and
Here's the script where I encountered the problem:
Last edit: Jeremy Faden 2021-10-18
I added a few new tests to https://jfaden.net/jenkins/job/autoplot-test037/ws/indexing.jy
Ivar and I noticed this bug, where a rank 1 set of indices should be promoted to rank two before assigning the values:
This should result in records 1, 2, and 3 being made all NaN, but instead ds[0,1], ds[0,2], ds[0,3] are made fill.
That last bug is fixed in 20220830a and v2022a_8.