Changeset 87 for python/nmtools.py


Ignore:
Timestamp:
02/05/09 20:28:35 (7 years ago)
Author:
mmckerns
Message:

added tools.wrap_bounds; added range bounds to fmin (modified from park.simplex)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/nmtools.py

    r82 r87  
    1616         sim = inst.population 
    1717         fsim = inst.popEnergy 
    18          return (max(numpy.ravel(abs(sim[1:]-sim[0]))) <= xtol \ 
    19                 and max(abs(fsim[0]-fsim[1:])) <= ftol) 
     18         #FIXME: abs(inf - inf) will raise a warning... 
     19         errdict = numpy.seterr(invalid='ignore') #FIXME: turn off warning  
     20         answer = (max(numpy.ravel(abs(sim[1:]-sim[0]))) <= xtol \ 
     21                  and max(abs(fsim[0]-fsim[1:])) <= ftol) 
     22         numpy.seterr(invalid=errdict['invalid']) #FIXME: turn on warnings 
     23         return answer 
    2024    return _ 
    2125 
Note: See TracChangeset for help on using the changeset viewer.