I am Nishant Bansal, an undergraduate student pursuing a Bachelor of Technology at IIT (BHU), India. While I am familiar with C and Python, I haven’t yet had the opportunity to develop a project using these languages. Recently, I explored the GRASS repository and found an interesting issue([Feat] Add JSON output to r.colors.out · Issue #3537 · OSGeo/grass · GitHub) that I would like to work on, which is similar to one in the GRASS GSOC 2024 project.
Before I dive deeper, I would appreciate your guidance on a few things:
Getting Started with Development: As I am new to development in C and Python, how should I begin contributing to GRASS? Are there any specific practices, workflows, or tools that I should learn to make the process smoother?
Testing Changes Locally: What is the best way to test my changes locally to ensure that nothing in the GRASS codebase is broken? Are there specific testing tools, guidelines, or common pitfalls I should be aware of when working with GRASS GIS?
Understanding GRASS: Could you point me to any additional resources, documentation, or tutorials that would help me better understand and run the GRASS repository? Tips on navigating the repo and understanding its structure would be extremely helpful.
I’m eager to learn and contribute to the GRASS repository, and I would greatly appreciate any guidance or advice you can offer.
You are very welcome to contribute to GRASS GIS! I have taken your questions as motivation to write an overview of the various documentations floating around
It is not meant to be a programming tutorial, but rather a collection of material. Suggestions are welcome.
Hi Markus,
thanks for this documentation collection, this comes in handy
I have a simple question, even if I could not identify the answer in any of the docs and style/contribution guides.
Are addons meant to be just python modules? Everywhere I look I only find references to python modules.
I have been asked to port a rockfall model into GRASS (yay, after a long long time ) and want it to stay in C. So I am currently looking into developing it as a “common” raster module. Is that the way I should go?
My understanding was that addons have the upside that you release them at your own pace and that you do not need a new grass release to get them out in the wild. But maybe it is more about them being in python?
Thanks for any input,
Cheers,
Andrea
PS: it is my first reply-on-specific-post on discourse, so I hope I didn’t pollute the original post.
Addons can definitely be in C/C++ too. On the top of my head, v.kriging recently had a PR to fix some compilation errors, and r.damflood had comments in Italian and had some work to be more universally understood.
Good catch! Addons can be written in Python, C or C++ (partly also in Fortran, Shell, …). I have added some examples in the section “Writing GRASS GIS Addons” of the blog post.
So, please stay in C, and yes, consider developing it as a “normal” raster module. As an addon your development pace is independent from the core release cycle. The only requirement is API compatibility (which we aim to maintain well). And, by adding some tests the CI (GitHub Actions) will check compatibility for you in your pull request.