Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t.rast.univar/t.rast3d.univar: add support for multiprocessing #2624

Merged
merged 8 commits into from
Nov 14, 2022

Conversation

ninsbl
Copy link
Member

@ninsbl ninsbl commented Nov 3, 2022

This PR adds support for multiprocessing to python/grass/temporal/univar_statistics.py and ultimately to t.rast.univar and t.rast3d.univar.

A parallel testcase is added. However, thorough testing would be great!

Fixes #2590

@ninsbl ninsbl added enhancement New feature or request temporal Related to temporal data processing Python Related code is in Python labels Nov 3, 2022
@ninsbl ninsbl added this to the 8.3.0 milestone Nov 3, 2022
@BadAssassin
Copy link
Contributor

BadAssassin commented Nov 4, 2022 via email

Copy link
Contributor

@petrasovaa petrasovaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I have just a few small comments.


###############################################################################


def compute_univar_stats(row, stats_module, fs, rast_region=False):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand where the row came from, but it is rather weird as a function parameter name...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameter name and documentation updated in: 12eec61

def compute_univar_stats(row, stats_module, fs, rast_region=False):
"""Compute univariate statistics for a map of a space time raster or raster3d dataset

:param row: Must be "strds" or "str3ds"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like is must string "strds" or "str3ds", so probably just drop the quotes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated docstring in 12eec61

Comment on lines 218 to 219
pool.close()
pool.join()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe these are not doing anything here, close and join would be useful for starmap_async.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in: 12eec61

@ninsbl ninsbl merged commit af6b394 into OSGeo:main Nov 14, 2022
ninsbl added a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
…#2624)

* add multiprocessing

* implement suggestions from review
marisn pushed a commit to marisn/grass that referenced this pull request Jun 2, 2023
…#2624)

* add multiprocessing

* implement suggestions from review
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
…#2624)

* add multiprocessing

* implement suggestions from review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Python Related code is in Python temporal Related to temporal data processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat] t.rast.univar: implement parallelization
3 participants