BIDS / datarray

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

DataArray.__repr__ should parse as a single entity #38

Closed davclark closed 13 years ago

davclark commented 13 years ago

Simple DataArray repr's would ideally pass as python code which would yield an equivalent object. It should always visually parse as a "single" python object. Right now it looks like a DataArray object followed by a tuple on the following line. e.g.:

DataArray([[[-1.3685536 , -0.87802346,  1.12533207, -0.50299773],
        [ 0.38960639,  0.42815709, -1.23987688,  1.16147007]],
       [[ 0.64110261, -0.68083629, -1.50314814,  0.42519773],
        [ 0.15450664,  1.08758205,  0.85730028,  0.73189326]],
       [[-0.10893355,  0.36861978, -1.62114425, -0.09202748],
        [ 0.99384913, -0.67653663,  0.16258059, -1.44996171]]])
('x', 'y', 'z')

could become:

DataArray([[[-1.3685536 , -0.87802346,  1.12533207, -0.50299773],
        [ 0.38960639,  0.42815709, -1.23987688,  1.16147007]],
       [[ 0.64110261, -0.68083629, -1.50314814,  0.42519773],
        [ 0.15450664,  1.08758205,  0.85730028,  0.73189326]],
       [[-0.10893355,  0.36861978, -1.62114425, -0.09202748],
        [ 0.99384913, -0.67653663,  0.16258059, -1.44996171]]], 
    labels=('x', 'y', 'z'))

(or similar)

terhorst commented 13 years ago

Fixed in 7a2c7dd