|
From: Muench, J. <jm...@fh...> - 2004-02-05 01:31:39
|
I'm running into two problems building the Description classes. The first is
that I won't know until run-time what the size of the arrays I want to store
are. Therefore I need to be able to define the shapes of columns dynamically
before instantiating the Table object. It seems that there should be a
clever way of doing this, but I'm just not seeing it (another metaclass?).
Given that I can figure out how to take care of dynamic sizing, there are
times I will be storing a list of length 1. PyTables doesn't like lists of
length 1.
An example:
from tables import *
LENGTH = 12
NUM_NAMES = 1
class ExampleDescription(IsDescription):
personId = Int64Col()
ages = Float32Col(shape=LENGTH)
names = StringCol(length=16, shape=NUM_NAMES)
if I then try to assign exampleRow['names'] = ['fred',] I get a bad value
type. Is this the intended behavior?
Thanks in advance!
Joanna
|