enthought/distarray — pull request #74 by bgrant (2013-10-24 22:48:47+00:00)
Title: Refactor utils, maps, and exports

Yet another refactoring PR (YARPR).

1. Pull some utils out of various files and put them into `utils.py`
2. Remove an unneeded utility function, generalize another
3. Sneak in a utility function for slice intersection (block dist, step=1 only)
4. Make `fromdap` into a classmethod of LocalArray
5. Split `fromdap` into `from_dap` and `from_distarray` for future use
a. `from_distarray` does what the old `fromdap` did (takes an object with a `__distarray__` method)
b. `from_dap` actually takes the `dimdata` and (optionally) `buffer` keys separately. I intend to use this with the `dimdata` key alone to make empty distributed arrays with specific requirements that our current `__init__` isn't sufficient for.
6. Refactor `maps.py` to use have an `ILocalMap` interface, an inheriting `BlockCyclicMap`, and a `BlockMap` and `CyclicMap` which inherit from it in turn.
7. Change some variable names referring to `dda` (DenseDistArray) to be spelled `dla` (DenseLocalArray).
8. Remove all the `__all__` explicit exports. In almost all cases, we were exporting everything from every module. I think we should take the opposite approach to exports and instead prefix names that we *don't* wish to export with an underscore. Think of the (code) savings!