Ritiek Malhotra Just some of my adventures!

Summer past and GSoC ends

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.

PR Status Description
#501 Merged Raise more fitting NotImplementedError for functions that are yet to be implemented in our Plasma metaclass
#489 Merged Independent tests for our Plasma subclasses
#459 Merged Implement 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.

PR Status Description
#500 Merged Implement 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!

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

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

PR Status Description
#506 Merged Write tests to improve coverage in various packages
#502 Merged Move coveragerc file to expected default location so that it can be read correctly
#498 Merged Add tests to improve coverage in our langmuir package
#494 Merged Include __init__.py in our diagnostics package, so that any tests placed aren’t skipped
#320 Merged Write 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!

PR Status Description
#513 Merged Fix conda recipe by including LICENSE.md in MANIFEST.in
#511 Merged Load correct URLs when using online_help()
#509 Open Some refactoring of @tulasinandan’s work on two fluid dispersion relations
#360 Merged Mention RelativityError in docstrings when input velocity is same or greater than the speed of light
#358 Merged Return 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

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

poliastro

PR Status Description
#312 Open [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.