Skip to content

Commit

Permalink
Keep on updating mergeview.ts and style.
Browse files Browse the repository at this point in the history
  • Loading branch information
HaudinFlorence committed Jun 30, 2023
1 parent d02f914 commit d4711df
Show file tree
Hide file tree
Showing 16 changed files with 1,147 additions and 1,818 deletions.
File renamed without changes.
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.

1 change: 1 addition & 0 deletions packages/nbdime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"dependencies": {
"@codemirror/state": "^6.2.0",
"@codemirror/view": "^6.9.6",
"@codemirror/lang-python": "^6.1.3",
"@jupyterlab/codeeditor": "^4.0.0",
"@jupyterlab/codemirror": "^4.0.0",
"@jupyterlab/coreutils": "^6.0.0",
Expand Down
Loading

0 comments on commit d4711df

Please sign in to comment.