PyDev of the Week: Thomas Robitaille

This week we welcome Thomas Robitaille (@astrofrog) as our PyDev of the Week! Thomas is the lead developer of the Glue data exploration package and one of the lead developers of the Astropy project, which is a Python library for Astronomy. He also writes a fun Python blog. Let’s take a few moments to get to know our fellow Pythonista better!


Can you tell us a little about yourself (hobbies, education, etc):

I am currently a freelance scientific software developer, working on projects with teams in North America and in Europe. However, this is a very recent development: until the end of 2015, I was an astrophysicist, and I worked mainly on studying the formation of stars and on radiative transfer. I completed my PhD in the UK in 2008, then worked as a researcher at Harvard and subsequently at the Max Planck Institute for Astronomy in Germany. During my time as a researcher, I learned Python and became involved in a number of open-source scientific software projects. In particular, I actively participated in efforts to build Python tools for astronomy and encourage astronomers to learn Python, and I became one of the coordinators and lead developers for the Astropy project. I eventually decided that I wanted to work on scientific software development full time, and made the jump to work as a freelance developer!


Why did you start using Python?

I started using Python back in 2008, when I started working at Harvard. I had come across Python a few times during my PhD, and once I moved to the US, I decided to spend a lot of my time in the first few weeks of my new job learning Python. During my PhD, I had mostly used Fortran which – while good for high performance computing (which I was doing) – is not the ideal language for interactive analysis and fast development. Python’s main competitor at the time in astronomy was the interactive data language (IDL). While IDL did have a reasonably rich library of functionality for astronomy, I did not want to get tied to a commercial language, and found Python to be a much more flexible and elegant language. Despite the small number of astronomy packages available at the time, the huge ecosystem of other scientific packages, as well as the large number of other packages, was very appealing to me.


What other programming languages do you know and which is your favorite?

During my time as a researcher, I did a lot of high performance computing work in Fortran 95, in particular developing a radiative transfer package called Hyperion to simulate what astronomical objects (such as forming stars or galaxies) look at different wavelengths (for example in the infrared). Fortran has a reputation of being an old-fashioned language, and while it’s true that it’s not a very flexible and widely-applicable language, and is far from the best choice for object-oriented programming, it does do high-performance computing very well. I have also used a number of other languages depending on projects, including C/C++, R, Perl, Javascript, PHP, and others. But so far, Python remains my favorite language, not only because of the elegance or simplicity of the language, but also because of the large ecosystem of available packages and the great community of users and developers.


What projects are you working on now?

I am currently the lead developer for the Glue package, which is an interactive Python package for data exploration and visualization. This package was originally developed by Chris Beaumont, and you can see him talk about an early version of the package here. I am also one of the coordinators and lead developers for Astropy, which is a project to develop a core set of Python packages for astronomy. The core astropy package contains a lot of core functionality for astronomers but also for scientists in general: for example there is a very powerful unit conversion framework, as well as a framework for dealing with tabular data that interfaces nicely with pandas. In addition to Glue and Astropy, I maintain quite a few smaller Python packages – many of which you can find through my GitHub profile.


Which Python libraries are your favorite (core or 3rd party)?

I’m a big fan of requests for easy and Pythonic web access, the Jupyter notebook (formerly IPython notebook) for interactive analysis, Vispy for 3-d visualization with OpenGL, scikit-learn for machine learning, and Numpy for fast array operations. I really like the conda package manager, and in particular the ability to create different environments in a blink of an eye. In terms of Python tools that help me with development, most of the projects I work on have documentation that I build with Sphinx, and while not strictly a Python package, using Sphinx via ReadTheDocs makes things very easy. I really enjoy writing tests using the pytest framework, and using the large ecosystem of pytest plugins. The Python standard library has a lot of nice functionality too, including for example the multiprocessing, concurrent.futures, and collections modules.


Is there anything else you’d like to say?

In my experience, one of the best things about Python is the very friendly community of users and developers, and the ease with which one can always find someone that will be willing to help. At a time where programming communities are sometimes acting in aggressive or exclusionary ways, I sincerely hope that we continue to work together to make the Python community as friendly and inclusive as possible, both in person and in our online communities!

Thanks so much for doing the interview!