[Please, always try to send messages from *subscribed* addresses]

A Thursday 19 November 2009 14:02:27 pytables-users-
boun...@lists.sourceforge.net escrigué:
> Hello,
> 
> I was wondering why it's not possible to use the "filters" parameter with
>  createArray (just like with createTable) to ask for compression ? In other
>  words, when I use ptrepack with option --complevel=1, if my hdf5 file only
>  contains leaves created from numpy arrays with createArray, no compression
>  is done.
> 
> For example :
> import numpy as N
> import tables
> 
> z = N.ones(10e6)
> filters = tables.Filters(complevel=1)
> myfile = tables.openFile('./temp.h5', 'a', filters=filters)
> myfile.createArray(myfile.root, 'z', z) # in this case no compression is
>  done z_table = N.rec.fromarrays(z, names='z')
> myfile.createTable(myfile.root, 'z_table', z) # compression is ok

Yes.  From the `Array` description in the Reference chapter of the UG:

"""
This class provides methods to write or read data to or from array objects in 
the file. This class does not allow you neither to enlarge nor compress the 
datasets on disk; use the EArray class (see Section 4.9) if you want 
enlargeable dataset support or compression features, or CArray (see Section 
4.8) if you just want compression.
"""

This is because the `Array` creates a non-chunked dataset in the underlying 
HDF5, and this sort of datasets cannot be compressed.

> 
> Thank you for your help,
> 
> Jean-Baptste Rudant
> 

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