Another Google Summer of Code is coming to an end, and we are happy to report that both GRASS projects finished successfully. Over the summer, Kaushik Raja and Saket Kumar Mall worked with their mentors on two very different parts of GRASS: making raster processing faster on multi-core machines, and bringing time series into the graphical interface. Between them they contributed more than 30 merged pull requests.
This was also the first year GRASS took part under the NumFOCUS umbrella organization rather than OSGeo, following our change of fiscal sponsor. GRASS remains an OSGeo project, and we are grateful to OSGeo for many years of hosting our GSoC participation. Our thanks go to the NumFOCUS GSoC organizers for a smooth first season.
Two more GRASS tools now use multiple cores of your machine instead of just one: r.param.scale and r.geomorphon. Both take the usual nprocs option, and both stay within the memory limit you give them. How much you gain depends on your hardware and on the settings. r.geomorphon scales close to linearly with the number of threads. r.param.scale depends strongly on the size of the analysis window: the larger the window, the more of the total time is spent in the computation that runs in parallel rather than in reading and writing the map, so small windows see a modest speedup and large ones considerably more.

The third tool, r.proj, is the most ambitious one and is not finished yet. Reprojection is harder to parallelize than a neighborhood operation, because the output rows of a strongly curved projection can need input from all over the source map rather than from a matching band of it. Kaushik got there, with benchmarks showing a solid speedup that again varies with the machine, the projection pair and the memory setting, but the changes are substantial enough that they need review from more of our developers before we merge them. That review is under way and will continue past the end of the summer.
Some of the summer went into problems that had nothing to do with the new parallel code: a data race in the math library that had been sitting there since 2012, a second race in the projection library, and a crash in r.geomorphon on regions smaller than the search window.
Those detours are, in the end, a good part of what the project delivered: two long-standing races fixed, a crash fixed, and the old test suites of r.geomorphon and r.proj replaced with pytest tests that check the parallel result against the serial one. All of that is merged and benefits every user of those tools, whether or not they ever pass nprocs.
GRASS has a rich temporal framework with space-time datasets and a whole family of tools to register, query, aggregate and analyze them. So far these have been used mostly from the command line and from Python. In the GUI, space-time datasets were not yet first-class citizens: the Data Catalog listed rasters, vectors and 3D rasters, and nothing temporal.

That has changed. Space-time datasets now show up in the Data Catalog next to regular maps, with their own icons and with the maps they contain listed underneath them. You can create, rename, update, delete, export and merge datasets, register and unregister maps, look at temporal extents and metadata, display individual maps, and search across datasets, all from the context menu. Animation is better integrated, too: animation tool can now be docked as a tab in the main GUI instead of opening its own separate window.
Much of the work went into the layer below the GUI, where loading the datasets turned out to be slower than it should be. Tracking down why and fixing it took a good part of the summer, and as a result, mapsets holding many datasets now list much faster than they did. Along the way a good number of temporal tools gained JSON output, so the project pays off even if you never open the GUI: they now hand Python real data structures instead of text to parse, and asking for statistics over a time series is just:
from grass.tools import Tools
tools = Tools()
for entry in tools.t_rast_univar(input="nc_lst_daily", format="json"):
print(entry["start"], entry["mean"])
Saket also ran into the ordinary reality of working in a large project, and seemed to rather enjoy it: “Sometimes, while trying to solve one issue, you discover another problem that needs to be fixed first before you can continue with your original task. This is actually one of the things I enjoy most about open source. It provides a realistic glimpse into how real-world software projects operate.”
Kaushik and Saket, congratulations, and thank you for a great summer! 🎉 Mentors, thank you for your time and patience! 🙌 Both contributors have said they intend to stick around, which is the outcome we hope for most.
Most of this work is already in the development version and will be part of an upcoming release, and the rest is in review. Testing and feedback are very welcome, and reviewers even more so.
Mentoring time for these projects was supported in part by the U.S. National Science Foundation award #2303651.
Anna Petrasova and the GRASS Development Team