What is Google Summer of Code (GSoC) anyway?

GSoC is a Google-sponsored program designed to generate interest in and further the development of open-source software projects. Google provides a modest stipend to ‘Contributors’ who are selected by mentor organizations to contibute to their projects over the summer. Summer 2022 is the first time GSoC has been open to everyone, not just enrolled students, which I’m happy to be a beneficiary of!

How did I get here?

Honestly, Twitter. Sometime in February 2022 I had become interested in the open-source geospatial stack. I found this spatial analytics with python course by Henrikki Tenkanen and started working through the lessons. This work introduced me to geopandas; I was quckly impressed with the package and started following Martin Fleischmann on Twitter. Luckily for me, he posted about the PySAL GSoC projects and I found one that seemed to be an excellent fit! Despite being a serial internet-lurker and having strong feelings of technical inadequacy, I decided to engage with the community (the horror!) and express my intrest in the spatial optimization library enhancements. After chatting a bit with Germano Barcelos, the GSoC 2021 spopt student, and receiving encouragement and feedback from the spopt mentors, my proposal was submitted!

Accepted! Now the pre-coding Community Bonding Period

After the initial shock of being accepted wore off, all of the PySAL students were encouraged to introduce themselves to the community on the PySAL gitter. I also reached out to my mentors James Gaboardi, Levi Wolf, and Qunshan Zhao to clear up some environment configuration questions I had and to see how/where they wanted to communicate for the summer. There are four GSoC students this year working on PySAL and two of us are non-student ‘freelance’ types–awesome! The community bonding period technically runs for three weeks, from May 20 to June 12. I spent most of my time setting up my development environment, tracing through the spopt library, studying, studying, studying, and attending my first PySAL Dev meeting! The week before the coding period began I met with Levi and James for our weekly meeting. It was very productive–they walked me through how the spopt library is organized and helped me understand how to begin approaching the problem. They suggested building a script that solves the LSCPB problem and once I had a solution, we could implement that into the library!

Coding begins! Phase 1.1 - Implement LSCPB

My first task was to implement LSCPB in the spopt library. Though I had been studying a great deal leading up to the coding period, I was still very nervous about the implementation; there is a lot to learn when you’re new to optimization, pulp solvers, github, git, object-oriented programming (OOP), and probably other things I’m forgetting! Having the experience of bootstrapping and operating a small business, I’m accustomed to stretching myself and working through challenging tasks, so I was confident I would succeed. It may be hard, but I wouldn’t fail. Knowing that certainly helped!

Coding - Week 1

Leading up to my first meeting of the coding phase I was sort of panicking–oh no, I’ve been working on this for days and I don’t feel like I’m making the progress necessary to stay on track with the program timeline! Cue the sending of a slightly paniced gitter message to my mentors requesting assistance in our meeting the next day. I wanted to be sure they’d be primed to help me ahead of the meeting if I still hadn’t made progress by then. Thankfully after a few extra hours of work, I was getting more confident that I had actually built the pulp problem properly (at least, mostly)! The meeting went well and the mentors were very generous toward me and the work I had done. They also provided feedback on github best practices and the next steps I needed to take for solving LSCPB.

Coding - Week 2

My coding week was much less chaotic and stressful for week two. Much of my time was spent reviewing different formulations for solving LSCPB, integrating a solved LSCP into my development notebook so that I could use the solution as a constraint in the LSCPB problem formulation, and fiddling with my notebook to ensure I had the LSCPB solved properly. During our weekly meeting we discussed how some of my challenges were related to my lack of experience with OOP. Qunshan was able to give me access to datacamp’s Object-Oriented Programming in Python course–a total life saver! Simply working through the first half of the course gave me the knowledge needed to really understand the spopt base.py and coverage.py files with clarity, and everything became quite a bit easier after this point. I also want to say I have done a lot of paid and free online courses in the past, and I found datacamp to be very well designed. I highly recommend it!

Coding - Week 3

During week 3 my mentors encouraged me to continue upskilling on OOP and try implementing my new knowledge in the spopt package! To do this I decided to create a new branch of the package and clone it to work on locally. To begin I had a bit of a silly workflow because I didn’t know how to set up my development environemt to ‘see’ my locally installed package that I was making continuous changes to. It went a bit like this: I had the spopt files opened in VS Code, I made changes to them, relized I had no idea how to test my code, copy/pasted my new LSCPB class and methods into my notebook, and tested everything there. Not exactly efficient! More experienced developers are very familiar with these workflows, but this was my first time and I was making it up as I went along. The spopt team is awesome and as soon as I reached out with questions on the local development workflow I received advice and assistance. Germano even met with me online after I had to ask for additional assistance because I wasn’t seeing my new class added when I tried accessing spopt from python. Turns out I was installing the package perfectly fine, but the new class needed to be added to the init.py file in order to be loaded in! I never would have figured it out on my own. Having access to mentors has really helped to work through some of the more quirky issues of programming that would normally cause me to hit a wall, unable to receive assistance.

Thankfully once my development environment got sorted I was able to work out the final major kinks in my code and make my first pull request ever! I was so excited to make the pull request (PR). I worked really hard to implement the new model and it was nice to have the feeling of accomplishment early on in the summer. There are a few review items I was able to quickly resolve in my PR, including adding an additional attribute to the LSCPB class and installing and running Black on the files, but I’m still working to implement the larger items like creating tests and a demo notebook for the PySAL users.

What’s next?

Once I’ve completed all of my LSCPB pull request tasks I’ll move on to implementing the P-Dispersion model! More on that in the future!


<
Blog Archive
Archive of all previous blog posts
>
Next Post
GSoC ‘22 Phase 1.1 continued…