You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/sharing.md
+27-19Lines changed: 27 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -1,37 +1,43 @@
1
1
# Sharing notebooks
2
2
3
-
```{objectives}
3
+
:::{objectives}
4
4
- Know about good practices for notebooks to make them reusable
5
5
- Have a recipe to share a dynamic and reproducible visualization pipeline
6
-
```
7
-
8
-
```{instructor-note}
9
-
- 20 min presentation and discussion
10
-
```
6
+
:::
11
7
12
-
[this lesson is adapted from<https://coderefinery.github.io/jupyter/sharing/>]
8
+
[this lesson is adapted after<https://coderefinery.github.io/jupyter/sharing/>]
13
9
14
10
15
11
## Document dependencies
16
12
17
13
If you import libraries into your notebook, note down their versions.
18
14
19
-
It is customary to do this either in a `requirements.txt` file (example):
15
+
In Python, it is customary to do this either in a `requirements.txt` file (example):
20
16
```text
21
-
pandas==2.2.2
22
-
altair==5.3.0
17
+
jupyterlab
18
+
altair == 5.5.0
19
+
vega_datasets
20
+
pandas == 2.2.3
21
+
numpy == 2.1.2
23
22
```
24
23
25
24
... or in an `environment.yml` file (example):
26
25
```yaml
27
-
name: example-environment
26
+
name: data-viz
28
27
channels:
29
28
- conda-forge
30
29
dependencies:
31
-
- pandas=2.2.2
32
-
- altair=5.3.0
30
+
- python <= 3.12
31
+
- jupyterlab
32
+
- altair-all = 5.5.0
33
+
- vega_datasets
34
+
- pandas = 2.2.3
35
+
- numpy = 2.1.2
33
36
```
34
37
38
+
By the way, this is almost the same `environment.yml` file that we used to install the local software
39
+
environment in the {ref}`installation` (the latter did not pin versions).
40
+
35
41
Place either `requirements.txt` or `environment.yml` in the same folder as the notebook(s).
36
42
37
43
This is not only useful for people who will try to rerun this in future, it is also
@@ -46,7 +52,7 @@ to share them with our future selves (backup and reproducibility).
46
52
- You can enter a URL, GitHub repo or username, or GIST ID in [nbviewer](https://nbviewer.jupyter.org/) and view a rendered Jupyter notebook
47
53
- Read the Docs can render Jupyter Notebooks via the [nbsphinx package](https://nbsphinx.readthedocs.io/)
48
54
- [Binder](https://mybinder.org/) creates live notebooks based on a GitHub repository
49
-
- [EGI Notebooks](https://notebooks.egi.eu) (see also https://egi-notebooks.readthedocs.io)
55
+
- [EGI Notebooks](https://notebooks.egi.eu) (see also <https://egi-notebooks.readthedocs.io>)
50
56
- [JupyterLab](https://github.com/jupyterlab/jupyterlab) supports sharing and collaborative editing of notebooks via Google Drive. Recently
51
57
it also added support for [Shared editing with collaborative notebook model](https://github.com/jupyterlab/jupyterlab/pull/10118).
52
58
- [JupyterLite](https://jupyterlite.readthedocs.io/en/latest/) creates a Jupyterlab environment in the browser and can be hosted as a GitHub page.
@@ -60,10 +66,10 @@ to share them with our future selves (backup and reproducibility).
60
66
- a slide-show in the browser
61
67
62
68
63
-
These platforms can be used free of charge but have **paid subscriptions** for
69
+
The following platforms can be used free of charge but have **paid subscriptions** for
64
70
faster access to cloud resources:
65
71
- [CoCalc](https://cocalc.com/) (formerly SageMathCloud) allows collaborative editing of notebooks in the cloud
66
-
- Google's [Colaboratory](https://colab.research.google.com/) lets you work on notebooks in the cloud, and you can [read and write to notebook files on Drive](https://colab.research.google.com/notebooks/io.ipynb)
72
+
- [Google Colab](https://colab.research.google.com/) lets you work on notebooks in the cloud, and you can [read and write to notebook files on Drive](https://colab.research.google.com/notebooks/io.ipynb)
67
73
- [Microsoft Azure Notebooks](https://notebooks.azure.com/) also offers free notebooks in the cloud
0 commit comments