A Thursday 23 July 2009 22:29:31 nicky van foreest escrigué:
> Hi,
>
> I would like to include a vl array in a class like this (from the
> tutorial):
>
> class Particle(IsDescription):
>     name        = StringCol(itemsize=16)  # 16-character string
>     lati        = Int32Col()              # integer
>     longi       = Int32Col()              # integer
>     pressure    = Float32Col(shape=(2,3)) # array of floats
> (single-precision) temperature = Float64Col(shape=(2,3)) # array of doubles
> (double-precision)
>
>
> Is it possible to make, for instance, temperature a variable length
> array? The following doesn't work, which I concocted by analogy with
> vlarray1.py:
>
> class Particle(IsDescription):
>     name        = StringCol(16)   # 16-character String
>     temperature = Int32Atom(shape=())

No, variable length records in Table objects are not supported, and probably 
will never be so because of efficiency reasons (accessing to regular 
rectangular block sizes is way faster than accessing to ragged ones).

However, you can always simulate 'variable-length' records by keeping an index 
in the table to the row of the VLArray that contains you variable length field 
(or fields).

Hope that helps,

-- 
Francesc Alted

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to