So the evaluation week passed marking the completion of 1 month of GSoC! 😮 It has been an incredible journey so far with lot of learnings not only about coding but also about life. Thanks to the evaluation period that we're able to get wonderful feedback from our awesome mentors! 😊
What did I do this week?
- After creating functions for fetching filter data using API, I created a PR and worked on it, doing the changes as left on review by my mentor. I did a lot new things in this PR to make my written code better, like storing downloaded data temporarily (as a buffer), adding docstrings for functions, using Astropy units, etc. I further improvised my code by reducing the redundant code by creating another function for it. This was all about code, my mentor suggested there are other 2 things which should also be present in a good PR besides code:
- Documentation: I created a notebook illustrating the use of all functions.
- Tests: I used pytest, to create tests for the functions. I also learned about Astropy testing suite which is used by our package for running pytests. And I also came to know about remote-data plugin used for running tests that access data from internet.
- My mentor suggested it will be great if we could contribute this (SVO FPS) to another popular Open Source package: Astroquery, a popular python package to access data from astronomical data resources. So I created an issue for it at astroquery to share our work at wsynphot, they welcomely accepted it and told me to do changes in my code as per their standard API. So I created a class for all those functions and I still need to do some work, before I create a PR in their repository.
What is coming up next?
Now I will create a PR in astroquery and see how things turn out. Also we will finish up these filter data access methods for our package wsynphot. Possibly we will create some offline support (to cache the fetched data on disk) - since data is huge, so it takes time in fetching data based on your internet connection speed (a limitation of the real-time fetching approach).
Did I get stuck anywhere?
While wrapping my created functions in a class, it took me time to figure out how to import it by creating a public object. Also I got stuck in running tests, 1st because it was using Astropy test suite and then these tests were accessing data over internet, so it failed to run them. But by taking a break and trying again with a calm head, I figured it out that remote-data option needs to be specified for running such tests.
What about Evaluations?
As this was Evaluation Week, both students and mentors evaluate each other by filling their responses in an evaluation form provided by GSoC. So yesterday, I recieved a mail from GSoC that I passed the evaluation and can continue the GSoC program. And in it my mentor's feedback (evaluation) was also mentioned, which was so wonderful that I read it 4 times in a row! 😍 He mentioned lots & lots of appreciation of what I do well and also the suggestions of where could I improve. I am really grateful that he let me know about my capabilities as well as how could I improve myself. This week really made me feel the importance of this program and a mentor, that there is someone to guide you and help you becoming better not only as a developer but also as a person.
What was something new and exciting I learned?
📥 Saving files temporarily: While handling files there are cases when we need to pass file (or path) as an argument to a library function. For parsing the downloaded filter data, I needed to store it in file before parsing. But I wanted it to be deleted after it is used. That's why I came to know about python tempfile package which lets you store your data in a temporary file which gets deleted when you close it. My mentor suggested a better approach to use file-like objects instead. So I used BytesIO object to store data as a memory buffer, temporarily.
📂 Handling Python package & modules: My mentor told me to put my created python file (containing functions) in a subpackage io within our repo. When I needed to import it while using, so I learned how to achieve it by creating a __init.py__ file for it. Also when I put my functions in class, I learned how to import it by instantiating an object and then importing it publically in the init.py file. Also when I wrote tests for my module, I felt kind of satisfied that now I almost know how to create a package on my own!
⛱️ Recognize when you need a break: We know that a break is necessary if we're stuck while solving a problem. But we overlook this fact, while we keep pushing ourselves to solve the problem which takes us close not to the solution but to frustration. Same my mentor told me in feedback that he likes my enthusiasm but to keep that alive, I need to take breaks when my mind/body needs it. And it really works, like it did when I was stuck in figuring out the problem in running pytests. All you need is to step back from problem & relax, solution will come itself with time (as a new possibility) because our subconscious mind keeps on working on it, even when our conscious mind is relaxing!
Thank you for reading. Stay tuned to learn the cool stuff I am learning each week!