BIDS / datarray

Prototyping numpy arrays with named axes for data management.
http://bids.github.com/datarray
Other
87 stars 20 forks source link

Make test suite pass on python 3 #60

Closed fperez closed 8 years ago

fperez commented 8 years ago

Hey @matthew-brett... Would you be interested in pitching in to make this puppy pass the test suite on py3?

I had a good chat today with @shoyer about pushing pieces of xray into the core of numpy, along the lines of the old ideas we had here long ago... Xray effectively has provided a working, production implementation of a labeled n-d array, though it has different semantics in some areas to datarray.

I think it would be useful to have a working copy of this on py3 so we could compare where needed, though we're more likely to draw more heavily from xray than datarray... If we can slice the right chunk of API out into numpy, it's possible that xray could use that as a building block (which could in turn eventually also benefit pandas, we'll see...).

I've already fixed it up to import on py3, and will keep chipping at it, but I figured you might be interested too...

fperez commented 8 years ago

Pinging @stefanv ...

matthew-brett commented 8 years ago

I'll have a go at this - am thinking of using datarray in nibabel.

matthew-brett commented 8 years ago

I have been working for a bit on datarray - see #61 #62 #63 #64 #65 .

I was going to get the tests to pass on Python 3, but then I found that the tests didn't pass on Python 2 - see : https://travis-ci.org/matthew-brett/datarray/jobs/114946116 - 9 errors.

Going back to numpy 1.4 on Python 2.6 helps a fair bit - just this one (plus some doctest errors):

======================================================================
ERROR: Failure: IndexError (Requested axis 2 out of bounds)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/mb312/.virtualenvs/py26-np/lib/python2.6/site-packages/nose/loader.py", line 253, in generate
    for test in g():
  File "/Users/mb312/dev_trees/datarray/datarray/tests/test_data_array.py", line 386, in test_ellipsis_slicing
    yield nt.assert_true, (a[0,...] == a[0]).all(), \
  File "/Users/mb312/dev_trees/datarray/datarray/datarray.py", line 997, in __getitem__
    arr = arr.axes[ax.index][k]
  File "/Users/mb312/dev_trees/datarray/datarray/datarray.py", line 172, in __getitem__
    raise IndexError("Requested axis %i out of bounds" % n)
IndexError: Requested axis 2 out of bounds
matthew-brett commented 8 years ago

Tests passing on Python 2, 3 for numpies from 1.6 through 1.11 at https://github.com/BIDS/datarray/pull/67 . I'd be grateful for a quick review.