Re: [SQLObject] storing objects that have matrices as attributes
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ryan K. <rya...@co...> - 2005-05-17 10:38:01
|
I thought I had replied to this, but don't see it any where in my sent folder. So, please forgive me if this is the second time I have sent this. The PickleCol works great. It is a neat idea and it does exactly what I need in this situation. But the files are very large. SciPy has a function called shelve and using it to store the same data seems to result in files about 1/10th the size of using PickleCol and matrices. I think shelve uses some sort of compression or something. Is there away to use compression with PickleCol? Thanks, Ryan Ian Bicking wrote: > Ryan Krauss wrote: > >> Maybe an example would make this clearer. What if I want to store a >> collection of objects with the following properties: >> entry1.input='a1' >> entry1.output='j2' >> entry1.datafile=['file1','file2','file3'] >> entry1.data1=[1.2,1.47,3.56,....] >> entry1.data2=[-1.5,-19.5,35.5,....] >> >> And what if data1 and data2 are Numeric arrays/matrices (or from >> numarray)? Can SQLObject store a collection of such objects? > > > You can use PickleCol for this, so long as its okay that the data is > opaque to the database and to queries. Or you could create a > _set_data1() method that inserts the values into another table, and > _get_data1() that retrieves them. > |