-
Notifications
You must be signed in to change notification settings - Fork 339
refactor: use nbsphinx as the default execution lib #1482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
6f1d4dc
refactor: use nbsphinx as the default execution lib
12rambau 80b5cfe
add nbstripout to the pre-commits'
12rambau a40f715
add pandoc to the readthedocs deps
12rambau a4964f2
refactor: clean the notebook
12rambau 36096f6
move the example to the correct folder
12rambau 8979c42
fix: solve link issue
12rambau 4b8f438
install pandoc in the test environment
12rambau e54dbb8
fix: display of large table in executed cells
12rambau 4beba60
avoid Userwarnings from matplotlib
12rambau 9f7fe26
hide the matplotlib wrning management cell
12rambau 0d0f5cf
Update readthedocs.yml
12rambau 85fb2eb
build: use pandoc_binary to install pandoc
12rambau cbfa8a6
Merge branch 'nbsphinx' of https://github.com/12rambau/pydata-sphinx-…
12rambau 46b1a76
docs: add reference to pandoc in the setup
12rambau e530ea6
update docs
gabalafou 5a07e18
remove pypandoc_binary
gabalafou e5599fd
Update pyproject.toml
12rambau 534c7b7
Merge pull request #11 from gabalafou/nbsphinx
12rambau 60aaae4
ci: use back setup-pandoc
12rambau 8014161
Trigger CI build
12rambau 2e5caac
Merge branch 'nbsphinx' of https://github.com/12rambau/pydata-sphinx-…
12rambau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# PyData Library Styles\n", | ||
"\n", | ||
"This theme has built-in support and special styling for several major visualization libraries in the PyData ecosystem.\n", | ||
"This ensures that the images and output generated by these libraries looks good for both light and dark modes.\n", | ||
"Below are examples of each that we use as a benchmark for reference.\n", | ||
"\n", | ||
"## Pandas" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import string\n", | ||
"\n", | ||
"import numpy as np\n", | ||
"import pandas as pd\n", | ||
"\n", | ||
"rng = np.random.default_rng()\n", | ||
"data = rng.standard_normal((100, 26))\n", | ||
"df = pd.DataFrame(data, columns=list(string.ascii_lowercase))\n", | ||
"df" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Matplotlib" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"nbsphinx": "hidden" | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import matplotlib\n", | ||
"\n", | ||
"# avoid warnings upon doc build\n", | ||
"matplotlib.set_loglevel(\"critical\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import matplotlib.pyplot as plt\n", | ||
"\n", | ||
"fig, ax = plt.subplots()\n", | ||
"ax.scatter(df[\"a\"], df[\"b\"], c=df[\"b\"], s=3)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import matplotlib.pyplot as plt\n", | ||
"import numpy as np\n", | ||
"\n", | ||
"matplotlib.set_loglevel(\"critical\")\n", | ||
"\n", | ||
"rng = np.random.default_rng()\n", | ||
"data = rng.standard_normal((3, 100))\n", | ||
"fig, ax = plt.subplots()\n", | ||
"ax.scatter(data[0], data[1], c=data[2], s=3)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Plotly\n", | ||
"\n", | ||
"The HTML below shouldn't display, but it uses RequireJS to make sure that all\n", | ||
"works as expected. If the widgets don't show up, RequireJS may be broken." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import plotly.io as pio\n", | ||
"import plotly.express as px\n", | ||
"import plotly.offline as py\n", | ||
"\n", | ||
"pio.renderers.default = \"notebook\"\n", | ||
"\n", | ||
"df = px.data.iris()\n", | ||
"fig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\", color=\"species\", size=\"sepal_length\")\n", | ||
"fig" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Xarray\n", | ||
"\n", | ||
"Here we demonstrate `xarray` to ensure that it shows up properly." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import xarray as xr\n", | ||
"data = xr.DataArray(\n", | ||
" np.random.randn(2, 3),\n", | ||
" dims=(\"x\", \"y\"),\n", | ||
" coords={\"x\": [10, 20]}, attrs={\"foo\": \"bar\"}\n", | ||
" )\n", | ||
"data" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## ipyleaflet\n", | ||
"\n", | ||
"`ipyleaflet` is a **Jupyter**/**Leaflet** bridge enabling interactive maps in the Jupyter notebook environment. this demonstrate how you can integrate maps in your documentation." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from ipyleaflet import Map, basemaps\n", | ||
"\n", | ||
"# display a map centered on France\n", | ||
"m = Map(basemap=basemaps.Esri.WorldImagery, zoom=5, center=[46.21, 2.21])\n", | ||
"m" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"name": "python", | ||
"version": "3.10.8" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.