From: Francesc A. <fa...@op...> - 2003-12-02 09:33:55
|
Hi, It seems like if numarray.strings module is not able to create objects when one of its dimensions is zero. For example, this works: >>> import numarray >>> numarray.array([], shape=(1,0,2)) array([]) but, for strings, it raises the next error: >>> numarray.strings.array(None, itemsize=3, shape=(1,0,2)) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/local/lib/python2.3/site-packages/numarray/strings.py", line 955, in array byteoffset=byteoffset, bytestride=bytestride) File "/usr/local/lib/python2.3/site-packages/numarray/strings.py", line 94, in __init__ self.fill(" ") File "/usr/local/lib/python2.3/site-packages/numarray/strings.py", line 318, in fill self[:] = char*self._itemsize File "/usr/local/lib/python2.3/site-packages/numarray/generic.py", line 505, in _slicedIndexing retarr._copyFrom(value) File "/usr/local/lib/python2.3/site-packages/numarray/strings.py", line 202, in _copyFrom me[:] = it[..., :self._itemsize] File "/usr/local/lib/python2.3/site-packages/numarray/generic.py", line 505, in _slicedIndexing retarr._copyFrom(value) libnumarray.error: copy1bytes: access beyond buffer. offset=2 buffersize=0 I think it would be nice (and consistent) to support that in strings too. Thanks, -- Francesc Alted |