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

Optimize computation of timeseries statistics through multiprocessing #1492

Open
wants to merge 8 commits into
base: main-dev
Choose a base branch
from

Conversation

lewisblake
Copy link
Member

@lewisblake lewisblake commented Jan 24, 2025

Change Summary

Timeseries were computed independently and in serial by looping over the regions. This PR parallelizes this for loop using multiprocessing. To that end, implements a function in pyaerocom/aeroval/coldatatojson_helpers.py, _process_statistics_timeseries_single_region, to compute the timeseries for a specific region, and uses multiprocessing in pyaerocom/aeroval/coldatatojson_engine.py to call this function. I also corrected some type hints.

Related issue number

Partly addresses #1277

Checklist

  • Start with a draft-PR
  • The PR title is a good summary of the changes
  • PR is set to AeroTools and a tentative milestone
  • Documentation reflects the changes where applicable
  • Tests for the changes exist where applicable
  • Tests pass locally
  • Tests pass on CI
  • At least 1 reviewer is selected
  • Make PR ready to review

Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 53.84615% with 6 lines in your changes missing coverage. Please review.

Project coverage is 78.44%. Comparing base (9591a7d) to head (1fab191).
Report is 17 commits behind head on main-dev.

Files with missing lines Patch % Lines
pyaerocom/aeroval/coldatatojson_helpers.py 14.28% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           main-dev    #1492      +/-   ##
============================================
- Coverage     78.46%   78.44%   -0.02%     
============================================
  Files           139      139              
  Lines         21119    21130      +11     
============================================
+ Hits          16570    16576       +6     
- Misses         4549     4554       +5     
Flag Coverage Δ
unittests 78.44% <53.84%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lewisblake
Copy link
Member Author

Note afabd57 contains the changes to parallelize the computations of the heat maps and scatter plots which were deemed outside of the scope of this PR in Pyaerocom Meeting 2025-01-27. This is because it requires parallel writing of files, which is a thorny problem we can't currently handle in aerovaldb. I'm keeping note of the commit here in case we want to revisit this problem.

@lewisblake lewisblake added the performance 🏎️ Excessive use of time or memory label Jan 27, 2025
@lewisblake lewisblake added this to the m2025-02 milestone Jan 27, 2025
@lewisblake lewisblake self-assigned this Jan 27, 2025
@lewisblake lewisblake requested a review from heikoklein January 27, 2025 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance 🏎️ Excessive use of time or memory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant