Registry / testing / ipython-autotime

ipython-autotime

JSON →
library0.3.2pypypiunverified

An IPython extension that automatically measures and displays the execution time of every cell. Requires IPython/Jupyter. Version 0.3.2; last release 2024. Minimal and stable.

pip install ipython-autotime
INSTALL
IMPORT
SIG · IPYTHON-AUTOTIME
I
ipython-autotime
testingpythonv0.3.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Load the extension in IPython or Jupyter notebook. It will start timing all cells.

%load_ext autotime # After loading, every cell shows execution time automatically
Debug
Known issues
gotchaRunning '%load_ext autotime' in a terminal that doesn't support IPython will fail with ImportError or ModuleNotFoundError.
fix
Ensure you are using IPython, Jupyter notebook, or JupyterLab. Do not run in plain Python interpreter.
affects: all
gotchaTiming includes the time to import modules and run setup inside the cell, not just the main computation.
fix
If you need to exclude import overhead, move imports outside the timed cell.
affects: all
gotchaautotime uses time.perf_counter or monotonic clock; wall time may vary due to system load.
fix
For reproducible benchmarks, use %timeit or timeit module instead.
affects: all
deprecatedVersions before 0.3.0 did not show the 'started' timestamp. If you rely on old output format, format changed.
fix
Update to 0.3.0+ or parse the new output format.
affects: < 0.3.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'autotime'
Trying to import autotime as a Python module directly, or running outside IPython.
fix
Run 'pip install ipython-autotime' and then use '%load_ext autotime' inside IPython/Jupyter.
UsageError: Line magic function `%autotime` not found.
Forgot to load the extension first, or extension not installed correctly.
fix
First run '%load_ext autotime', then '%autotime' can be used (though usually you just load it).
TypeError: enable_autotime() got an unexpected keyword argument 'started'
Using an older version of ipython-autotime that doesn't support the 'started' argument.
fix
Update to the latest version: 'pip install --upgrade ipython-autotime'
Upgrade
Version history
0.3.2latest on PyPI · released Nov 1, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
ipython-autotime — pip install ipython-autotime · libregistry