Week-6: Gotta Cache 'em All!

Published: 07/08/2019

Hello folks,

So I am still implementing several methods of accessing filter data from SVO FPS - redesigning our old way of HDF storage. After implementing a module to access filter data using API, I've entered 1st time into the realm of caching! Now I'll create a module to cache the data on disk (for fast access obviously), so let me tell you how I'm going to cache 'em all 🙃 and what I completed until now...


What did I do this week?

  1. To contribute our query functions to access filter data from SVO FPS, following my previous work, I created a clean PR at Astroquery as per their API specification. They added it to their milestone so I think they will include this in their package. 
  2. There was a bunch of several tasks hanging around, that I finished this week:
    • As we have switched from readthedocs (RTD) to Github pages, my mentor told me to create redirect at our homepage of RTD docs to github pages. He had already setup it at our sister project TARDIS, so I understood his brilliant idea and how to use readthedocs, and successfully setup RTD redirects for our packages.
    • I removed python 2.7 support from our packages because it was becoming time-consuming to maintain both versions when we have a lot of important things to implement.
    • I also did some tweaks in the module I created last week (that fetch filter data using SVO API in real-time) to make it more package specific like removing the class structure (unlike what I did for Astroquery) & got it merged - my 1st entirely self-written module in our codebase, oh yeah! 😊
  3. Besides having a module to access data in real-time, we decided to have another module that caches filter data (locally on disk) for fast access next time. So I opened a PR for it, & created  function that can download entire filter data and cache it on disk systematically (by storing data in a hierarchy of category-named folders).


What is coming up next?

Now I'll work further on this PR to finish up with cache_filters module by adding more functions to read & update the cache, tests & documentation, etc. Also I'll try to make sure that both of our packages work robustly, before we can move on to interface developing part.


Did I get stuck anywhere?

While creating RTD redirects, it was using cached environment instead of updated one, in each build. I even didn't find anything relevant to this problem on internet! After a lot of trials, I came up with a workaround of changing the default branch that finally fixed it. Also I got quite confused on how will I make use of functions I created in previous module in this new cache_filters module. But after having a thorough discussion with my mentor, he resolved my dilemma by clearing out what this module needs to do.


What was something new I did and what I learned?

📃 Documentation setup on readthedocs.io: Though I worked on redirecting our docs from RTD to Github pages, but this task required me to build docs successfully on RTD using a dedicated branch for redirect (hollowed up docs). Hence I learned the entire process of docs setup on RTD from how to change default branch from Admin settings (in RTD project account) to creating a readthedocs.yml file for configuring the build.

🚧 Right way to open a work-in-progress PR: Earlier I used to believe that unless there isn't something presentable in your code, you shouldn't create a PR. But my mentor told me that I can create a PR even with a rough prototype, by using the checklists for indicating work progress in the PR. It's a really great feature, each time you finish off a task, check it off the list and bonus - get the feel! 😌


Thank you for reading. Stay tuned to know about my upcoming experiences!