Summer past and GSoC ends

10 minute read

Published:

It’s that time of the year when students are supposed to submit their final evaluations. As Google expects students to put up their final reports somewhere in a stable location and as there is always a chance that I might mess up something on my blog, so I also made a Gist wrap up of this blog post of how we progressed in these few months and all the great stuff that happened in our community.

My original project - to create a factory based implementation for unifying handling of different types of Plasmas, was completed sooner than expected. Here are the link to related pull requests I made during the summer.

PRStatusDescription
#501MergedRaise more fitting NotImplementedError for functions that are yet to be implemented in our Plasma metaclass
#489MergedIndependent tests for our Plasma subclasses
#459MergedImplement a Plasma factory interface to unify handling different Plasma types

Hail plasmapy.classes.Plasma! A glimpse of how it looks like

>>> import astropy.units as u
>>> import numpy as np
>>> import plasmapy.classes

>>> T_e = 25 * 15e3 * u.K
>>> n_e = 1e26 * u.cm ** -3
>>> Z = 2.0
>>> particle = 'p'
>>> blob = plasmapy.classes.Plasma(T_e=T_e,
...                                n_e=n_e,
...                                Z=Z,
...                                particle=particle)

>>> type(blob)
plasmapy.classes.sources.plasmablob.PlasmaBlob

>>> three_dims = plasmapy.classes.Plasma(domain_x=np.linspace(0, 1, 3) * u.m,
...                                      domain_y=np.linspace(0, 1, 3) * u.m,
...                                      domain_z=np.linspace(0, 1, 3) * u.m)

>>> type(three_dims)
plasmapy.classes.sources.plasma3d.Plasma3D

As my original project was completed sooner than expected. I further implemented a new Plasma subclass for reading HDF5 datasets respecting OpenPMD standards.

We had to choose between h5py and OpenPMD-api packages for reading HDF5 dataset files. At that time, the OpenPMD-api had a few installation issues and it was hard to distribute with PlasmaPy as it isn’t available on PyPi yet, not many people use spack and certainly not many people would give it a go building from source. It is however, available on conda-forge but PlasmaPy isn’t (yet). :(

So, h5py it was then.

PRStatusDescription
#500MergedImplement a prototype to read attributes from HDF5 datasets based on OpenPMD standards

However, It still isn’t very efficient to work with larger datasets and should rather be considered a prototype at the moment. It currently only supports reading mesh data from an HDF5 dataset. It also reads the complete record into memory, which is certain to cause problems with big datasets. In the real world, heavy datasets can go into dozens of GBs, so we’re going to have to provide a way to read a part of dataset at a time from disk or provide some other way in the future instead writing all of it to memory at once.


During the summer, I also worked on implementing other functionality, bug fixes and improving test coverage in PlasmaPy.

We ended up making our atomic.Particle class and @atomic.particle_input decorator more pleasant to use and now works better than ever!

PRStatusDescription
#528MergedFunctions decorated with @particle_input now accept default Particle value
#527MergedTypo fixes in @particle_input error messages
#510MergedAdd an isotope_name property on Particle class
#504MergedAdd a roman_symbol property which returns integer Particle charge in Roman notation
#493MergedDecorate functions in collisions.py with @particle_input decorator
#483MergedAccept a tuple or list of Particles for a parameter in a function decorated by @particle_input
#290Merged[Pre-GSoC] Optionally accept integer charges in Roman notations
#265Merged[Pre-GSoC] Move Particle.reduced_mass to a module level function

And we fought against code coverage problems to make CodeCov happy!

PRStatusDescription
#506MergedWrite tests to improve coverage in various packages
#502MergedMove coveragerc file to expected default location so that it can be read correctly
#498MergedAdd tests to improve coverage in our langmuir package
#494MergedInclude __init__.py in our diagnostics package, so that any tests placed aren’t skipped
#320MergedWrite tests for PlasmaBlob.regimes()

We have an astonishing code coverage - 98%! It’s great that we were able to keep with our code coverage even after so much going in and out of PlasmaPy.

Then comes the list of all the other stuff I tinkered with during the season!

PRStatusDescription
#513MergedFix conda recipe by including LICENSE.md in MANIFEST.in
#511MergedLoad correct URLs when using online_help()
#509OpenSome refactoring of @tulasinandan’s work on two fluid dispersion relations
#360MergedMention RelativityError in docstrings when input velocity is same or greater than the speed of light
#358MergedReturn Quantity objects correctly formatted when passed to call_string()

During these months, I also got the chance to contribute to astropy and poliastro which are also sub-organizations under the the OpenAstronomy umbrella organization.

astropy

PRStatusDescription
#7673Open[Upstream] Fix string Python code to test coverage on Windows which would otherwise result in SyntaxError
#7672OpenAccept non-unit type annotations in functions decorated with@quantity_input decorator
#7284Closed[Pre-GSoC] Override HDUList.__add__() to return a sum of two HDUList instances
#7218Open[Pre-GSoC] Implement shallow copy and deep copy on an HDUList instance

poliastro

PRStatusDescription
#312Open[Pre-GSoC] Return a tuple (Time, CartesianRepresentation) in Orbit.sample()

A lot of other cool stuff happened in these past few months. We went from a new logo,

from no releases to releasing v0.1.1 on PyPi (coming soon on conda!), from Coveralls to CodeCov, confirmed that PlasmaPy works great with Python 3.7, to submitting an abstract for the AGU Fall Meeting!

This was one hell of an awesome summer working with PlasmaPy under Google Summer of Code 2018. I want to thank Google and OpenAstronomy (an umbrella organization for PlasmaPy) for giving me this opportunity to work with such an amazing community. A shoutout and a special thanks to my mentors (Nick Murphy, Drew Leonard and Dominik Stańczak) for guiding me throughout the summer!

And so the wonderful journey comes to an end.