I think _process_return_value() is unecessary, and I'd like to see it removed, and __getitem__ refactored in the process.
It seems like there are three separate cases (currently) for __getitem__, and each one can be made into its own internal method on DistArray. This will also remove process_return_value.
- Case 1:
self.distribution.has_precise_index and return_proxy
- Case 2:
self.distribution.has_precise_index and not return_proxy
- Case 3:
not self.distribution.has_precise_index
Each case should call its own internal method, and define its own local function to call. Further, in Case 1, the resulting array's distribution and dtype is known ahead of time, so the call to from_localarrays() should use them and save a roundtrip.
I think
_process_return_value()is unecessary, and I'd like to see it removed, and__getitem__refactored in the process.It seems like there are three separate cases (currently) for
__getitem__, and each one can be made into its own internal method onDistArray. This will also removeprocess_return_value.self.distribution.has_precise_index and return_proxyself.distribution.has_precise_index and not return_proxynot self.distribution.has_precise_indexEach case should call its own internal method, and define its own local function to call. Further, in Case 1, the resulting array's distribution and dtype is known ahead of time, so the call to
from_localarrays()should use them and save a roundtrip.