[Week 1] Setup the project and Setup-Helpers!

First week of the coding period!

Summary

Details

I spent a significant portion of this week planning the structure of the code. First the project structure itself, and then later the test cases. One of my targets was to make sure the code was modular and readable. I refactored and renamed till I was happy with the structure.

And then I refactored some more :)

Thankfully I had implemented a large portion of the code while I was writing the proposal, so I had a pretty good idea of what the final product should look like, so the planning was easy.

Once I started coding in earnest, implementing the helpers was simple enough. First came the parse method, to read a bunch of room events and extract a relevant and simplified corpus out of them. Of course, I wrote tests for and documented all code I wrote.

Before tackling the next helper method, I took a short detour and refactored a couple of methods to generalize and improve performance.

With that taken care of, I started working on the invert method, which was, thanks to Python, only about 5 lines long. Then came its tests, which took just slightly longer to complete.

Then I requested a review from my mentor @cvwright. With his review he helped me improve the parse method to prevent loss of significant "mega" tokens such as user mentions (@like:this.com) and room mentions (#this:is-a.room). The PR was merged shortly after that.

Next I quickly added a GitHub Actions workflow for CI to ensure the code is formatted properly and passing tests.

Once that was done, I worked on the calculate_parameters method, which simply determines the index and level parameters.

Comments

Popular Posts