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

Better get_warming_level #269

Merged
merged 1 commit into from
Oct 5, 2023
Merged

Better get_warming_level #269

merged 1 commit into from
Oct 5, 2023

Conversation

aulemahal
Copy link
Collaborator

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
    • This PR fixes #xyz
  • (If applicable) Documentation has been added / updated (for bug fixes / features).
  • (If applicable) Tests have been added.
  • This PR does not seem to break the templates.
  • HISTORY.rst has been updated (with summary of main changes).
    • Link to issue (:issue:number) and pull request (:pull:number) has been added.

What kind of change does this PR introduce?

In #215, I used pd.Series.str.match to find models in the global tas dataset. However, match will return a match even if only the beginning of the string matches the pattern.

For example: looking for "EC-Earth3" would match for "EC-Earth3-CC". This resulted in some models getting multiple matches even though an exact match existed.

This PR switches to fullmatch which ensures the full string matches, which I'm pretty sure is the expected behaviour when regex is not used. If needed, the previous behaviour can be obtained by adding "." to the query (like "EC-Earth3.").

Does this PR introduce a breaking change?

Yes and no. I think the new behaviour is the proper one.

@aulemahal aulemahal requested a review from RondeauG October 5, 2023 20:42
@aulemahal aulemahal merged commit d1a64e2 into main Oct 5, 2023
@aulemahal aulemahal deleted the better-get-wl branch October 5, 2023 21:01
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