Python Friday #72: PyCon US 2021

Last week I attended my first PyCon US. It was a well-run online event that showed me many interesting things about Python that I had no idea were even possible.

This post is part of my journey to learn Python. You can find the other parts of this series here.

 

PyCon US 2021

PyCon took place from 12 to 16 May 2021 as an online conference. There where two days of tutorials followed by two days of talks and one day posters & job fair. I got a ticket for the talks and missed the chance to book a tutorial as they sold out in no time. If you want to attend next year, make sure that you set your alarm clock.

The event run on the Hubilo platform that had the best feature of all online conference tools I used so far: Immediately after the end of a talk could watch a replay. If you missed a talk you got the recording right away without waiting until it gets published on YouTube. I hope more conferences offer this feature.

 

Keynote: Operation Night Watch

Rembrandt van Rijn painted in 1642 his masterpiece The Night Watch, depicting Frans Banning Cocq and his men. The painting has a colossal size of 363 cm x 437 cm (142.9 in x 172.0 in) and is probably the best-known item in the Rijksmuseum in Amsterdam.

Time leaves its mark on the painting, like the bleaching of the dog. To figure out what is going on, the Rijksmuseum started Operation Night Watch in which a variety of techniques help the curators to make a thorough examination to come up with the best treatment plan to preserve the painting.

The box of Operation Night Watch (March 2020)

Robert Erdmann explains in his keynote how Python helps his team to create a digital image where a pixel covers 5 micrometres (0.005 mm) of the canvas. As a comparison, a human red blood cell has a diameter of about 7 micrometres. To create such an impressive high-resolution image, you need a special camera and a macro lens. Unfortunately, the macro lens has only a tiny depth of field. If the canvas is closer or further away, the image it gets blurry. Even worse, the canvas is not straight. Its more like a 16 square meter sail that moves slightly and has bulges – probably the worst condition for macro photography.

Python, algorithms and machine learning help with the positioning of the camera, check the sharpness of the image, detect (and correct) the colours and at the end help with the positioning of the 5.5 centimetres wide (small) images into one big image. Robert did a great job in explaining the different parts and how they work together.

I can highly recommend this talk as an example on what is possible with Python. You learn how they overcome the different obstacles and challenges they faced on their way to create an image of incredible details and 716,875,000,000 pixels in total. You can already see the 20 micrometres (0.02 mm) image here. The 5 micrometres image will follow soon and offers much more details.

 

Writing Good Documentation for Developers

If you create developer tools, an API for a commercial product or a library, you put effort into it and hope it will be used by other developers. But how do they find your project? They use Google, end up in your developer documentation and look around for an indication that your project can help them.

You created the documentation to enable developers to use your project and to solve the problems they have along the way. Yet, your documentation is a lot more than just learning material, it is content marketing. What does this project do? The developer documentation may answer that question and help to decide if your project is a good fit to solve the problem they have.

For developer tools the documentation is the user interface.

Meredydd Luff explains in his talk with many examples the importance of good documentation and how to answer the right questions in the right place. For that he extends the types of documentation by Daniele Procida (PyCon Australia 2017) to a more complete set:

  • Tutorial: Step by step lesson to learn your project by doing some concrete and meaningful work (learning-oriented).
  • How-To: A simplified step by step guide to get a particular real-world task done (problem-oriented).
  • Reference: The big picture and how the parts work together.
  • API Doc: The method by method documentation of your code.
  • Explanation: Discussions on the how and the why things are done the way they are.
  • Q & A: Questions and answers of users about your project.

This talk got me thinking about the many different channels we have to deliver documentation that fits the needs of our users. If you write any developer tool you should take 20 minutes of your time and watch this talk.

 

Other notable talks

The following talks offer short introductions to topics that I find very interesting and recommend:

AI in Healthcare by Akshay Sharma explains how Jupiter Notebooks can turn a processing first paradigm (like HL7) in healthcare to a compute first paradigm where all participants share data in their notebooks.
Python Performance at Scale – Making Python Faster at Instagram by Dino Viehland shows what Instagram did to improve the performance of their Django monolith to serve 1,000,000,000 users per month.
Gradual Typing in Practice by Maggie Moss explains how we can add types to our Python code where we have a need without changing everything at once.
Intro to Pydantic by Alexander Hultnér shows how Pydantic can enforce types at runtime and how that helps to prevent invalid data.
An Introduction to FastAPI by Thomas Jewitt gives a quick overview how Pydantic and types help FastAPI to create automatic documentation and ensures that your input data is correct.
Static Sites with Sphinx and Markdown by Paul Everitt explains how you can use Sphinx as a static site generator with all its features while writing your content in Markdown.
Secure Software Supply Chains for Python by Dustin Ingram offers a secure way to manage your dependencies with the pip tools to prevent supply chain attacks.
Zero to production-ready: a best-practices process for Docker packaging by Itamar Turner-Trauring is a quick high-level view on improving your Python Docker images.
Getting an Edge with Network Analysis with Python by Alon Nir gives an overview on how Python helps with examining graphs using NetworkX.

 

Parting thoughts

PyCon US 2021 was a very educational conference where I saw a lot of things that I will write about in more detail in future posts of Python Friday. I hope you watch some of the videos as soon as they show up on YouTube.

Update 16. June 2021: Add links to talks

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.