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

Use map_freqs in ModelMapsEngine #1268

Merged
merged 4 commits into from
Jul 22, 2024
Merged

Conversation

lewisblake
Copy link
Member

@lewisblake lewisblake commented Jul 16, 2024

Change Summary

Pass the correct maps_freq in ModelMapsEngine.

Related issue number

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

@lewisblake lewisblake added this to the m2024-08 milestone Jul 16, 2024
Copy link

codecov bot commented Jul 16, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 78.96%. Comparing base (816b2cc) to head (1bf6fc2).
Report is 506 commits behind head on main-dev.

Files with missing lines Patch % Lines
pyaerocom/aeroval/modelmaps_engine.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           main-dev    #1268      +/-   ##
============================================
- Coverage     79.34%   78.96%   -0.39%     
============================================
  Files           133      133              
  Lines         20421    20599     +178     
============================================
+ Hits          16204    16265      +61     
- Misses         4217     4334     +117     
Flag Coverage Δ
unittests 78.96% <87.50%> (-0.39%) ⬇️

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

Looks like it is being passed down to the outputted config correctly as well:

  "modelmaps_opts": {
        "maps_freq": "monthly",
        "maps_res_deg": 5
    },

@lewisblake lewisblake requested a review from heikoklein July 16, 2024 12:41
@lewisblake lewisblake marked this pull request as ready for review July 16, 2024 12:41
Copy link
Member

@heikoklein heikoklein left a comment

Choose a reason for hiding this comment

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

The fix looks good, but I am worried that this will break many configs where maps_freq wasn't given explicitly, e.g. https://aeroval.met.no/pages/infos/?project=cams2-83&experiment=forecast-current-season has daily maps.

I suggest that maps_freq has a default of the currently used min(time_cfg.freqs, main_freq) rather than "monthly".

@lewisblake
Copy link
Member Author

lewisblake commented Jul 22, 2024

The CAMS2_83 case brings up a good point, the Literal["monthly", "yearly"] type-hinting won't work if we need daily maps. The "monthly" default comes from the original default in this class, so it has supposedly always been the default, even if not implemented correctly. IIRC, this default comes from input from Augustin based on a concern that Aeroval in general becomes too slow showing contour maps for longer time series. I worry that if we set a default which is too fine, and people forget about this input when setting up their config, the compute time will significantly increase, and this will only become noticeable towards the end of the processing. I'll talk with Charlie a today about what his intention was when he last modified this piece of code.

@heikoklein
Copy link
Member

heikoklein commented Jul 22, 2024

Can't we get back to the de-facto default - rather than the never implemented literal default, e.g. use the coarsest resolution, e.g.
Literal["hourly", "daily", "monthly", "yearly", "coarsest"], default "coarsest", and if coarsest is selected, we keep the old code, i.e. min(ts_type)?

Copy link
Member

@heikoklein heikoklein left a comment

Choose a reason for hiding this comment

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

Do we have some public documentation of modelmap_opts->maps_freq, e.g. in https://pyaerocom.readthedocs.io/en/latest/aeroval-examples.html (i only see it in the API/developer documentation, but not in the user-documentation for config-files).

Copy link
Member

@heikoklein heikoklein 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 would love some docs for the config. (Maybe an issue of it's to create a fully documented config page?)

@lewisblake
Copy link
Member Author

No I don't see any documentation outside of the API documentation you mention. I agree, would love a full documented config. Config files are already a topic for the AeroTools workshop, and once more clearly defined, should be better documented.

@lewisblake lewisblake merged commit b9db658 into main-dev Jul 22, 2024
7 of 8 checks passed
@lewisblake lewisblake deleted the map_freq-1259-easy-solution branch July 22, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants