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 ef6f283
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ jobs:
run: pipx install black
- name: Install ruff
run: pipx install ruff
- name: Install jupyter
run: pipx install jupyter
- name: check with gepetuto
run: cd tests && gepetuto -vva all
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 ef6f283

Please sign in to comment.