[IPython-dev] Fwd: [patch] timeit unit select breaks with >= 1000second duration

David Warde-Farley dwf@cs.toronto....
Wed Aug 5 16:38:38 CDT 2009


Hey guys,

I submitted this a while back, but I see there's a lot more activity  
on ipython-dev lately (congrats on 0.10, everyone!) so I'll try  
again. :)

David

Begin forwarded message:

> From: David Warde-Farley <dwf@cs.toronto.edu>
> Date: July 4, 2009 5:48:23 PM GMT-04:00
> To: ipython-dev@scipy.org
> Subject: [IPython-dev] [patch] timeit unit select breaks with >=  
> 1000second duration
> Delivery-Date: Sat, 04 Jul 2009 17:48:40 -0400
>
> This is a minor concern since I don't know how many people use  
> timeit for things that take more than a few seconds but I noticed  
> that if you have a function that runs for say, 1000 seconds, the  
> code in Magic.py fails since 'order' gets a negative number. Thus  
> you get something like 1.0e12 nanoseconds being printed, which is  
> kind of silly.
>
> Attached is a patch that fixes it in the simplest way possible: if  
> best is >= 1000 then just use seconds, e.g.
>
> In [16]: %timeit -n 1 -r 1 time.sleep(1000)
> 1 loops, best of 1: 1e+03 s per loop
>
> Regards,
>
> David
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: duration-patch.diff
Type: application/octet-stream
Size: 528 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/ipython-dev/attachments/20090805/ab037c20/attachment.obj 
-------------- next part --------------
>
>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev



More information about the IPython-dev mailing list