-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjupytercon-2023.qmd
33 lines (19 loc) · 4.14 KB
/
jupytercon-2023.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
title: Write, document, test and distribute Python packages with nbdev & Quarto
date: 2023-05-22
categories: [talk]
---
I attended [JupyterCon 2023](https://www.jupytercon.com/) in Paris two weeks ago. On Thursday, [Hamel Husain](https://hamel.dev/), myself, and [J. J. Allaire](https://www.linkedin.com/in/jjallaire) (as a teaching assistant) presented a two and a half hour tutorial on Writing, Documenting, Testing, and Distributing Python Packages with [nbdev](https://nbdev.fast.ai/) and [Quarto](https://quarto.org/).
I think it went well! The room was full and attendees engaged with great questions.
 [taken with `shot-scraper`](/tils/using-shot-scraper.ipynb).](images/jupytercon-2023-tutorial.png){.shadow-sm .border .preview-image fig-align="center"}
Hamel opened by describing the roots of nbdev's programming paradigm: a combination of *literate programming* ([introduced by Donald Knuth](https://en.wikipedia.org/wiki/Literate_programming)) and *exploratory programming* ([beautifully demonstrated by Bret Victor](https://www.youtube.com/watch?v=PUv66718DII)) made possible by [Jupyter](https://jupyter.org/) notebooks. He then took us through both basic and advanced usage of Quarto -- the publishing platform that powers nbdev's documentation generation.
I followed with a demonstration of my approach to notebook-driven development by live coding the now classic nbdev example: a library for interacting with playing cards based on [Chapter 18 of Allen B. Downey's Think Python](https://greenteapress.com/thinkpython2/html/thinkpython2019.html). I tried to focus on the thinking process and how it differs from more conventional programming paradigms, rather than focusing on the mechanics of how nbdev works since that is so readily available online.
My demonstration was largely based on the [official written nbdev tutorial](https://nbdev.fast.ai/tutorials/tutorial.html) and [best practices post](https://nbdev.fast.ai/tutorials/best_practices.html). I also used the tutorial as an opportunity to refine these docs. The biggest refinement was that I now recommend JupyterLab instead of the classic notebook. There are two main reasons for this:
- Lab has a growing extension ecosystem:
- I can't live without the wonderful [`jupyterlab-quarto`](https://github.com/quarto-dev/quarto/tree/main/apps/jupyterlab). It renders Quarto markdown including frontmatter, callouts, and fenced divs which greatly improves the authoring experience.
- There is interesting work being done on LLM-related extensions like [`jupyter-ai`](https://github.com/jupyterlab/jupyter-ai) which adds an LLM chat interface to the sidebar.
- [Lab 4.0.0 was released!](https://github.com/jupyterlab/jupyterlab/releases/tag/v4.0.0) It comes with significantly better performance among a ton of other improvements. Most notably for me is a built-in implementation of classic's [collapsible headings](https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/nbextensions/collapsible_headings/readme.html) extension (including the keyboard shortcuts). However, it is worth noting that extensions will need to migrate to version 4 and I'm keen to see what this process will look like!
You can also find an outline of the tutorial as well as the slides for Hamel's opening section at the tutorial website: <https://fastai.github.io/jupytercon-2023>.
By the way, we wrote the tutorial site using Quarto too! Here is the underlying repo: <https://github.com/fastai/jupytercon-2023>.
The conference venue was beautiful! On the last day, [David Brochart](https://twitter.com/davidbrochart), [Hamel Husain](https://hamel.dev/), and I took a walk around the [Cité des sciences et de l'industrie](https://www.cite-sciences.fr/en/home) and surrounding area, and David shared some of the fascinating history behind the city.
, [Hamel Husain](https://hamel.dev/), and myself pictured in front of the [Philharmonie de Paris](https://philharmoniedeparis.fr/en) a short walk away from the JupyterCon 2023 conference hall.](images/david-hamel-wasim-jupytercon-2023.jpeg){fig-align="center"}