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

Update get_warming_level #215

Merged
merged 4 commits into from Jun 22, 2023
Merged

Update get_warming_level #215

merged 4 commits into from Jun 22, 2023

Conversation

aulemahal
Copy link
Collaborator

@aulemahal aulemahal commented Jun 20, 2023

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?

Updates and modifications to get_warming_level:

  • driving_institution is never needed. If "model" has not matched any column as-is, it tries again with requested_model.endswith(model).
  • Change of the internal data to a list of dicts. Thus dicts are added to accepted inputs.
  • List inputs can be of mixed types (not really useful, but a cool side-effect)
  • Matches are done field by field, instead of the whole model name at once
  • A few esthetical and nitpicky code changes
  • If the output is a dict, the key is the name of the selected model, not the requested string.

Does this PR introduce a breaking change?

Maybe this last point is breaking... If two requested models match to the same column, then the output doesn't have the same length as the input.

Other information:

I think this means we can drop driving_institution from the official columns. (We could keep it in our CORDEX catalogs though).

xscen/extract.py Show resolved Hide resolved
xscen/extract.py Outdated Show resolved Hide resolved
xscen/extract.py Show resolved Hide resolved
xscen/extract.py Show resolved Hide resolved
@aulemahal aulemahal merged commit e0b15ce into main Jun 22, 2023
9 checks passed
@aulemahal aulemahal deleted the refac-wlevel branch June 22, 2023 18:57
@aulemahal aulemahal mentioned this pull request Oct 5, 2023
6 tasks
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.

None yet

3 participants