-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update %timeit documentation: replace best time with average time (#1…
…4141) This PR addresses outdated documentation for the `%timeit` magic command. As of version 6.0.0rc1, `%timeit` measures the average time instead of the best time. - Related PR at the time: #9984 However, the documentation still reflects the old behavior. ### 1. Description of the `-r` option The current documentation states the following: https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-timeit > -r<R>: number of repeats <R>, each consisting of <N> loops, and take the best result. Default: 7 This seems to be the correct `average result`. The actual code calculates the average: https://github.com/ipython/ipython/blob/f49a797f1488a3f54a0030de12d92393f878f335/IPython/core/magics/execution.py#L112-L119 ### 2. The format of the `%timeit` results in the sample code for `%alias_magic` is outdated. Current documentation: https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-alias_magic > In [2]: %t -n1 pass > 1 loops, best of 3: 954 ns per loop Actual result: > 107 ns ± 43.6 ns per loop (mean ± std. dev. of 7 runs, 1 loop each) The following pages also have outdated notation: - Overview: https://ipython.readthedocs.io/en/stable/overview.html#main-features-of-the-interactive-shell - Introducing Tutorial: https://ipython.readthedocs.io/en/stable/interactive/tutorial.html#magic-functions - IPython reference: https://ipython.readthedocs.io/en/stable/interactive/reference.html#magic-command-system - Python vs IPython: https://ipython.readthedocs.io/en/stable/interactive/python-ipython-diff.html#magics
- Loading branch information
Showing
6 changed files
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters