[Numpy-discussion] Release blockers for 1.4.0 ?

Pierre GM pgmdevlist@gmail....
Tue Dec 8 15:47:39 CST 2009


On Dec 8, 2009, at 4:36 PM, Robert Kern wrote:
>> 
>>        err_status_ini = np.geterr()
>>        np.seterr(divide='ignore', invalid='ignore')
>>        result = self.f(da, db, *args, **kwargs)
>>        np.seterr(**err_status_ini)
>> 
>> Is this kind of fix acceptable ?
> 
>  olderr = np.seterr(divide='ignore', invalid='ignore')
>  try:
>    result = self.f(da, db, *args, **kwargs)
>  finally:
>    np.seterr(**olderr)

Neat ! I didn't know about np.seterr returning the old settings.
 Thanks a million Robert.



More information about the NumPy-Discussion mailing list