Negative indexing in distarrays.#338
Conversation
|
Restarting Travis. |
|
I've added the suggested tests. And re factored |
|
Why don't we put |
|
Hmmm I still don't like this @kwmsmith
Putting it in targets, index = owning_targets(index)Looking at that does not make what is happening to the index obvious. |
|
On Wed, Apr 23, 2014 at 4:48 PM, Blake Griffith notifications@github.comwrote:
I'm in favor of changing the name I want
The index handling stuff has to be defensive -- we don't know how it's Putting the normalization code inside the distribution object ensures it is
Not if owning_ranks just calls the normalization code as-is -- then Which iterates over the index with owning_ranks. Which would make it return
Kurt W. Smith, Ph.D. ksmith@enthought.com |
Well I could change |
|
On Mon, Apr 28, 2014 at 10:11 AM, Blake Griffith
Any
Kurt W. Smith, Ph.D. ksmith@enthought.com |
|
Ah okay, I agree negative indexing should be available to |
|
@kwmsmith how does this look? |
|
Hold off on this until PR #349 is in. |
|
Closes #102 |
|
Oops, |
|
I think this is now ready for review, but PR #349 should go in first. |
I allow distarrays to take negative indices by converting the negative indices to positive ones in
__getitem__and__setitem__. This seems like the easiest way but it is probably not the best.I originally tried altering the Map classes to take negative indices but there were other checks happening that were throwing index errors. So that way seemed pretty invasive.
Also, look at the tests. Are the places I added tests the only cases that we are currently checking indexing directly?