Skip to content

Fetch error bounds using compression-recommendations - #82

Merged
treigerm merged 11 commits into
mainfrom
recommendations
Oct 15, 2026
Merged

treigerm merged 11 commits into
mainfrom
recommendations

Conversation

@juntyr

@juntyr juntyr commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator
  • update to next compression-recommendations version
  • update to published ensemble bounds from Zenodo
  • decide what to do about error bound changes, which were previously rounded (if we round, we should round down)

@juntyr juntyr changed the title [WIP] Fetch error bounds using compression-recommendations Fetch error bounds using compression-recommendations Oct 9, 2026
@juntyr
juntyr marked this pull request as ready for review October 12, 2026 03:58
@juntyr
juntyr requested a review from treigerm October 12, 2026 03:58

@treigerm treigerm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just have two small nits but otherwise LGTM!

get_agb_bound(datasets, percentiles=[1.00, 0.99, 0.95])
get_error_bounds(
Recommendations(
recommendations=compute_agb_recommendations(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would be cleaner to let compute_agb_recommendations and compute_no2_recommendations directly return a Recommendations object so that main loop is more concise. Also makes it nicely consistent with the function names.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good idea

else:
raise ValueError(f"Unknown error bound type: {error_bound_type}")
try:
requirements = [

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So if I understand correctly this effectively checks whether the variable is available on pressure levels and a KeyError is raised when there is no variable with era5_var on pressure levels? I think a short comment here would be helpful to clarify that the try-except block is used for this purpose.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I've made it even more explicit by passing into the function whether we need single-level or pressure level requirements

@juntyr

juntyr commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

@treigerm Thanks for the review, please feel free to squash and merge

@treigerm
treigerm merged commit 9eb084f into main Oct 15, 2026
6 checks passed
@juntyr
juntyr deleted the recommendations branch October 15, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants