paint-brush
There's No Feeling Like Making Your First Contribution to a Github Open Source Projectby@kamalsamaila
New Story

There's No Feeling Like Making Your First Contribution to a Github Open Source Project

by Kamal samailaDecember 24th, 2024
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Python library Anastruct lacks a way to directly view the stiffness matrix of individual elements in a structure. The author wrote a method to retrieve and return this matrix for each element in the structure. He submitted his first pull request to the maintainers of the project, and it was accepted.
featured image - There's No Feeling Like Making Your First Contribution to a Github Open Source Project
Kamal samaila HackerNoon profile picture

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.

The Idea: Bridging a Gap

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.

Taking the Leap: Writing My First Contribution

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.

The Development Process

  1. Research and Implementation: I started by diving deep into Anastruct’s codebase to understand its structure. The method I wrote leveraged existing geometry and material property definitions in the library to access and return the stiffness matrix for a given element ID.
  2. Testing: I tested my code on a variety of truss structures to ensure accuracy. The matrix output aligned with theoretical calculations, confirming that my method worked as intended.
  3. Submitting the Pull Request: Crafting the pull request was nerve-wracking. I described the problem, the feature, and its implementation, and pushed it to GitHub, hoping for the best.

Feedback and Iteration

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.

The Merge Moment

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.

Impact and Lessons Learned

  1. Impact on Anastruct: The stiffness matrix functionality I added makes Anastruct even more versatile, allowing users to gain deeper insights into their structural models.
  2. Personal Growth: This experience taught me the importance of perseverance, attention to detail, and collaboration. It also boosted my confidence to contribute to other open-source projects.

Advice for Aspiring Contributors

  1. Start Small: Begin with a feature or fix that aligns with your skills.
  2. Read the Docs: Familiarize yourself with the project’s contribution guidelines.
  3. Seek Feedback: Maintain an open mind and learn from reviewers.

Conclusion

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.