SciTools / biggus

:no_entry: [DEPRECATED] Virtual large arrays and lazy evaluation.
http://biggus.readthedocs.io/
GNU Lesser General Public License v3.0
54 stars 27 forks source link

Added AsDataTypeArray and the Array.astype method. #141

Closed pelson closed 9 years ago

pelson commented 9 years ago

This was one of the things I thought of on my :bike: this morning.

rhattersley commented 9 years ago
>>> biggus.zeros(3).astype('i4')[:2]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/local/ithr/miniconda/envs/biggus/lib/python2.7/site-packages/biggus/__init__.py", line 538, in __getitem__
    indexed_array = self._getitem_full_keys(keys)
  File "/data/local/ithr/miniconda/envs/biggus/lib/python2.7/site-packages/biggus/__init__.py", line 662, in _getitem_full_keys
    return self.array._getitem_full_keys(keys)
  File "/data/local/ithr/miniconda/envs/biggus/lib/python2.7/site-packages/biggus/__init__.py", line 556, in _getitem_full_keys
    raise NotImplementedError('_getitem_full_keys should be overridden.')
NotImplementedError: _getitem_full_keys should be overridden.

And that's why I like abstract methods... :wink:

pelson commented 9 years ago

No comment re abstract methods...

I've added a commit which fixes the bug with ArrayContainers. This should now all be dandy.

pelson commented 9 years ago

Anything holding this back from being merged @rhattersley?