A Tuesday 23 March 2010 14:17:29 Matt Calder escrigué:
> Maarten,
> 
> Thanks for the pointer to h5diff. Unfortunately, it shows no
> difference in the files. Any idea how a timestamp might find its way
> into the file? Or where I might look for an answer? I'm guessing this
> is happening at the hdf5 rather than the pytable level.

This is my guess too.  The script below generates identical files:

---------------------------------------
import tables
import numpy
import time

# Define simple table
table1 = numpy.array([[(0,0,0), (1,0,0)], [(0,1,0), (0,0,1)]], {'names': 
('r','g','b'), 'formats': ('f4', 'f4', 'f4')})
# Write table to a file
h5file = tables.openFile("/tmp/file1.h5", "w", PYTABLES_SYS_ATTRS=False)
h5file.createTable("/", "table1", description = table1)
h5file.close()

#time.sleep(1)

# Write same table to another file
h5file = tables.openFile("/tmp/file2.h5", "w", PYTABLES_SYS_ATTRS=False)
h5file.createTable("/", "table1", description = table1)
h5file.close()
---------------

[notice how I've disabled pytables' system attributes, just in case]

$ diff /tmp/file1.h5 /tmp/file2.h5
$

but if I uncomment the `time.sleep(1)` line, the files differ:

$ diff /tmp/file1.h5 /tmp/file2.h5
Els fitxers /tmp/file1.h5 i /tmp/file2.h5 difereixen
$

Object IDs are also identical:

$ h5ls -i /tmp/file1.h5
HDF5 "/tmp/file1.h5" {
GROUP "/" {
      OBJECTID { 33554433 }
   DATASET "table1" {
      DATATYPE  H5T_COMPOUND {
         H5T_IEEE_F32LE "r";
         H5T_IEEE_F32LE "g";
         H5T_IEEE_F32LE "b";
      }
      DATASPACE  SIMPLE { ( 4 ) / ( H5S_UNLIMITED ) }
      OBJECTID { 83886081 }
[...]

$ h5ls -i /tmp/file2.h5
HDF5 "/tmp/file2.h5" {
GROUP "/" {
      OBJECTID { 33554433 }
   DATASET "table1" {
      DATATYPE  H5T_COMPOUND {
         H5T_IEEE_F32LE "r";
         H5T_IEEE_F32LE "g";
         H5T_IEEE_F32LE "b";
      }
      DATASPACE  SIMPLE { ( 4 ) / ( H5S_UNLIMITED ) }
      OBJECTID { 83886081 }
[...]

Mmh, I am afraid that you will need to use another way to check whether the 
files are identical or not.

-- 
Francesc Alted

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to