Scientific codes
Ramses
RAMSES is an open source code to model astrophysical systems, featuring self-gravitating, magnetised, compressible, radiative fluid flows. It is based on the Adaptive Mesh Refinement (AMR) technique on a fully-threaded graded octree. RAMSES is written in Fortran 90 and is making intensive use of the MPI library.
I contributed by improving and tidying up the code that supports particles. Overall, I added 20,000 lines and deleted as many (making me the 7th contributor out of ~50 in terms of number of lines contributed!).
Code available at: bitbucket.org/rteyssie/ramses
Yt
yt is an open-source, permissively-licensed python package for analyzing and
visualizing volumetric data.
I am responsible for supporting the RAMSES frontend in yt and significantly contributed to the project (90+ pull-requests accepted). In particular I implemented a ray-tracing algorithm to be able to do volume rendering (see image below and pull-request #2610), added support for gradient computation (see pull-request #2425). I also added support for the halo catalogs generated by the AdaptaHOP halo finder (see pull-request #2385).
Code available at: github.com/yt-project/yt
pynbody
Pynbody is a light-weight, portable, format-transparent analysis framework for N-body and hydrodynamic astrophysical simulations supporting PKDGRAV/Gasoline, Gadget, N-Chilada, and RAMSES AMR outputs.
I contributed to the code by adding support for the AdaptaHOP halo finder (see pull-request #546).
I also improved the performance by changing the reader from a Python-backed solution to a Cython-backed solution (see pull-request #548).
Code available at: github.com/pynbody/pynbody
genetIC
GenetIC is a code to generate initial conditions for cosmological simulations, especially for zoom simulations of galaxies. It provides support for 'genetic modifications' to arbitrarily modify the initial conditions to control e.g. the mass assembly history of galaxies or their angular momentum.
I contributed to the code by adding support for angular momentum modifications (see pull-request #80).
I also added support for tracer particles to allow genetic modifications of the initial conditions of the baryon Lagrangian patch with the code RAMSES.
Code available at: github.com/pynbody/genetIC
Meta-scientific tools
Astro arXiv Reader
It is sometimes hard to follow papers published on the arXiv on a daily basis.
In particular, my routine involves commuting for an hour or so, a time that is more prone to listening to podcasts than reading papers: what if there was a way of listening rather than reading arXiv abstracts?
This is now possible thanks to astro arXiv reader, supported by a grant from UCL's department of Physics and Astronomy. The podcast fetches daily all abstracts from all categories in astro-ph, the text is serialized (e.g., LaTeX commands are stripped out) before being sent to Google's text-to-speech API, which returns an audio file. As a last step, all the audio files are gathered, tagged with the relevant metadata (author, title, date, ...) and appended to a podcast.
Find the podcast on Spotify, Apple and Google podcasts by searching “Astro arXiv” and subscribing to any of the channel (one per category in astro-ph).
You can also subscribe directly to any of the following .rss file:
astro-ph.CO, astro-ph.GA, astro-ph.GA+CO, astro-ph.EP, astro-ph.HE, astro-ph.IM, astro-ph.SR or all of astro-ph and please submit feedback and/or contribution on the Github repository.
Data Analysis
matplotlib-label-lines
Provides a simple way to add labels to lines in matplotlib. With more than thousands of weekly downloads, this is by far my most-downloaded contribution!
Source code: cphyc/matplotlib-label-lines
IPySpaghetti
Jupyter Notebooks are one of the building blocks of any modern data analysis pipeline.
However, notebooks allow cells to be executed in random order which may prevent the notebook from being reproducible, an important shortcoming in scientific contexts. In addition, only variables living in the main scope are first-class citizen, which discourages encapsulation and leads to global-scope pollution.
IPySpaghetti is an ongoing attempt (as of 2021) to provide an interactive environment familiar to Notebook users without these shortcomings.
It relies on a dataflow approach, where data flows in nodes (Python functions) which are linked together in an interactive graph.
Poster presented at SciPy 2021 available at: codes/ipyspaghetti/2021-scipy-poster.html
Scientific Workflow
Scientific workflow description provides an alternative to the cognitive overhead of learning a new software package and use of imperative programming paradigms often used with python. We aim to unite the core aspects of interdisciplinary computational work using common natural science mental models while removing inherent domain-specific workflow and computing language barriers, creating an accessible scientific query environment. This description is encoded in a JSON schema, accessed by the user through a configuration file, and run using python modules that attach the configuration file to the code which produces output.
Poster presented at SciPy 2021 available at: https://samwalkow.github.io/2021-scipy-poster-ScientificWorkflowDescription/
Non-scientific codes
Cycling optimizer
This small standalone Python file gathers weather data from wttr.in and computes the optimal time to commute on your own cycle.
Code available at: https://gist.github.com/cphyc/9ffd983416c722c66577df63edfaa19b