Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book

Episode #234: The Astronomy-filled edition with Dr. Becky

Published Wed, May 19, 2021, recorded Wed, May 19, 2021.



Watch the live stream:

About the show

Sponsored by Sentry:

  • Sign up at pythonbytes.fm/sentry
  • And please, when signing up, click Got a promo code? Redeem and enter PYTHONBYTES

Special guest: Dr. Becky Smethurst

Brian #1: Powering the Python Package Index in 2021

  • Dustin Ingram
  • A lot has changed in 5 years since the previous write-up
  • From 3 people to
    • 3 maintainers/admins
    • 5 moderators
    • 3 commiters
  • Companies donate about $1.8M per month in services
    • Fastly, mostly
    • Google Cloud ~ $10K
    • AWS ~ $7K
    • Also Statuspage, Sentry, Datadog, Digicert, Pingdom
  • Awesome grants to fund projects
    • rewrite of PyPI
    • Localization, internationalization, API tokens and 2FA
    • Malware Detection and Update Framework
    • Foundational Tool Improvements & Productionized Malware Detection
    • Support Staff (a project manager)
  • Growth, now up to (per day)
    • 1.7 B requests pypi
    • 55.4 TB pypi
  • Next steps
    • FUNDABLES.md, which is a non-exhaustive wishlist of large projects we’d like to see happen
    • become a member, donate, or volunteer

Michael #2: The Leuven Star Atlas

  • via Shahrin Ahmad
  • Making a publication-quality stellar atlas from scratch
  • Plotting one page of the atlas: There is one single python script that takes care of the plotting of a single page of the atlas (plot_map.py). At the moment it is 1545 lines long
  • The goal was to produce a publication quality, both practical and visually pleasing star atlas aimed at amateur astronomers.
  • Took about 1.5 months to build/develop
  • Libraries used:
  • numpy for all kinds of data handling and numerical operations
  • pylab / matplotlib for all the main plotting operations
  • basemap for the mapping (takes care of the projection and the related transformations)
  • scipy for some specific interpolations and contours connected to the Milky Way
  • astropy and pyephem for celestial coordinate transformations
  • Source data: All databases that I am using are either publicly available from the internet (under various licenses), or they are compiled by me from publicly available data (links in the article)
  • One of the main new features of my atlas (compared to other atlases on the market) is the inclusion of the (as) precise (as possible) contours of the Milky Way on its pages.
  • Interesting library: adjustText - automatic label placement for matplotlib
  • The whole process takes around 4 hours on my laptop (using 4 cores in parallel).
  • Whole thing reminds me of the quote: “Data cleanin√g isn’t grunt work, it is THE work.”

Becky #3: TI-84 Plus CE Python graphing calculator

  • I remember being so attached to my graphica calculator at school and I swear I haven’t used it since I was 18 - they were banned from my university exams
  • Remember very pixelated screen, almost like an original GameBoy, and plotting was the worst - but what if could have colour plots in Python
  • Teaching kids to code early is so important, but learning to code with no purpose is also incredibly difficult. Learn alongside everything else makes it second nature and when something is second nature it becomes a tool you can use to solve a whole host of problems

Brian #4: Python Package CI/CD with GitHub Actions

  • Johanan Idicula
  • Nice write up of working with GH Actions
  • Triggers from push or pull request
  • Matrix runs
    • Running jobs across different build environenments
    • ubuntu
    • macos
    • windows
    • Diff python versions
  • Caching some tools to not have to load them for each combination
    • example caches Poetry
  • Running tests, of course
  • Checking artifacts
  • Auto-merge some branches
  • Release automation to pypi on ‘v*’ tag pushes

Michael #5: SpaceX is using Python for prototyping their Starlink satellite software

  • via Garett Dunn
  • From four-part series on the software that powers SpaceX
  • The software breaks down roughly into two parts: 1) software that flies and 2) software that supports the flying components.
  • For Starlink, one of the main challenges is that our “towers” are orbiting Earth, forcing your path to the internet to change very frequently.
  • The Earth-side network then provides continuous updates on traffic conditions and constellation changes, while each satellite updates the ground on its planned trajectory.
  • Starlink software, both in satellites and on the ground, is written almost exclusively in C++
  • But the prototyping is done in … Python.
  • The software is developed in a continuous integration environment, with teams merging into the master development branch often and deploying to the fleet of satellites in space each week.
  • Live view findstarlink.com and starlink.sx and starlinkradar.com/livemap.html
  • The Python version allows for rapid iteration during the design phase. Once we are happy with the results of an algorithm, we port it to C++ so it runs efficiently in production.

Becky #6:: A beginner’s guide to working with astronomical data

  • it’s a scientific paper but huge sections on using Python to analyse images, remove noise, all the steps needed not just for me as professional but one I hope amateurs will find useful too
  • Huge shoutout to astropy, Michael mentioned it before, revolutionised the field but also those keen amateur astrophotographers who perhaps use a Raspberry Pi to drive their telescope or to analyse their images

Extras

Michael

Becky

Joke