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

Allow easier setting of multiple warning levels for same criterion in DataValidator #439

Open
dc-almeida opened this issue Dec 17, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@dc-almeida
Copy link
Collaborator

dc-almeida commented Dec 17, 2024

IIRC, one of the suggested improvements was to change the write-up of multiple warning levels for the same validation criterion.
E.g.: currently, one would write:

- variable: Primary Energy
   year: 2010
   upper_bound: 5
   lower_bound: 1
- variable: Primary Energy
   year: 2010
   upper_bound: 2.5
   lower_bound: 1
   warning_level: low
- variable: Primary Energy|Coal
   year: 2010
   upper_bound: 5
   lower_bound: 1

This would mean "Primary Energy" would have two levels of warnings, error (by default) and low. But for that, the IamcDataFilter attributes (in this case, variable and year) have to be repeated for each level.

How would a better write-up look like? I leave an example below:

- variable: Primary Energy
  year: 2010
  warning_level:
    error:
      upper_bound: 5
      lower_bound: 1
    low:
      upper_bound: 2.5
      lower_bound: 1
- variable: Primary Energy|Coal
  year: 2010
  upper_bound: 5
  lower_bound: 1

In this case, I guess error could no longer be default, and would require quite a bit of refactoring.
Thoughts, @danielhuppmann @phackstock

@dc-almeida dc-almeida added the enhancement New feature or request label Dec 17, 2024
@dc-almeida dc-almeida self-assigned this Dec 17, 2024
@danielhuppmann
Copy link
Member

I think this example makes sense. An alternative, as food for thought, would be more explicit

- variable: Primary Energy
  year: 2010
  validation:
    - warning_level: error
      upper_bound: 5
      lower_bound: 1
    - warning_level: low
       upper_bound: 2.5
       lower_bound: 1
- variable: Primary Energy|Coal
  year: 2010
  upper_bound: 5
  lower_bound: 1

This might be easier to implement because "warning-level" attribute doesn't have to be abused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants