libdynd / dynd-python

Python exposure of dynd
http://libdynd.org
Other
120 stars 23 forks source link

BUG: np.__array__ on nd array with option ndt #201

Open jreback opened 9 years ago

jreback commented 9 years ago

xref #149

slightly older dynd/libdynd versions dynd: 0.6.6.post084.gdc3bbe5 [0.6.6.post559.g5722196]

In [8]: import dynd
In [9]: from dynd import nd
In [10]: import numpy as np

In [11]: np.array(a)
Out[11]: array([1, 2, 3], dtype=int32)

In [12]: np.array(nd.array([1,2,3]))
Out[12]: array([1, 2, 3], dtype=int32)

In [13]: np.array(nd.array([1,None,3]))
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-13-c355888023ae> in <module>()
----> 1 np.array(nd.array([1,None,3]))

TypeError: expected a readable buffer object
izaid commented 9 years ago

Could you try this with master (of both)? If it is still there, I can try and hunt it down.

jreback commented 9 years ago
In [1]: import dynd

In [2]: from dynd import nd

In [3]: import numpy as np

In [4]: np.array(nd.array([1,2,3]))
Out[4]: array([1, 2, 3], dtype=int32)

In [5]: np.array(nd.array([1,None,3]))
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-c355888023ae> in <module>()
----> 1 np.array(nd.array([1,None,3]))

TypeError: expected a readable buffer object

In [6]: dynd.__version__
Out[6]: '0.6.6.post148.g7e2c94e'

In [9]: dynd.__libdynd_version__
Out[9]: '0.6.6.post673.gf089f7c'
jreback commented 9 years ago

side-issue, does dynd have something like this ? helpful for posting reports & such. pd.show_versions()

INSTALLED VERSIONS
------------------
commit: 977f64f88370b33f8d34431e4e1e88dd495646f0
python: 2.7.9.final.0
python-bits: 64
OS: Darwin
OS-release: 13.4.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: None

pandas: 0.15.2-196-g977f64f
nose: 1.3.4
Cython: 0.21.2
numpy: 1.9.1
dynd: 0.6.6.post148.g7e2c94e [0.6.6.post673.gf089f7c]