On 3/30/12 7:57 PM, Daπid wrote:
> Hello,
>
> I have several different kinds of data tables, absolutely independent,
> defined as in the tutorial
> (http://pytables.github.com/usersguide/tutorials.html):
>
>
> from tables import *
>
> class SaltedPie(IsDescription):
>     dough=Int64Col()
>     baking=Float64Col()
>     anchovy=Float32Col()
>
> class SweetPie(IsDesctiption):
>     dough=Int64Col()
>     baking=Float64Col()
>     apple=UInt32Col()
>
>
> One, naively, saw the repetition and would want to do something like:
>
> class Pie(IsDescription):  # All kind of pies
>     dough=Int64Col()
>     baking=Float64Col()
>
>
> class SaltedPie(Pie):
>     anchovy=Float32Col()
>
> class SweetPie(Pie):
>     apple=UInt32Col()
>
>
> but, when I try to set 'dough', I get:
>
> KeyError: 'no such column: dough'
>
>
> Of course, my approach is not correct. Is there a valid way of doing it?

Right, subclassing IsDescription is not supported. Sorry, but I think 
that the only way is to do the repetition explicitly. Or, maybe you can 
use a NumPy dtype instead, that allows you to create table schemas more 
succinctly.

-- 
Francesc Alted


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to