Skip to content

Commit

Permalink
change snippet code
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoMF committed Aug 3, 2023
1 parent 1e048dc commit 2c65fca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
9 changes: 3 additions & 6 deletions tests/1_example_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@
"metadata": {},
"outputs": [],
"source": [
"# %load tp1/generated/example_snippet_example\n",
"import pinocchio as pin\n",
"\n",
"oma = pin.SE3.Random()\n",
"omb = pin.SE3.Random()\n",
"amb = oma.inverse() * omb\n"
"def hypotenuse(a, b):\n",
" \"\"\"Return hypotenuse of triangle.\"\"\"\n",
" return (a**2 + b**2) ** 0.5\n"
]
},
{
Expand Down
9 changes: 5 additions & 4 deletions tests/tp1/example_script.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""Little example program."""


# %jupyter_snippet example_snippet
import pinocchio as pin
def hypotenuse(a, b):
"""Return hypotenuse of triangle."""
return (a**2 + b**2) ** 0.5


oma = pin.SE3.Random()
omb = pin.SE3.Random()
amb = oma.inverse() * omb
# %end_jupyter_snippet
8 changes: 3 additions & 5 deletions tests/tp1/generated/example_script_example_snippet
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import pinocchio as pin

oma = pin.SE3.Random()
omb = pin.SE3.Random()
amb = oma.inverse() * omb
def hypotenuse(a, b):
"""Return hypotenuse of triangle."""
return (a**2 + b**2) ** 0.5

0 comments on commit 2c65fca

Please sign in to comment.