Hi Francesc et al.,
I've encountered an inconsistency with VLArray.__getitem__().
Specifically:
In [50]: fp = tables.openFile('t.h5', mode='w')
In [51]: a = fp.createVLArray('/', 'a', tables.ObjectAtom(), "a")
In [52]: a.append('stuff')
In [53]: a.append('spam')
In [55]: a[[0, 1]]
Out[55]: ['stuff', 'spam']
In [56]: a[[0]]
Out[56]: ['stuff'] # <--- ok
In [57]: a[np.array([0, 1])]
Out[57]: ['stuff', 'spam']
In [58]: a[np.array([0])]
Out[58]: 'stuff' # <--- problem
Note now the last invocation -- with numpy array of length-1 returned a
_scalar_ instead of an array, as I would expect based on what length-1
list returns.
Is this a bug or feature? If former, is there any chance a fix could
make it into 2.2.1? We're about to make a wide deployment of a package
that gets nastily broken by this issue, and there's no easy way to
implement a workaround that wouldn't get broken by a potential future fix.
Cheers,
--
Mario Juric,
Hubble Fellow, Harvard-Smithsonian Center for Astrophysics
Web : http://www.sns.ias.edu/~mjuric/
Phone : +1 617 744-9003 PGP: ~mjuric/crypto/public.key
E-mail reading/answering policy: http://majuric.org/email/
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users