-
Notifications
You must be signed in to change notification settings - Fork 2
Dynamic checking of requirement steps in pipelines #122
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
base: main
Are you sure you want to change the base?
Conversation
| if not req_satisfied: | ||
| raise ValueError(f"Rule {self.name} does not satisfy requirement {rr}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should gather all requirements, instead of exiting at the first one.
| if f"_satisfies_{self.requirement_name}" in line: | ||
| if str(self.requirement_value) in line: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
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") |
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....