Repository navigation
docs(notebooks): modernise symbolic.ipynb for the current API and make it fast to run - #857
Merged
Merged
Conversation
…e it fast to run Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… SymPy in the browser Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
petercorke
enabled auto-merge (squash)
October 19, 2026 08:41
Up to standards ✅🟢 Issues
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #857 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 146 146
Lines 16867 16867
=====================================
Misses 16867 16867 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notebook renovation,
symbolic.ipynb. It could not be run to the end against main (asimplifycell ran for minutes, one cell had a syntax error, andprint(puma)raised an error); it now runs end to end in about 25 s with no errors. No change to the toolbox. It needs #856 (print(robot)for a symbolic robot) to be merged first.What changed
Gravity.
puma.gravity = [0, 0, g]is now[0, 0, -g]: with the current conventiongravityis the acceleration due to gravity (default[0, 0, -9.81]).Timing. The symbolic inverse dynamics (
rne_python) now takes 0.14 s, not "10 minutes or more", and the prose says so. The sixsimplify(tau[j])cells are replaced by one fortau[5](1 s), and a note says how long the others take (measured here: 14 s fortau[3], 48 s fortau[4], over 150 s fortau[2]).tauis a NumPy object array, not a SymPy matrix as the prose said; the prose is corrected, and the gravity substitution (tau.subsdoes not exist on an array) is[t.subs(subsdict) for t in tau].The coefficient cells used the unexpanded
tau[0], so.coeff(...)returned empty tuples; they now use the expandedtau_0, and the squared velocity term istau_0.coeff(qd[0], 2). One of them was a code line in a markdown cell, now a code cell.The threshold for the significant terms is 1e-2 and not 1e-6: with 1e-6, 5470 of the 5533 terms survive, and 1e-2 leaves 25%, which is what the prose says.
A cell with a syntax error (an unfinished
subsdictloop) is completed, and empty cells are removed.The standard generated first cell (docs(notebooks): a standard generated first cell, and a shorter bootstrap cell #850) with the modernised note.
It now asks for the
ikextra in its metadata (rtb_bootstrap.extras), so that the bootstrap installs SymPy in the browser. Its oldpiplitecell did not install SymPy, so it probably never worked in JupyterLite.Executed headless against the code of #856 (0 error cells, 25 s). Not tried in a browser. Written with AI assistance (Claude Code).
🤖 Generated with Claude Code