(Prequel)First PR to JuliaAstro: Making Impression

PR info.

7th PR on AstroImages.jl. My first PR to JuliaAstro org. Task: Add a feature to change brightness/contrast of AstroImages in real-time in Jupyter notebook itself. Things used: Interact.jl for interactive Jupyter visualization.

Back-story

There was a criterion of OpenAstronomy that a student should have at least one PR to the project to be eligible for getting selected into the org. Our mentor Mose told us about this and as AstroImages.jl was a new package, there weren’t enough issues to solve. So he came up with this idea that can be implemented to the package. Lucky me, I have done the same thing before while extending docs of Images.jl. I think this gave me an edge over others. Those days I was also contributing to JuliaText, so managing time for both org. was tuff. But as I knew how to do this, it was a quick PR.

PR evaluation and learnings

Mose was expecting the same thing which I had made. I also proposed some ideas like we can store this operation and change the data of FITS if the user wants according to this feature. But Mose highlighted that the data is holy, we shouldn’t just modify it just carelessly. Those times I was new to Julia and didn’t have a clear understanding of mutables and structs but later on, during GSoC, I implemented the exact idea in a safe and maintainable way.

Also, Mose himself wrote the tests as I was confused on how to write tests for such a function which doesn’t give a concrete output. The answer was @test @inferred(your_function) == the_type_you_expect. This taught me that tests can be written in a way such that we can test if the input and output types are as expected and are done with its unit tests.

At a later stage of this PR, I came to know about MIME functionality which lets you automatically renders visualization in Jupyter Notebook like plots, Interacts, and Images. i.e once you call something it automatically draws that in output cell of Jupyter Notebook. It was crucial learning for Jupyter Notebook integration and helped me in a later stage of GSoC too.

The PR was completed a long before GSoC results were announced and this made me eligible to be selected in OpenAstronomy org. too. Thinking back, I was the only student who successfully passed this criteria in JuliaAstro.