enthought/distarray — pull request #377 by bgrant (2014-05-19 21:26:32+00:00)
Title: Restrict use of checked_{g,s}etitem

The client only needs to use a `LocalArray`'s `checked_getitem` or `checked_setitem` methods when it doesn't know for sure which engine owns a particular index; otherwise it can use a `LocalArray`'s raw `__getitem__` or `__setitem__`. With the addition of client-side maps, a `DistArray` always knows where all of its indices are *unless* one of its dimensions is an `UnstructuredMap`. The changes in this PR reflect this.

To implement this, I add a `PRECISE_INDEXING` property to client-side `Distribution` objects. This property is `False` only when an `UnstructuredMap` is present.

Additionally, I remove the `checked_getitem` and `checked_setitem` methods from the `LocalArray` class, which forces a user to use `Distarray.global_index.checked_{g,s}etitem`, where they still reside. Previously, `LocalArray`s had a `__getitem__` that took local indices and a `checked_getitem` that took global indices. This was confusing. Another option, if we wanted to be stricter with the Law of Demeter, would be to add these methods back but rename them something like `global_checked_getitem`.