Skip to content

Commit

Permalink
Add watermark module
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrepo committed Sep 21, 2023
1 parent 77c0ad7 commit 542eac9
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 6 deletions.
4 changes: 4 additions & 0 deletions binder/environment.yml
Expand Up @@ -18,5 +18,9 @@ dependencies:
- r-irkernel
- r-base>=4.0
- r-tidyverse
# For DUO example with DESeq2
- bioconductor-deseq2
- bioconductor-parathyroidse
- pip:
- bash_kernel
- watermark
28 changes: 27 additions & 1 deletion notebooks/intro_Python.ipynb
Expand Up @@ -223,6 +223,32 @@
"<h1>Jupyter notebooks can render HTML</h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"\n",
"## Bonne pratique\n",
"\n",
"Une bonne pratique pour améliorer la reproductibilité d'un notebook est d'afficher à la fin (ou au début) du notebook la liste des bibliothèques utilisées ainsi que la version de Python.\n",
"\n",
"Le module `watermark` permet de faire cela automatiquement."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%load_ext watermark\n",
"%watermark --python --machine\n",
"%watermark --packages jupyterlab --iversions --watermark"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -257,7 +283,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down
41 changes: 36 additions & 5 deletions notebooks/matplotlib.ipynb
Expand Up @@ -2,7 +2,9 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"tags": []
},
"source": [
"# Introduction à la bibliothèque Matplotlib\n",
"\n",
Expand Down Expand Up @@ -166,7 +168,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Diagramme en bâtons"
"## Diagramme en bâtons"
]
},
{
Expand Down Expand Up @@ -329,6 +331,28 @@
"</details>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Enregistrement des versions des bibliothèques utilisées\n",
"\n",
"Pour améliorer la reproductibilité du notebook, on liste les bibliothèques utilisées ainsi que la version de Python."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%load_ext watermark\n",
"%watermark --python --machine\n",
"%watermark --packages jupyterlab --iversions --watermark"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -343,7 +367,7 @@
"\n",
"![](black-hole.png)\n",
"\n",
"[NumFOCUS tools help create the first ever image of a black hole](https://numfocus.org/case-studies/first-photograph-black-hole)\n",
"Source : [NumFOCUS tools help create the first ever image of a black hole](https://numfocus.org/case-studies/first-photograph-black-hole)\n",
"\n",
"Voici quelques ressources supplémentaires si vous souhaitez approfondir ces possibilités :\n",
"\n",
Expand All @@ -352,11 +376,18 @@
"\n",
"Enfin, d'autres modules comme [seaborn](https://seaborn.pydata.org/), [Bokeh](https://bokeh.pydata.org/en/latest/) ou [plotly](https://plot.ly/) permettent de générer des graphiques plus élégants ou interactifs."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -370,7 +401,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 542eac9

Please sign in to comment.