Jupyter widget and CLI that trace Python expression evaluation step by step (the %%steps cell magic and the print-steps command)
Project description
steps-widget
Jupyter widget and CLI that trace Python expression evaluation step by step.
%%steps-- a cell magic (registered byimport steps_widget) that renders the substitution/reduction trace of any# PRINT STEPS-tagged statement as a widget below the cell.print-steps-- the command-line equivalent:print-steps student_script.pyprints the same trace to stderr for every tagged line in a script.
Tag convention: append # PRINT STEPS (or #PRINT-STEPS, # printsteps, ... --
see steps_widget.print_steps._COMMENT_TAGS for every recognized spelling) to a
statement to have it evaluated one operation at a time instead of all at once.
import steps_widget
%%steps
x = 7
y = 5
z = x * y + 4 # PRINT STEPS
Requires Python 3.9 or 3.10 -- the stepper dispatches on CPython bytecode opcode names that Python 3.11 restructured.
pip install steps-widget
# or
conda install -c munch-group steps-widget
See the docs for more.
Initial set up
pixi run init
Get updates to upstream fork
Add upstream if not already added
git remote add upstream https://github.com/munch-group/steps-widget.git
Fetch upstream changes
git fetch upstream
Either rebase your changes on top of upstream (cleaner history)
git rebase upstream/main
Or, merge upstream into your fork (preserves history)
git merge upstream/main
If you want to see what's changed upstream before applying:
git log HEAD..upstream/main
See the actual diff
git diff HEAD...upstream/main
Then push your updated fork:
git push origin main
If you rebased and need to force push
git push origin main --force-with-lease
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file steps_widget-0.1.18.tar.gz.
File metadata
- Download URL: steps_widget-0.1.18.tar.gz
- Upload date:
- Size: 393.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6e4c79c45fac568bd3db4cf362b299c3b34a87a42bc3cac69b77890552eaea1
|
|
| MD5 |
32066ba431006e155f3e8e3ade6c6110
|
|
| BLAKE2b-256 |
2487543223aab9a05dd94a9db2aca8db7021940686d20aa0dc766e4084c3027f
|
File details
Details for the file steps_widget-0.1.18-py3-none-any.whl.
File metadata
- Download URL: steps_widget-0.1.18-py3-none-any.whl
- Upload date:
- Size: 25.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97c2381f86a45a7f3a9cb62a358924718ad7f3748de0f42713b88b309aca47cd
|
|
| MD5 |
f64ce8434dd7846f6de3421f339e441f
|
|
| BLAKE2b-256 |
89a319aa2022aacaea4a65de532fa4d1ae1ffc6a545d0f83bcd07595aa3980bb
|