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

UW-656 Run-time checks for bad uw execute arguments #566

Merged

Conversation

maddenp-noaa
Copy link
Contributor

Synopsis

Old behavior:

$ uw execute --module /home/maddenp/execute/rand.py --classname Rand --task randfile --config-file /home/maddenp/execute/rand.yaml --cycle 2024-08-05T12 --leadtime 6 --batch
[2024-08-08T21:16:52]     INFO 0 UW schema-validation errors found
[2024-08-08T21:16:52]     INFO rand Random-integer file: Initial state: Not Ready
[2024-08-08T21:16:52]     INFO rand Random-integer file: Checking requirements
[2024-08-08T21:16:52]     INFO rand Random-integer file: Requirement(s) ready
[2024-08-08T21:16:52]     INFO rand Random-integer file: Executing
[2024-08-08T21:16:52]     INFO rand Random-integer file: Final state: Ready

This despite the fact that the Rand driver class (an minimal example class I'm working with for the UW-649 documentation task) inherits from AssetsTimeInvariant and so does not accept the cycle, leadtime, or batch arguments. This could confuse users who supply these arguments expecting them to have some effect.

New behavior:

$ uw execute --module /home/maddenp/execute/rand.py --classname Rand --task randfile --config-file /home/maddenp/execute/rand.yaml --cycle 2024-08-05T12
[2024-08-08T21:18:42]    ERROR Rand does not accept argument 'cycle'
$ uw execute --module /home/maddenp/execute/rand.py --classname Rand --task randfile --config-file /home/maddenp/execute/rand.yaml --leadtime 6
[2024-08-08T21:18:54]    ERROR Rand does not accept argument 'leadtime'
$ uw execute --module /home/maddenp/execute/rand.py --classname Rand --task randfile --config-file /home/maddenp/execute/rand.yaml --batch
[2024-08-08T21:19:03]    ERROR Rand does not accept argument 'batch'

Type

  • Bug fix (corrects a known issue)
  • Enhancement (adds new functionality)

Impact

  • This is a non-breaking change (existing functionality continues to work as expected)

Checklist

  • I have added myself and any co-authors to the PR's Assignees list.
  • I have reviewed the documentation and have made any updates necessitated by this change.

@maddenp-noaa maddenp-noaa self-assigned this Aug 8, 2024
Copy link
Contributor

@christinaholtNOAA christinaholtNOAA left a comment

Choose a reason for hiding this comment

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

Nice addition!

@maddenp-noaa maddenp-noaa merged commit d15216c into ufs-community:main Aug 8, 2024
2 checks passed
@maddenp-noaa maddenp-noaa deleted the uw-656-run-time-checks branch August 8, 2024 22:22
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.

5 participants