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

Improve xtrigger validation #60

Merged
merged 3 commits into from
Feb 20, 2024
Merged

Conversation

MetRonnie
Copy link

@MetRonnie MetRonnie commented Feb 16, 2024

Enhancement for cylc#5955

@MetRonnie MetRonnie mentioned this pull request Feb 16, 2024
8 tasks
@MetRonnie
Copy link
Author

MetRonnie commented Feb 16, 2024

Integration test failures unrelated - cylc#5977

Comment on lines +348 to +350
bound_args.apply_defaults()
try:
xtrig_validate_func(bound_args.arguments)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this approach, people writing xtrigger validate functions don't have to worry about whether an argument is positional and/or keyword (the original xrandom.validate example was flawed because it didn't account both cases under the previous system)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I like it.

@wxtim wxtim merged commit 933b273 into wxtim:xtrig-arg-validate Feb 20, 2024
1 check failed
@MetRonnie MetRonnie deleted the xtrig branch February 20, 2024 11:27
wxtim added a commit that referenced this pull request Feb 28, 2024
* Xtrigger function arg validation.
* Add integration tests for xtrigger validation, which provides simple examples for each of the built in xtriggers.
- Xrandom validate function
- Init test xrandom validate function
- Add unit tests for validation of built in xtriggers
- Automatically validate xtrigger function signature

---------

Co-authored-by: Hilary James Oliver <[email protected]>

* Apply suggestions from code review

Co-authored-by: Ronnie Dutta <[email protected]>

* fix flake8

* Improve xtrigger validation (#60)

* Improve xtrigger validation

* wall_clock: use placeholder function for signature validation & autodocs

* Fix docstring for autodoc [skip ci]

---------

Co-authored-by: Hilary Oliver <[email protected]>
Co-authored-by: Ronnie Dutta <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants