Contributing to open source has always seemed like an intimidating leap. For years, I admired projects like Anastruct, a Python library for preliminary structural analysis, for their power and elegance. Recently, I had the chance to step into this world myself — and to my surprise, my very first pull request was accepted! Here’s the story of how I added a method to retrieve and return the stiffness matrix of a structure, and what I learned along the way.
This journey started while I was helping a student develop Python code for a structural analysis project. The task was to analyze a truss roof resting on retaining walls. The project required determining the displacements of the truss, shear and bending moments in the walls, and lateral loads acting on the structure. The examiner wanted the student to display the stiffness matrix for each element in the structure.
While Anastruct already offers powerful features like defining geometry, setting material properties (e.g., EA and EI), and generating displacement, shear, and bending moment plots, it lacked a way to directly view the stiffness matrix of individual elements. This missing functionality inspired me to act. I decided to implement a method that could return the stiffness matrix when provided with an element ID.
Although I’ve used Anastruct for over three years and admired its utility in preliminary analysis and validation tasks, contributing to such an established library felt daunting. I wasn’t sure if the maintainers would accept my idea or if my implementation would meet their standards. Despite my hesitation, I toot the next step, that is implementation.
To my delight, one of the maintainers responded within a few days. They appreciated the value of my contribution but flagged some issues, including linting errors and type mismatches. I took their feedback seriously, quickly making the necessary corrections.
Two weeks later, I received the news: my pull request had been merged! The joy of seeing my code become part of a library used by engineers worldwide was indescribable. What began as a way to help a student turned into a meaningful open-source contribution.
Contributing to Anastruct not only helped me grow as a developer but also allowed me to give back to a project I’ve relied on for years. If you’ve ever considered contributing to open source, don’t let doubt hold you back. Your ideas and skills might be exactly what a project needs.