Ignore:
Timestamp:
13/03/12 13:32:01 (9 years ago)
Author:
mnagni
Message:

This new DB library adds better hash algorithm and a bug fix for the classes eq method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19129_2009_igcd/igcd_framework/if_tincoverage.py

    r8091 r8160  
    2020 
    2121from ea_model.iso_19129_2009_igcd.igcd_framework.if_coveragedata import  IF_CoverageData  
    22 from ascore.utils import has_value 
     22from ascore.utils import has_value, collectionProofHash 
    2323 
    2424''' 
    25 Created on 16-Feb-2012 16:18:06 
     25Created on 13-Mar-2012 11:08:09 
    2626 
    2727@author: mnagni 
     
    4242        self._if_coveragedata = IF_CoverageData()        
    4343 
     44        self.domainExtent = [] 
    4445        self.interpolationType = None 
    45         self.domainExtent = [] 
     46        self.commonPointRule = None 
    4647        self.geometry = None 
    47         self.commonPointRule = None 
    4848        self.rangeType = None 
    4949        self.interpolationParametersType = None 
     
    5151 
    5252    def __key(self): 
    53         return (self.interpolationType, self.domainExtent, self.geometry, self.commonPointRule, self.rangeType, self.interpolationParametersType) 
     53        return (self.domainExtent, self.interpolationType, self.commonPointRule, self.geometry, self.rangeType, self.interpolationParametersType) 
    5454 
    5555    def __eq__(self, y): 
     56        if type(self) != type(y): 
     57            return False 
    5658        ''' 
    5759        Cannot compare classes which do not define a "__key" attribute  
     
    6264 
    6365    def __hash__(self): 
    64         return hash(self.__key()) 
     66        return collectionProofHash(self.__key()) 
Note: See TracChangeset for help on using the changeset viewer.