libdynd / dynd-python

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

BUG/NotImplemented datashape conversion from void? #206

Open jreback opened 9 years ago

jreback commented 9 years ago
In [1]: from datashape import dshape

In [2]: from dynd import ndt

In [3]: dshape(ndt.type('?int64').dshape)
Out[3]: dshape("?int64")

Is this just not implemented?

In [4]: dshape(ndt.type('?void').dshape)

  File <nofile>, line 1
    ?void
     ^

DataShapeSyntaxError: Invalid datashape

---------------------------------------------------------------------------
DataShapeSyntaxError                      Traceback (most recent call last)
<ipython-input-4-43248ddfb0e7> in <module>()
----> 1 dshape(ndt.type('?void').dshape)

/Users/jreback/anaconda/envs/dynd/lib/python2.7/site-packages/datashape/util.pyc in dshape(o)
     47         return o
     48     if isinstance(o, py2help._strtypes):
---> 49         ds = parser.parse(o, type_symbol_table.sym)
     50     elif isinstance(o, (coretypes.CType, coretypes.String,
     51                         coretypes.Record, coretypes.JSON,

/Users/jreback/anaconda/envs/dynd/lib/python2.7/site-packages/datashape/parser.pyc in parse(ds_str, sym)
    573     # If no datashape could be found
    574     if ds is None:
--> 575         dsp.raise_error('Invalid datashape')
    576 
    577     # Make sure there's no garbage at the end

/Users/jreback/anaconda/envs/dynd/lib/python2.7/site-packages/datashape/parser.pyc in raise_error(self, errmsg)
     55     def raise_error(self, errmsg):
     56         raise error.DataShapeSyntaxError(self.tok.span[0], '<nofile>',
---> 57                                          self.ds_str, errmsg)
     58 
     59     def parse_homogeneous_list(self, parse_item, sep_tok_id, errmsg,

DataShapeSyntaxError: 

  File <nofile>, line 1
    ?void
     ^

DataShapeSyntaxError: Invalid datashape

cc @cpcloud cc @mrocklin

jreback commented 9 years ago

10.9.5

izaid commented 9 years ago

It looks to me like your Mac has some issues with being unable to find the C++ standard library. Unfortunately, I don't understand the details at all. It doesn't make sense that libdynd is fine, but dynd-python is not.

Another guess: Do you run setup.py as root? If so, try without it.

jreback commented 9 years ago

hmmm it doesn look like I am picking up something weird.