Skip to content

Commit

Permalink
Migrate highlighting to CM6.
Browse files Browse the repository at this point in the history
  • Loading branch information
HaudinFlorence committed Jun 30, 2023
1 parent 49873e7 commit 66c64a5
Show file tree
Hide file tree
Showing 16 changed files with 1,468 additions and 1,776 deletions.
38 changes: 38 additions & 0 deletions examples/example1/center.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "44a9ad96-674a-49e5-94ee-9d84f386ecbc",
"metadata": {},
"outputs": [],
"source": [
"\n",
"a = np.arange(15).reshape(3, 5)\n",
"b = np.arange(5)\n",
"c = a + b"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
File renamed without changes.
File renamed without changes.
39 changes: 39 additions & 0 deletions examples/example2/center.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "eabfe4e0-d646-4d09-95a4-09ee3d030db6",
"metadata": {},
"outputs": [],
"source": [
"from matplotlib import pyplot as plt\n",
"import numpy as np\n",
"x = np.arange(0, 2, 0.1)\n",
"y1 = np.exp(x)\n",
"plt.plot(x, y1, 'b')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
40 changes: 40 additions & 0 deletions examples/example2/left.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "2d47bfe2-d91d-4f72-9426-1885c4edb5a9",
"metadata": {},
"outputs": [],
"source": [
"from matplotlib import pyplot as plt\n",
"import numpy as np\n",
"x = np.linspace(0, 2, 10)\n",
"z = np.exp(x + 2)\n",
"plt.plot(x, z, 'c')\n",
"# this is an example"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
42 changes: 42 additions & 0 deletions examples/example2/right.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "ff160690-22c8-48f3-9b89-d78a8997baec",
"metadata": {},
"outputs": [],
"source": [
"from matplotlib import pyplot as plt\n",
"import numpy as np\n",
"x = np.arange(0, 2, 0.1)\n",
"y2 = np.exp(x)\n",
"plt.plot(x, y2, 'b')\n",
"y1 = y2\n",
"plt.plot(x, y1, 'g')\n",
"# this is easy"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
65 changes: 65 additions & 0 deletions examples/example3/center.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "9e423ee0-5ba3-4792-8b16-b20fe7a775e3",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd # programmers like shortening names for things, so they usually import pandas as \"pd\"\n",
"import altair as alt # again with the shortening of names\n",
"import requests # we use it for downloading the data so we don't have to save it on GitHub (too big!)\n",
"import zipfile # for de-compressing the files we download from the EPA"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "08e85e68-1722-4847-a13f-97c921829073",
"metadata": {},
"outputs": [],
"source": [
"# Download the data from the EPA website\n",
"data_file_urls = [\n",
" 'https://aqs.epa.gov/aqsweb/airdata/daily_88101_2020.zip',\n",
" 'https://aqs.epa.gov/aqsweb/airdata/daily_88101_2019.zip',\n",
"]\n",
"# copied this example from https://stackoverflow.com/questions/16694907/download-large-file-in-python-with-requests\n",
"for url in data_file_urls:\n",
" local_filename = \"data/{}\".format(url.split('/')[-1])\n",
" with requests.get(url, stream=True) as r:\n",
" r.raise_for_status()\n",
" with open(local_filename, 'wb') as f:\n",
" for chunk in r.iter_content(chunk_size=8192): \n",
" f.write(chunk)\n",
"# and unzip the files\n",
"files_to_unzip = [\"data/{}\".format(url.split('/')[-1]) for url in data_file_urls]\n",
"for f in files_to_unzip:\n",
" with zipfile.ZipFile(f,\"r\") as zip_ref:\n",
" zip_ref.extractall(\"data\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
67 changes: 67 additions & 0 deletions examples/example3/left.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "9e423ee0-5ba3-4792-8b16-b20fe7a775e3",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd # programmers like shortening names for things, so they usually import pandas as \"pd\"\n",
"import altair as alt # again with the shortening of names\n",
"import requests # we use it for downloading the data so we don't have to save it on GitHub (too big!)\n",
"import zipfile # for de-compressing the files we download from the EPA\n",
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "08e85e68-1722-4847-a13f-97c921829073",
"metadata": {},
"outputs": [],
"source": [
"# Download the data from the EPA website\n",
"data_file_urls = [\n",
" 'https://aqs.epa.gov/aqsweb/airdata/daily_88101_2020.zip',\n",
" 'https://aqs.epa.gov/aqsweb/airdata/daily_88101_2019.zip',\n",
" 'https://aqs.epa.gov/aqsweb/airdata/daily_88101_2018.zip'\n",
"]\n",
"# copied this example from https://stackoverflow.com/questions/16694907/download-large-file-in-python-with-requests\n",
"for url in data_file_urls:\n",
" local_filename = \"data/{}\".format(url.split('/')[-1])\n",
" with requests.get(url, stream=True) as r:\n",
" r.raise_for_status()\n",
" with open(local_filename, 'wb') as f:\n",
" for chunk in r.iter_content(chunk_size=8192): \n",
" f.write(chunk)\n",
"# and unzip the files\n",
"files_to_unzip = [\"data/{}\".format(url.split('/')[-1]) for url in data_file_urls]\n",
"for f in files_to_unzip:\n",
" with zipfile.ZipFile(f,\"r\") as zip_ref:\n",
" zip_ref.extractall(\"data\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
60 changes: 60 additions & 0 deletions examples/example3/right.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "9e423ee0-5ba3-4792-8b16-b20fe7a775e3",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd # programmers like shortening names for things, so they usually import pandas as \"pd\"\n",
"import superior as sup # again with the shortening of names\n",
"import requests # we use it for downloading the data so we don't have to save it on GitHub (too big!)\n",
"import tarfile # for de-compressing the files we download from the EPA"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "08e85e68-1722-4847-a13f-97c921829073",
"metadata": {},
"outputs": [],
"source": [
"# Download the data from the EPA website\n",
"data_file_urls = [\n",
" 'https://aqs.epa.gov/aqsweb/airdata/daily_88101_2017.zip',\n",
" 'https://aqs.epa.gov/aqsweb/airdata/daily_88101_2018.zip',\n",
"]\n",
"# copied this example from https://stackoverflow.com/questions/16694907/download-large-file-in-python-with-requests\n",
"for url in data_file_urls:\n",
" local_filename = \"data/{}\".format(url.split('/')[-1])\n",
" with requests.get(url, stream=True) as r:\n",
" r.raise_for_status()\n",
" with open(local_filename, 'r') as f:\n",
" for chunk in r.iter_content(chunk_size=8192): \n",
" f.write(chunk)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
17 changes: 9 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 66c64a5

Please sign in to comment.