Skip to content

Allow GlobalBias to take projection and color palette as arguments #2036

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

silviacaprioli
Copy link
Collaborator

PR description:

This PR adds the possibility to choose different projections and color palettes in bias maps.
This is particularly useful for SeaIce diagnostic.

Issues closed by this pull request:

Close #1460

People involved:

Tag here relevant people to involve in the discussion:

@tovaz92

Please leave the checkboxes that apply to this pull request.
If you find a missing checkbox, please add it to the list.
Make sure to complete the checkboxes before applying the "ready to merge" label.
Please apply the "run tests" label if you want to trigger CI tests.

  • Tests are included if a new feature is included.
  • Documentation is included if a new feature is included.
  • Docstrings are updated if needed.
  • Changelog is updated.
  • Notebooks which requires changes are updated.
  • environment.yml and pyproject.toml are updated if needed, together with the lumi installation tool.
  • Diagnostic config files path are updated in the console if needed

@silviacaprioli silviacaprioli self-assigned this Jul 2, 2025
@silviacaprioli silviacaprioli added diagnostic improvement Improvement to existing functionality labels Jul 2, 2025
@silviacaprioli
Copy link
Collaborator Author

silviacaprioli commented Jul 4, 2025

Design question regarding how to pass projection types in global_biases.

  • Define the projection as a string in the config file, e.g. ccrs.Orthographic(central_longitude=0, central_latitude=90), and then use eval() to instantiate it, but this feels honestly a bit hacky.

  • Create a centralized file with predefined projections and use keywords in the config, which are then mapped to actual cartopy projections.

Option 2 feels cleaner, especially if multiple diagnostics will share this logic. The only tricky part is supporting optional arguments for some projections...

tagging @mnurisso @oloapinivad @jhardenberg for discussion

@silviacaprioli silviacaprioli marked this pull request as ready for review July 21, 2025 09:34
@silviacaprioli silviacaprioli requested a review from tovaz92 July 21, 2025 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagnostic improvement Improvement to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow GlobalBias to take projection and colorbar palette as arguments
1 participant