Changeset 720

Show
Ignore:
Timestamp:
03/02/10 11:37:54 (2 years ago)
Author:
apdavison
Message:

Fixed an amazingly stupid bug when using the set() function to set a parameter to zero. I can't believe this bug has been around this long. Thanks to Lyle Muller for pointing this out.

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/common.py

    r713 r720  
    365365    giving the parameter name, in which case val is the parameter value. 
    366366    """ 
    367     if val: 
     367    if val is not None: 
    368368        param = {param:val} 
    369369    if not hasattr(cells, '__len__'): 
  • trunk/test/unittests/generictests.py

    r711 r720  
    313313        # an IF_curr_exp, it is not a valid parameter to be changed later. 
    314314        self.assertRaises(errors.NonExistentParameterError, sim.set, self.cells, 'syn_shape', 'alpha') 
     315 
     316    def testSetZero(self): 
     317        sim.set(self.cells, 'v_thresh', 0.0) 
    315318     
    316319# ==============================================================================