Skip to content

Commit

Permalink
chore: clean docs notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-gy committed Nov 17, 2024
1 parent 8646afa commit 2cff3da
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 167 deletions.
12 changes: 0 additions & 12 deletions docs/api/draco.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -219,18 +219,6 @@
"source": [
"d.get_violations(invalid_spec)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a39a62c1",
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
22 changes: 9 additions & 13 deletions docs/api/facts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@
"outputs": [
{
"data": {
"text/plain": "['attribute(mark,root,bar).',\n 'entity(encoding,root,0).',\n 'attribute((encoding,channel),0,x).',\n 'attribute((encoding,field),0,condition).',\n 'entity(encoding,root,1).',\n 'attribute((encoding,channel),1,y).',\n 'attribute((encoding,aggregate),1,count).']"
"text/plain": [
"['attribute(mark,root,bar).',\n",
" 'entity(encoding,root,0).',\n",
" 'attribute((encoding,channel),0,x).',\n",
" 'attribute((encoding,field),0,condition).',\n",
" 'entity(encoding,root,1).',\n",
" 'attribute((encoding,channel),1,y).',\n",
" 'attribute((encoding,aggregate),1,count).']"
]
},
"execution_count": 5,
"metadata": {},
Expand Down Expand Up @@ -120,18 +128,6 @@
" print(answer_set)\n",
" pprint(answer_set_to_dict(answer_set))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "10185d26023b46108eb7d9f57d49d2b3",
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
12 changes: 0 additions & 12 deletions docs/api/run.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,6 @@
" print(model.answer_set[0])\n",
" print(model.answer_set[1])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "toxic-silicon",
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
46 changes: 3 additions & 43 deletions docs/applications/debug_draco.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,6 @@
"# Draco Debugging"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"ExecuteTime": {
"end_time": "2023-07-25T15:03:35.145025Z",
"start_time": "2023-07-25T15:03:32.637995Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.3.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.0\u001b[0m\n",
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"%pip install -q toml ipywidgets"
]
},
{
"cell_type": "code",
"execution_count": 2,
Expand Down Expand Up @@ -465,7 +436,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2023-07-25T15:03:36.386746Z",
Expand All @@ -474,17 +445,11 @@
},
"outputs": [],
"source": [
"import warnings\n",
"\n",
"from IPython.display import display\n",
"from vega_datasets import data\n",
"\n",
"from draco.renderer import AltairRenderer\n",
"\n",
"# Suppressing warnings raised by altair in the background\n",
"# (iteration-related deprecation warnings)\n",
"warnings.filterwarnings(\"ignore\")\n",
"\n",
"# Setting up renderer and demo data\n",
"renderer = AltairRenderer()\n",
"weather_data = data.seattle_weather()\n",
Expand Down Expand Up @@ -1983,7 +1948,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": ".venv",
"language": "python",
"name": "python3"
},
Expand All @@ -1997,12 +1962,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.0"
},
"vscode": {
"interpreter": {
"hash": "ad2bdc8ecc057115af97d19610ffacc2b4e99fae6737bb82f5d7fb13d2f2c186"
}
"version": "3.12.7"
}
},
"nbformat": 4,
Expand Down
20 changes: 0 additions & 20 deletions docs/applications/design_space_exploration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,6 @@
"of recommendations, and we will investigate the produced designs using the debugger module."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "e010c7ae-4d1f-4783-9b83-9f5414f392de",
"metadata": {
"ExecuteTime": {
"end_time": "2023-08-04T07:31:46.736324Z",
"start_time": "2023-08-04T07:31:46.627931Z"
},
"tags": []
},
"outputs": [],
"source": [
"# Suppressing warnings raised by altair in the background\n",
"# (iteration-related deprecation warnings)\n",
"import warnings\n",
"\n",
"warnings.filterwarnings(\"ignore\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
Expand Down
21 changes: 2 additions & 19 deletions docs/applications/draco1_vs_draco2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,6 @@
"We'll be installing a forked version of _Draco 1_, specifically named `draco1`. This is to prevent any conflicts with the currently installed `draco` package, which refers to _Draco 2_ (i.e., this repository). It's important to note that the `draco1` fork doesn't modify the original functionality of Draco 1 - it's simply a renaming of the package. This way, we can clearly distinguish between the two versions of Draco for our comparison and we can interact with them within the same notebook."
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "267359fa-ca9f-4387-849c-08dabbb45a3c",
"metadata": {
"ExecuteTime": {
"end_time": "2023-07-30T15:57:47.788023Z",
"start_time": "2023-07-30T15:57:40.546816Z"
}
},
"outputs": [],
"source": [
"# Installing `clyngor` prior to `draco1`, as it is a build requirement\n",
"!pip -qq install --upgrade pip && pip -qq install clyngor\n",
"!pip install -qq 'git+https://github.com/peter-gy/draco.git@named-to-draco1#draco1'"
]
},
{
"cell_type": "code",
"execution_count": 3,
Expand Down Expand Up @@ -1927,7 +1910,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": ".venv",
"language": "python",
"name": "python3"
},
Expand All @@ -1941,7 +1924,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.12.7"
}
},
"nbformat": 4,
Expand Down
132 changes: 121 additions & 11 deletions docs/applications/recommendation.ipynb

Large diffs are not rendered by default.

18 changes: 0 additions & 18 deletions docs/applications/renderer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,6 @@
"In what follows, we provide examples for both specification formats using a very simple dataset."
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
"# Suppressing warnings raised by altair in the background\n",
"# (iteration-related deprecation warnings)\n",
"import warnings\n",
"\n",
"warnings.filterwarnings(\"ignore\")"
]
},
{
"cell_type": "code",
"execution_count": 22,
Expand Down
19 changes: 0 additions & 19 deletions docs/facts/examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,6 @@
"Draco's specification of visualizations (i.e. charts) support single view and multi view charts. The specification is inspired by [Vega-Lite](https://vega.github.io/vega-lite/)."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "250c30ea",
"metadata": {
"ExecuteTime": {
"end_time": "2023-04-10T11:39:10.621334Z",
"start_time": "2023-04-10T11:39:09.614980Z"
}
},
"outputs": [],
"source": [
"# Suppressing warnings raised by altair in the background\n",
"# (iteration-related deprecation warnings)\n",
"import warnings\n",
"\n",
"warnings.filterwarnings(\"ignore\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
Expand Down

0 comments on commit 2cff3da

Please sign in to comment.