Dynamic checking of requirement steps in pipelines#122
Draft
Conversation
pgierz
commented
Mar 18, 2025
Comment on lines
+231
to
+232
| if not req_satisfied: | ||
| raise ValueError(f"Rule {self.name} does not satisfy requirement {rr}") |
Member
Author
There was a problem hiding this comment.
Maybe this should gather all requirements, instead of exiting at the first one.
pgierz
commented
Mar 18, 2025
Comment on lines
+57
to
+58
| if f"_satisfies_{self.requirement_name}" in line: | ||
| if str(self.requirement_value) in line: |
Member
Author
There was a problem hiding this comment.
I'm not terribly convinced by this, it requires that the name and value are strictly defined to be on the same line. That might not be the best way of doing it.
Member
Author
|
This technically does what it is supposed to, but we need to discuss the implications of the crosschecking function. At the moment, everything fails because none of our steps implement the cell_methods described in the integration tests. I think we could do something "dirty" like this: def maybe_mask_fesom(data, rule):
_satisfies_cell_methods = "area: mean where sea"
if "fesom" in data.attrs:
return data
else:
raise ValueError("No idea how to mask the ocean") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checks if the pipelines attached to a rule fulfill in any way some tagged requirements.
Requirements look like this in the steps:
A
stepcould satisfy multiple requirements. These should be internal variables, and might be used, but I think that they probably should just be used for checking.A
RuleRequirementhelper class is available inrule.py, which is used to parse the requirements. Then, each step of each pipeline is checked for such tags:I think that the checking method could use a better name, suggestions are welcome.
This idea is still untested, just a starting point for discussion....