Re: [Pytables-users] Inheritance in

2012-03-31 Thread Daπid
On Sat, Mar 31, 2012 at 9:13 AM, Antonio Valentino
 wrote:
> Some work on in broken inheritance of IsDescriptor has been done in the
> development branch (see [#65]). Thanks to Andrea Bedini for the patch.
>
> Which version of PyTables are you using David?

That is indeed a nice adition. I am using the released 2.3.1 version.

By the way, sorry for the incomplete subject.

--
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


Re: [Pytables-users] Inheritance in

2012-03-31 Thread Francesc Alted
On 3/31/12 2:13 AM, Antonio Valentino wrote:
> Hi Danid, hi Francesc,
>
> Il 31/03/2012 03:08, Francesc Alted ha scritto:
>> 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):
>>>
> [CUT]
>
>>> 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.
>>
> Some work on in broken inheritance of IsDescriptor has been done in the
> development branch (see [#65]). Thanks to Andrea Bedini for the patch.
>
> Which version of PyTables are you using David?
>
>
> cheers
>
> [#65] https://github.com/PyTables/PyTables/issues/65

Oh, that's a nice addition indeed.  Thanks for the remind!

-- 
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


Re: [Pytables-users] Inheritance in

2012-03-31 Thread Antonio Valentino
Hi Danid, hi Francesc,

Il 31/03/2012 03:08, Francesc Alted ha scritto:
> 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):
>>

[CUT]

>>
>> 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.
> 

Some work on in broken inheritance of IsDescriptor has been done in the
development branch (see [#65]). Thanks to Andrea Bedini for the patch.

Which version of PyTables are you using David?


cheers

[#65] https://github.com/PyTables/PyTables/issues/65

-- 
Antonio Valentino

--
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


Re: [Pytables-users] Inheritance in

2012-03-30 Thread Francesc Alted
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


[Pytables-users] Inheritance in

2012-03-30 Thread Daπid
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?


Thanks.

Best regards,

David.

--
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