Hello Martin,

A Sunday 16 May 2010 15:13:35 Martin Teichmann escrigué:
> Hello List, Hello Francesc,
> 
> I worked a bit more on the extensions necessary
> to use dimension scales, and now I think it is
> ready for inclusion into the main branch.
> It's all uploaded into the svn repository, and
> merged with the current trunk.

Mmh, you seem to forgot to merge more things from trunk than you actually do.  
The net result is that I cannot compile your branch.  Anyway, I've setup a new 
branch:

http://www.pytables.org/svn/pytables/branches/dimension-scales2

that compiles correctly (it needed with some small additional modifications).  
Please work with this new branch (I've given you commit privileges to it).

At any rate, in order to avoid messes in the future, do not try to merge 
things from trunk into branches (unless absolutely necessary, e.g. you need a 
feature in trunk).  The normal work-flow is merging from branches into trunk, 
and not the contrary.

> Since 2.2 beta 3 is already out, I guess I'm a bit
> late for 2.2, but for the next release I guess it's fine.

Yeah, it is a bit late, and in addition, there are some tests that do not work 
correctly:

======================================================================          
                                        
ERROR: None (tables.tests.test_attributes.NotCloseTypesTestCase)                
                                        
----------------------------------------------------------------------          
                                        
Traceback (most recent call last):                                              
                                        
  File "/home/faltet/PyTables/pytables/branches/dimension-
scales2/tables/tests/test_attributes.py", line 915, in 
test03_setObjectAttributes                                                      
                                               
    self.array.attrs.rs = {"ddf":32.1, "dsd":1}                                 
                                        
  File "/home/faltet/PyTables/pytables/branches/dimension-
scales2/tables/attributeset.py", line 453, in __setattr__     
    self._g__setattr(name, value)                                               
                                        
  File "/home/faltet/PyTables/pytables/branches/dimension-
scales2/tables/attributeset.py", line 394, in _g__setattr     
    self._g_setAttr(self._v_node, name, stvalue)                                
                                        
  File "hdf5Extension.pyx", line 447, in 
tables.hdf5Extension.AttributeSet._g_setAttr (tables/hdf5Extension.c:3691)     
  File "hdf5Extension.pyx", line 264, in tables.hdf5Extension.islist 
(tables/hdf5Extension.c:2065)                      
KeyError: 0                                                                     
                                        

======================================================================
ERROR: None (tables.tests.test_attributes.CloseTypesTestCase)         
----------------------------------------------------------------------
Traceback (most recent call last):                                    
  File "/home/faltet/PyTables/pytables/branches/dimension-
scales2/tables/tests/test_attributes.py", line 915, in 
test03_setObjectAttributes                                                      
                                               
    self.array.attrs.rs = {"ddf":32.1, "dsd":1}                                 
                                        
  File "/home/faltet/PyTables/pytables/branches/dimension-
scales2/tables/attributeset.py", line 453, in __setattr__     
    self._g__setattr(name, value)                                               
                                        
  File "/home/faltet/PyTables/pytables/branches/dimension-
scales2/tables/attributeset.py", line 394, in _g__setattr     
    self._g_setAttr(self._v_node, name, stvalue)                                
                                        
  File "hdf5Extension.pyx", line 447, in 
tables.hdf5Extension.AttributeSet._g_setAttr (tables/hdf5Extension.c:3691)     
  File "hdf5Extension.pyx", line 264, in tables.hdf5Extension.islist 
(tables/hdf5Extension.c:2065)                      
KeyError: 0                                                                     
                                        

======================================================================
FAIL: None (tables.netcdf3.tests.test_netcdf3.NetCDFFileTestCase)     
----------------------------------------------------------------------
Traceback (most recent call last):                                    
  File "/home/faltet/PyTables/pytables/branches/dimension-
scales2/tables/tests/common.py", line 248, in newmethod
    return oldmethod(self, *args, **kwargs)                                     
                                 
  File "/home/faltet/PyTables/pytables/branches/dimension-
scales2/tables/netcdf3/tests/test_netcdf3.py", line 75, in test_repr            
                                                                                
                      
    assert f.__repr__() == outstring                                            
                                        
AssertionError                                                                  
                                        

----------------------------------------------------------------------
Ran 2949 tests in 43.360s

FAILED (failures=1, errors=2)


> A little summary of the changes I did:
> 
> - implemented a class "reference" as a new type for
> numpy arrays, which represents HDF5 references.

I've had a look at it.  There a couple of things that I don't like specially:

- When dereferrencing, you need to pass the `file` argument to `deref()` 
method.  IMO, this is non-natural.  Perhaps it would be possible to add a new 
attribute in the `reference` class (and perhaps new `__getattr__()` and 
`__setattr__()` special methods for keeping the file info?

- You have chosen the 'r' typecode for the class.  But what would happen if 
the NumPy developers use 'r' in the future?  I think I've already expressed my 
worries about this before, but perhaps it is not as dangerous as I think?

> - attributes which are list-of-arrays-of some type (esp. reference)
> are stored and loaded as a list of vlens.
> - attributes which are a list of strings are stored and
> loaded as variable-length strings

That's nice, but your implementation seems to interact badly with existing 
functionality (see tests failures above).

> - a unit test for all that
> - added some documentation

The excerpt about the ABI incompatibility among NumPy 1.3 and 1.4 no longer 
applies as NumPy crew have decided to declare 1.4 as invalid and released 
1.4.1 which is ABI compatible with 1.x series.  So you may want to remove the 
note about this.

> so, it would be nice if someone else tested all that
> independently from me.

Exactly.  More people interested in testing the new functionality?

Thanks for the contribution!

-- 
Francesc Alted

------------------------------------------------------------------------------

_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to