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

Add check for the not-yet-implemented functionality of selecting variables from different coord levels in the same input dataset #65

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

Conversation

ealerskans
Copy link
Contributor

@ealerskans ealerskans commented Feb 7, 2025

Describe your changes

The current implementation of selection of variables by coordinate values does not, within one input dataset, support the selection of variables from different coordinate levels. E.g. the following selection

    variables:
      u:
        altitude:
          values: [100, 50, ]
          units: m
      v:
        altitude:
          values: [100, 75, ]
          units: m
      t:
        altitude:
          values: [30, ]
          units: m

would currently add u100m, u50m, v100m, v50m, t100m, t50m to the output dataset. So it results in missing variables ( v75m and t30m) but also adds extra variables (v50m, t100m and t50m), which all are just nans. Such a selection is something we would like to support but the current implementation does not.

Implementing the support of such a selection would require changes to the way that the selected (and derived) variables are collected (currently in one dataset before merging and dimension mapping). Until such a time, this PR adds a NotImplementedError exception in validate_config if one tries to do a selection of variables on different coordinate values within one input dataset. It also adds a section to the README with an explanation of the allowed selections and how to do the selection of variables on different coordinate values.

I have also added tests to check that the exceptions raised in validate_config are correctly caught.

No change in dependencies needed for this change.

Issue Link

Addresses #61.

Type of change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📖 Documentation (Addition or improvements to documentation)

Checklist before requesting a review

  • My branch is up-to-date with the target branch - if not update your fork with the changes from the target branch (use pull with --rebase option if possible).
  • I have performed a self-review of my code
  • For any new/modified functions/classes I have added docstrings that clearly describe its purpose, expected inputs and returned values
  • I have placed in-line comments to clarify the intent of any hard-to-understand passages of my code
  • I have updated the documentation to cover introduced code changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have given the PR a name that clearly describes the change, written in imperative form (context).
  • I have requested a reviewer and an assignee (assignee is responsible for merging)

Checklist for reviewers

Each PR comes with its own improvements and flaws. The reviewer should check the following:

  • the code is readable
  • the code is well tested
  • the code is documented (including return types and parameters)
  • the code is easy to maintain

Author checklist after completed review

  • I have added a line to the CHANGELOG describing this change, in a section
    reflecting type of change (add section where missing):
    • added: when you have added new functionality
    • changed: when default behaviour of the code has been changed
    • fixes: when your contribution fixes a bug

Checklist for assignee

  • PR is up to date with the base branch
  • the tests pass
  • author has added an entry to the changelog (and designated the change as added, changed or fixed)
  • Once the PR is ready to be merged, squash commits and merge the PR.

@ealerskans ealerskans added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 7, 2025
@ealerskans ealerskans mentioned this pull request Feb 7, 2025
20 tasks
@ealerskans ealerskans marked this pull request as ready for review February 14, 2025 13:13
@ealerskans ealerskans changed the title Update the config validation with a check for selection of variables by coord values not yet supported Add check for the not-yet-implemented functionality for selection of variables from different coord levels in the same input dataset Feb 14, 2025
@ealerskans ealerskans changed the title Add check for the not-yet-implemented functionality for selection of variables from different coord levels in the same input dataset Add check for the not-yet-implemented functionality of selecting variables from different coord levels in the same input dataset Feb 14, 2025
@ealerskans ealerskans requested a review from leifdenby February 14, 2025 13:18
@ealerskans ealerskans self-assigned this Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant