diff --git a/module2/ressources/jupyter.org b/module2/ressources/jupyter.org index 15c7b1100c62da78641cc56bb0270c7064826787..75eb47363f9dcb1b7783b96e2bd533cbd08e1ea5 100644 --- a/module2/ressources/jupyter.org +++ b/module2/ressources/jupyter.org @@ -7,22 +7,22 @@ #+PROPERTY: header-args :eval never-export * Table of Contents :TOC: -- [[#1-jupyter-tips-and-tricks][1 Jupyter tips and tricks]] - - [[#11-creating-or-importing-a-notebook][1.1 Creating or importing a notebook]] - - [[#12-running-r-and-python-in-the-same-notebook][1.2 Running R and Python in the same notebook]] - - [[#13-other-languages][1.3 Other languages]] -- [[#2-installing-and-configuring-jupyter-on-your-computer][2 Installing and configuring Jupyter on your computer]] - - [[#21-installing-jupyter][2.1 Installing Jupyter]] - - [[#22-making-sure-jupyter-allows-you-to-use-r][2.2 Making sure Jupyter allows you to use R]] - - [[#23-additional-tips][2.3 Additional tips]] - -* 1 Jupyter tips and tricks +- [[#jupyter-tips-and-tricks][Jupyter tips and tricks]] + - [[#creating-or-importing-a-notebook][Creating or importing a notebook]] + - [[#running-r-and-python-in-the-same-notebook][Running R and Python in the same notebook]] + - [[#other-languages][Other languages]] +- [[#installing-and-configuring-jupyter-on-your-computer][Installing and configuring Jupyter on your computer]] + - [[#installing-jupyter][Installing Jupyter]] + - [[#making-sure-jupyter-allows-you-to-use-r][Making sure Jupyter allows you to use R]] + - [[#additional-tips][Additional tips]] + +* Jupyter tips and tricks The following [[https://www.dataquest.io/blog/jupyter-notebook-tips-tricks-shortcuts/][webpage]] lists several Jupyter tricks (in particular, it illustrates many =IPython magic= commands) that should improve your efficiency (note that this blog post is about two years old so some of the tricks may have been integrated in the default behavior of Jupyter now). -** 1.1 Creating or importing a notebook +** Creating or importing a notebook Using the Jupyter environment we deployed for this MOOC will allow to easily access any file from your default GitLab project. There are situations however where you may want to play with other notebooks. @@ -54,7 +54,7 @@ situations however where you may want to play with other notebooks. notebook and confirm the upload. 4. Open the freshly uploaded notebook through the Jupyter file manager. -** 1.2 Running R and Python in the same notebook +** Running R and Python in the same notebook =rpy2= package allows to use both languages in the same notebook by: 1. Loading =rpy2=: #+begin_src python :results output :exports both @@ -74,7 +74,7 @@ situations however where you may want to play with other notebooks. Note that this =%%R= notation indicates that R should be used for the whole cell but an other possibility is to use =%R= to have a single line of R within a python cell. -** 1.3 Other languages +** Other languages Jupyter is not limited to Python and R. Many other languages are available: [[https://github.com/jupyter/jupyter/wiki/Jupyter-kernels][https://github.com/jupyter/jupyter/wiki/Jupyter-kernels]], including non-free languages like SAS, Mathematica, Matlab... Note that the maturity of these kernels differs widely. @@ -93,7 +93,7 @@ essence. But perfection does not exist anyway and using Jupyter literate programming approach allied with systematic control version and environment control will certainly help anyway. -* 2 Installing and configuring Jupyter on your computer +* Installing and configuring Jupyter on your computer In this section, we explain how to set up a Jupyter environment on your own computer similar to the one deployed for this MOOC. @@ -103,7 +103,7 @@ you to mix various components (including notebooks) in your browser. In the context of this MOOC, our time frame was too short to benefit from JupyterLab which was still under active development. You may, however, prefer JupyterLab when doing an installation on your own computer. -** 2.1 Installing Jupyter +** Installing Jupyter Follow these instructions if you wish to have a Jupyter environment on your own computer similar to the one we set up for this MOOC. @@ -125,7 +125,7 @@ source activate mooc_rr # Linux, MacOS and Windows: launch the notebook jupyter notebook #+end_src -** 2.2 Making sure Jupyter allows you to use R +** Making sure Jupyter allows you to use R The environment described in the last section should include R, but if you proceeded otherwise and only have Python available in Jupyter, you may want to read the following section. @@ -176,7 +176,7 @@ Install also =tzlocal=: #+begin_src shell :results output :exports both python -m pip install tzlocal #+end_src -** 2.3 Additional tips +** Additional tips *** • Exporting a notebook Here is what we had to install on a recent Debian computer to make sure the notebook export via LaTeX works: diff --git a/module2/ressources/jupyter_fr.org b/module2/ressources/jupyter_fr.org index 065c75bbf1dc40ea80e27865ef2316b126c7b1c8..3272170efd9806caa489a051aec65370884e7892 100644 --- a/module2/ressources/jupyter_fr.org +++ b/module2/ressources/jupyter_fr.org @@ -7,16 +7,16 @@ #+PROPERTY: header-args :eval never-export * Table des matières :TOC: -- [[#1-jupyter-trucs-et-astuces][1 Jupyter: Trucs et astuces]] - - [[#11-création-ou-import-dun-notebook][1.1 Création ou import d'un notebook]] - - [[#12-exécuter-du-code-r-et-du-code-python-dans-le-même-notebook][1.2 Exécuter du code R et du code Python dans le même notebook]] - - [[#13-autres-langages-que-python-et-r][1.3 Autres langages que Python et R]] -- [[#2-installation-et-configuration-de-jupyter-sur-votre-ordinateur][2 Installation et configuration de Jupyter sur votre ordinateur]] - - [[#21-installation-de-jupyter][2.1 Installation de Jupyter]] - - [[#22-sassurer-que-jupyter-vous-permet-dutiliser-r][2.2 S'assurer que Jupyter vous permet d'utiliser R]] - - [[#23-conseils-additionnels][2.3 Conseils additionnels]] +- [[#jupyter-trucs-et-astuces][Jupyter: Trucs et astuces]] + - [[#création-ou-import-dun-notebook][Création ou import d'un notebook]] + - [[#exécuter-du-code-r-et-du-code-python-dans-le-même-notebook][Exécuter du code R et du code Python dans le même notebook]] + - [[#autres-langages-que-python-et-r][Autres langages que Python et R]] +- [[#installation-et-configuration-de-jupyter-sur-votre-ordinateur][Installation et configuration de Jupyter sur votre ordinateur]] + - [[#installation-de-jupyter][Installation de Jupyter]] + - [[#sassurer-que-jupyter-vous-permet-dutiliser-r][S'assurer que Jupyter vous permet d'utiliser R]] + - [[#conseils-additionnels][Conseils additionnels]] -* 1 Jupyter: Trucs et astuces +* Jupyter: Trucs et astuces Cette [[https://www.dataquest.io/blog/jupyter-notebook-tips-tricks-shortcuts/][page web]] (en anglais) recense un certain nombre d'astuces relatives à l'utilisation de Jupyter (et en particulier des illustrations des nombreuses commandes magiques =IPython magic=) et @@ -24,7 +24,7 @@ susceptibles d'améliorer votre efficacité (notez bien que ce billet a plus de deux ans que Jupyter évoluant très rapidement, certaines de ces astuces ou de ces modules complémentaires font maintenant partie du comportement par défaut des versions les plus récentes de Jupyter). -** 1.1 Création ou import d'un notebook +** Création ou import d'un notebook L'environnement Jupyter que nous avons déployé dans le cadre de ce MOOC vous permettra d'accéder très simplement à tout fichier (et en particulier les notebooks des différents exercices que nous avons @@ -64,7 +64,7 @@ ceux du MOOC. 4. Vous pouvez maintenant ouvrir le notebook fraîchement récupéré à l'aide du navigateur de fichiers de Jupyter et réexécuter le code correspondant. -** 1.2 Exécuter du code R et du code Python dans le même notebook +** Exécuter du code R et du code Python dans le même notebook C'était impossible avec les premières versions de Jupyter mais c'est désormais très facile grâce à la bibliothèque python =rpy2=. Il vous faut tout d'abord ouvrir un notebook python. @@ -91,7 +91,7 @@ python (=rpy2=) maintient une session R, lui passe le code de la cellule et récupère le résultat. Jupyter fait alors le nécessaire pour l'afficher correctement. Il est également possible d'utiliser =%R= pour avoir une seule ligne de R au sein d'une cellule python. -** 1.3 Autres langages que Python et R +** Autres langages que Python et R Jupyter tire son nom des langages Julia, Python, et R. Il ne se limite donc pas aux langages Python et R. De nombreux autres langages de programmation sont disponibles: @@ -119,7 +119,7 @@ objectif de recherche reproductible mais il faut aussi savoir ne pas SAS, l'utilisation de la programmation lettrée de Jupyter et d'un contrôle de version (avec gitlab) et d'environnement (avec docker par exemple) se révélera très certainement précieux. -* 2 Installation et configuration de Jupyter sur votre ordinateur +* Installation et configuration de Jupyter sur votre ordinateur Dans cette section, nous expliquons comment installer, sur votre ordinateur, un environnement Jupyter similaire à celui que nous avons déployé pour ce MOOC. @@ -132,7 +132,7 @@ avons manqué de temps pour bénéficier de tout JupyterLab qui était toujours en développement actif. À l'heure actuelle, vous pouvez cependant avoir intérêt à installer tout JupyterLab sur votre ordinateur. -** 2.1 Installation de Jupyter +** Installation de Jupyter Ces instructions permettent d'obtenir sur votre ordinateur un environnement Jupyter similaire à celui que nous avons déployé dans le cadre du MOOC. @@ -159,7 +159,7 @@ source activate mooc_rr # Linux, MacOS and Windows: launch the notebook jupyter notebook #+end_src -** 2.2 S'assurer que Jupyter vous permet d'utiliser R +** S'assurer que Jupyter vous permet d'utiliser R Si vous avez installé l'environnement de la façon décrite dans la section précédente, vous devriez déjà avoir R à votre disposition et vous n'avez donc rien à faire. Mais si vous avez procédé différemment @@ -214,7 +214,7 @@ Installez également =tzlocal=: #+begin_src shell :results output :exports both python -m pip install tzlocal #+end_src -** 2.3 Conseils additionnels +** Conseils additionnels *** • Exporter un notebook Jupyter évolue rapidement et ces informations peuvent vite devenir obsolète mais voici ce qu'il peut être utile d'installer sur une diff --git a/module2/ressources/maintaining_a_journal.org b/module2/ressources/maintaining_a_journal.org index 8a1166775b99ac5e43613c7b809f6761de275a93..950d7d702166d4342020339d38fd684bd0ac76b9 100644 --- a/module2/ressources/maintaining_a_journal.org +++ b/module2/ressources/maintaining_a_journal.org @@ -6,13 +6,13 @@ #+PROPERTY: header-args :eval never-export * Table of Contents :TOC: -- [[#1-some-examples-of-labbooks-provided-for-inspiration][1. Some examples of LabBooks provided for inspiration]] -- [[#2-how-to-report-efficiently-by-martin-quinson][2. How to report efficiently (by Martin Quinson)]] +- [[#some-examples-of-labbooks-provided-for-inspiration][Some examples of LabBooks provided for inspiration]] +- [[#how-to-report-efficiently-by-martin-quinson][How to report efficiently (by Martin Quinson)]] - [[#reporting][Reporting]] - [[#reporting-logistics][Reporting Logistics]] - [[#reporting-document-organization][Reporting Document Organization]] -* 1. Some examples of LabBooks provided for inspiration +* Some examples of LabBooks provided for inspiration Since a few years, we systematically require any or our students to have a laboratory notebook in org-mode. Most of the time, they start in private repositories but often end up being fully opened. Here are @@ -40,7 +40,7 @@ Org-mode is obviously not the only option and many of our students use am mixture of org-mode, rstudio and jupyter depending on what is more convenient. -* 2. How to report efficiently (by Martin Quinson) +* How to report efficiently (by Martin Quinson) My friend Martin has gathered [[https://people.irisa.fr/Martin.Quinson/Research/Students/Methodo/][an excellent compendium of information and references on his webpage to explain his students what he expects from them]]. *I'll therefore simply paraphrase him here* with the most important aspects related to reporting but feel free to read [[https://people.irisa.fr/Martin.Quinson/Research/Students/Methodo/][the original version]]: diff --git a/module2/ressources/maintaining_a_journal_fr.org b/module2/ressources/maintaining_a_journal_fr.org index c202b2acfa9a5101577702956263d727432dea9d..250d62c97db5fd531b8899cebb82e82049772397 100644 --- a/module2/ressources/maintaining_a_journal_fr.org +++ b/module2/ressources/maintaining_a_journal_fr.org @@ -6,13 +6,13 @@ #+PROPERTY: header-args :eval never-export * Table des matières :TOC: -- [[#1-quelques-exemples-de-cahiers-de-notes-ou-de-laboratoires-pouvant-servir-de-source-dinspiration][1. Quelques exemples de cahiers de notes ou de laboratoires pouvant servir de source d'inspiration]] -- [[#2-comment-rendre-compte-de-son-activité-efficacement][2. Comment rendre compte de son activité efficacement]] +- [[#quelques-exemples-de-cahiers-de-notes-ou-de-laboratoires-pouvant-servir-de-source-dinspiration][Quelques exemples de cahiers de notes ou de laboratoires pouvant servir de source d'inspiration]] +- [[#rendre-compte-de-son-activité-efficacement][Rendre compte de son activité efficacement]] - [[#le-reporting][Le Reporting]] - [[#logistique][Logistique]] - [[#organisation-dun-compte-rendu-dactivité][Organisation d'un compte rendu d'activité]] -* 1. Quelques exemples de cahiers de notes ou de laboratoires pouvant servir de source d'inspiration +* Quelques exemples de cahiers de notes ou de laboratoires pouvant servir de source d'inspiration Depuis plusieurs années, nous demandons systématiquement à tout étudiant travaillant avec nous tenir à jour un cahier de laboratoire, généralement en org-mode. La plupart du temps, ces documents @@ -50,7 +50,7 @@ Org-mode n'est évidemment pas la seule option et il est courant que nos étudiants et collègues utilisent un mélange d'org-mode, rstudio et de jupyter selon ce qui est le plus adapté à leurs besoins du moment. -* 2. Comment rendre compte de son activité efficacement +* Rendre compte de son activité efficacement Mon ami Martin a réalisé [[https://people.irisa.fr/Martin.Quinson/Research/Students/Methodo/][une excellente collection d'informations et de références sur sa page web pour expliquer à ses étudiants ce qu'il attends d'eux]]. *Je vais donc tout simplement le paraphraser dans cette section* en rappelant les éléments qui me semblent essentiels (mais je vous invite à lire [[https://people.irisa.fr/Martin.Quinson/Research/Students/Methodo/][l'original]]).