BIDS / datarray

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

Provide numpy-like constructors #23

Closed llvilanova closed 9 years ago

llvilanova commented 14 years ago

This should close bug fperez/datarray#19.

fperez commented 13 years ago

I tried to merge your code, but unfortunately it breaks the test suite very badly... We do have a couple of minor failures right now in trunk, but after applying your commit I get:

((98c5238...))maqroll[tests]> python -c 'import datarray;datarray.test()'
Running unit tests for datarray
NumPy version 1.3.0
NumPy is installed in /usr/lib/python2.6/dist-packages/numpy
Python version 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3]
nose version 0.11.1
.E..........F.EEEF.EFEFE......EEEEEEEEEEEEEEEEEEEEEEE..EEEEE
======================================================================
ERROR: Failure: ValueError (Dimension mismatch between ticks and data at index 0)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/nose/loader.py", line 224, in generate
    for test in g():
  File "/home/fperez/usr/opt/lib/python2.6/site-packages/datarray/testing/tests/test_utils.py", line 22, in test_assert_datarray_equal
    y = DataArray([1, 2], [('a', ['a', 'b'])])
  File "/home/fperez/usr/opt/lib/python2.6/site-packages/datarray/datarray.py", line 621, in __new__
    _init_axes(res, None, labels)
  File "/home/fperez/usr/opt/lib/python2.6/site-packages/datarray/datarray.py", line 452, in _init_axes
    axes.append(Axis(label, i, dest, ticks=ticks))
  File "/home/fperez/usr/opt/lib/python2.6/site-packages/datarray/datarray.py", line 82, in __init__
    self._tick_dict = self._validate_ticks(ticks)
  File "/home/fperez/usr/opt/lib/python2.6/site-packages/datarray/datarray.py", line 148, in _validate_ticks
    raise ValueError(e)
ValueError: Dimension mismatch between ticks and data at index 0

Lots more output, snipped...

======================================================================
FAIL: datarray.tests.test_data_array.test_1d(False,)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/nose/case.py", line 183, in runTest
    self.test(*self.arg)
AssertionError

----------------------------------------------------------------------
Ran 60 tests in 0.026s

FAILED (errors=35, failures=4)

Could you ensure that the test suite passes, at least at the level it passes in current trunk, and ping us again?

Thanks,

f

fperez commented 9 years ago

Sorry, closing this...