Skip to content

Commit

Permalink
Removed width from spider5 and 6, hope this fixes the problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
tBuLi committed Dec 5, 2024
1 parent c00cbc6 commit 837bf8e
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 44 deletions.
4 changes: 3 additions & 1 deletion content/exercises/solution_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ def graph_func():
alg.graph(
graph_func,
grid=True, labels=True, lineWidth=4, pointRadius=4, animate=True,
width='100%'
)
''',
}
Expand Down Expand Up @@ -290,6 +289,9 @@ class SolutionWidget(anywidget.AnyWidget):
solution = traitlets.Unicode().tag(sync=True)
show = traitlets.Bool(0).tag(sync=True)

def __repr__(self):
return f"{self.__class__.__name__}()"

def __init__(self, exercise: str, *args, **kwargs):
super().__init__(*args, solution=SOLUTIONS[exercise], **kwargs)

6 changes: 3 additions & 3 deletions content/exercises/spider1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "84ad727a4d6b4daab53c893ade37c66a",
"model_id": "75cb73d089d14173bf63eb67aa902b6f",
"version_major": 2,
"version_minor": 1
},
Expand Down Expand Up @@ -260,12 +260,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "400975b3d14b4acf84d7ceb5dc4c6c1e",
"model_id": "52f71cc25fd64825ba3d4361a56daacc",
"version_major": 2,
"version_minor": 1
},
"text/plain": [
"SolutionWidget(solution='\\n# solution 1\\npoint2 = alg.vector(e0=1, e1=-1, e2=-0.5).dual()\\n\\ndef graph_func():…"
"SolutionWidget()"
]
},
"execution_count": 6,
Expand Down
6 changes: 3 additions & 3 deletions content/exercises/spider2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "261e4e083b3f41bfb5e716c95ebafbff",
"model_id": "c2f459c011a74df4927610bd1f6b5008",
"version_major": 2,
"version_minor": 1
},
Expand Down Expand Up @@ -292,12 +292,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "61368007bb8a4e66bdc69ff7c29bad05",
"model_id": "e81be1e388d74e0d89c4454b88c8f16b",
"version_major": 2,
"version_minor": 1
},
"text/plain": [
"SolutionWidget(solution='\\ndef sw(R, items):\\n return [R >> item for item in items]\\n\\ndef graph_func():\\n …"
"SolutionWidget()"
]
},
"execution_count": 7,
Expand Down
6 changes: 3 additions & 3 deletions content/exercises/spider3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "0690bdf5b45e400483ca96cc5a1d772c",
"model_id": "8510229f1ee941ba8b9c78e3161954c1",
"version_major": 2,
"version_minor": 1
},
Expand Down Expand Up @@ -302,12 +302,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a1dbdd8a608049ada7cf01346e3756e2",
"model_id": "009e32f2cbe64885a0ce7574269b4777",
"version_major": 2,
"version_minor": 1
},
"text/plain": [
"SolutionWidget(solution='\\ndef sw(R, items):\\n \"\"\" Sandwich all items by R. \"\"\"\\n return [R >> item for …"
"SolutionWidget()"
]
},
"execution_count": 7,
Expand Down
6 changes: 3 additions & 3 deletions content/exercises/spider4.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9d9f56a631ce40978fb705f5d5828a1e",
"model_id": "365ee7b518e544c79021de9bc6c1a65b",
"version_major": 2,
"version_minor": 1
},
Expand Down Expand Up @@ -306,12 +306,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9d04a600430a438ea32879ab29bbe675",
"model_id": "0653acab57ba45eaa04c2c2fd2ea0440",
"version_major": 2,
"version_minor": 1
},
"text/plain": [
"SolutionWidget(solution='\\ndef inverse_kinematics(C, Base, Target) -> None:\\n \"\"\"Our IK function takes a ch…"
"SolutionWidget()"
]
},
"execution_count": 7,
Expand Down
35 changes: 19 additions & 16 deletions content/exercises/spider5.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"id": "initial_id",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-04T13:57:32.510231Z",
"start_time": "2024-12-04T13:57:29.428063Z"
"end_time": "2024-12-05T14:01:33.741761Z",
"start_time": "2024-12-05T14:01:30.765612Z"
},
"editable": true,
"slideshow": {
Expand Down Expand Up @@ -62,8 +62,8 @@
"id": "bb9ed0b8487c91bf",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-04T13:57:34.488628Z",
"start_time": "2024-12-04T13:57:33.496171Z"
"end_time": "2024-12-05T14:01:35.443970Z",
"start_time": "2024-12-05T14:01:33.857464Z"
},
"editable": true,
"slideshow": {
Expand Down Expand Up @@ -98,8 +98,8 @@
"id": "c658b3b9c4ea0436",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-04T13:57:34.691495Z",
"start_time": "2024-12-04T13:57:34.679919Z"
"end_time": "2024-12-05T14:01:36.407047Z",
"start_time": "2024-12-05T14:01:36.394267Z"
},
"editable": true,
"slideshow": {
Expand Down Expand Up @@ -136,8 +136,8 @@
"id": "850ed686828490bf",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-04T13:57:34.753036Z",
"start_time": "2024-12-04T13:57:34.726453Z"
"end_time": "2024-12-05T14:01:36.469895Z",
"start_time": "2024-12-05T14:01:36.444698Z"
},
"editable": true,
"slideshow": {
Expand Down Expand Up @@ -171,8 +171,8 @@
"id": "4267d62dac9b4cb9",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-04T13:57:34.782907Z",
"start_time": "2024-12-04T13:57:34.770190Z"
"end_time": "2024-12-05T14:01:36.547152Z",
"start_time": "2024-12-05T14:01:36.533969Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -211,8 +211,8 @@
"id": "13200375746194b",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-04T13:57:34.924328Z",
"start_time": "2024-12-04T13:57:34.800113Z"
"end_time": "2024-12-05T14:01:36.672575Z",
"start_time": "2024-12-05T14:01:36.559211Z"
},
"editable": true,
"slideshow": {
Expand All @@ -224,7 +224,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "93e419f1a8a04173974bc4f3ca2081ad",
"model_id": "4cbbe86e49444b9a8ad5582538db3833",
"version_major": 2,
"version_minor": 1
},
Expand Down Expand Up @@ -252,7 +252,6 @@
"alg.graph(\n",
" graph_func,\n",
" grid=True, labels=True, lineWidth=4,\n",
" width='100%'\n",
")"
]
},
Expand Down Expand Up @@ -303,6 +302,10 @@
"execution_count": 7,
"id": "a06ff8aa-e192-4181-85dd-7f4e4fe0567a",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-05T14:01:36.720014Z",
"start_time": "2024-12-05T14:01:36.697140Z"
},
"jupyter": {
"source_hidden": true
}
Expand All @@ -311,12 +314,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "8ebaea12eddd49f39f1a023a4f28593c",
"model_id": "2b271ad4019f4703932c9a73f8f384a0",
"version_major": 2,
"version_minor": 1
},
"text/plain": [
"SolutionWidget(solution='\\ndef inverse_kinematics(C, Base, Target) -> None:\\n \"\"\"Our IK function takes a ch…"
"SolutionWidget()"
]
},
"execution_count": 7,
Expand Down
25 changes: 10 additions & 15 deletions content/exercises/spider6.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
"execution_count": 1,
"id": "initial_id",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-04T11:28:33.637419Z",
"start_time": "2024-12-04T11:28:31.996378Z"
},
"editable": true,
"slideshow": {
"slide_type": ""
Expand Down Expand Up @@ -62,7 +58,7 @@
"id": "bb9ed0b8487c91bf",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-04T11:28:34.383606Z",
"end_time": "2024-12-05T14:02:01.772578100Z",
"start_time": "2024-12-04T11:28:33.859794Z"
},
"editable": true,
Expand Down Expand Up @@ -98,7 +94,7 @@
"id": "c658b3b9c4ea0436",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-04T11:28:34.630818Z",
"end_time": "2024-12-05T14:02:01.775578600Z",
"start_time": "2024-12-04T11:28:34.620266Z"
},
"editable": true,
Expand Down Expand Up @@ -136,7 +132,7 @@
"id": "850ed686828490bf",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-04T11:28:34.677667Z",
"end_time": "2024-12-05T14:02:01.776085200Z",
"start_time": "2024-12-04T11:28:34.666965Z"
},
"editable": true,
Expand Down Expand Up @@ -181,7 +177,7 @@
"id": "4267d62dac9b4cb9",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-04T11:28:34.709289Z",
"end_time": "2024-12-05T14:02:01.777094700Z",
"start_time": "2024-12-04T11:28:34.696715Z"
}
},
Expand Down Expand Up @@ -232,7 +228,7 @@
"id": "72785fd3399ce086",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-04T11:28:34.741089Z",
"end_time": "2024-12-05T14:02:01.777094700Z",
"start_time": "2024-12-04T11:28:34.729835Z"
}
},
Expand Down Expand Up @@ -266,7 +262,7 @@
"id": "51ab3f95fe687d45",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-04T11:28:34.772792Z",
"end_time": "2024-12-05T14:02:01.779118300Z",
"start_time": "2024-12-04T11:28:34.762134Z"
}
},
Expand Down Expand Up @@ -296,7 +292,7 @@
"id": "13200375746194b",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-04T11:28:34.900061Z",
"end_time": "2024-12-05T14:02:01.780118Z",
"start_time": "2024-12-04T11:28:34.792848Z"
},
"editable": true,
Expand All @@ -309,7 +305,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c63877bb7eda40d8baa506079082aa7d",
"model_id": "ace2d0f7945f48b58e8fe245a17c5540",
"version_major": 2,
"version_minor": 1
},
Expand Down Expand Up @@ -355,7 +351,6 @@
"alg.graph(\n",
" graph_func,\n",
" grid=True, labels=True, lineWidth=4, pointRadius=4, animate=True,\n",
" width='100%'\n",
")"
]
},
Expand Down Expand Up @@ -421,12 +416,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "85259885eb2a46b1bbd377c5a824ba9e",
"model_id": "41df244afac241a882399ea2d95dba8c",
"version_major": 2,
"version_minor": 1
},
"text/plain": [
"SolutionWidget(solution='\\nimport itertools\\n\\nAXIS = alg.blades.e2 | alg.vector(e0=1, e1=1.3, e2=0, e3=0).dua…"
"SolutionWidget()"
]
},
"execution_count": 9,
Expand Down

0 comments on commit 837bf8e

Please sign in to comment.