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

Add --show-schema support to drivers #588

Merged
merged 26 commits into from
Aug 23, 2024

Conversation

maddenp-noaa
Copy link
Collaborator

@maddenp-noaa maddenp-noaa commented Aug 22, 2024

Synopsis

Add --show-schema flag to UW drivers to dump to stdout a dereferenced form of a built-in driver's built-in schema. Here, "dereferenced" means that $ref references pointing to urn:uwtools:* URIs have been replaced by the schema content they refer to, so that the schema shown is standalone and complete.

Don't Panic: Several small, repeated changes to code and docs constitute the bulk of the PR.

Type

  • Documentation
  • 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 22, 2024
@maddenp-noaa maddenp-noaa marked this pull request as ready for review August 23, 2024 03:23
Copy link
Collaborator

@NaureenBharwaniNOAA NaureenBharwaniNOAA left a comment

Choose a reason for hiding this comment

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

This looks great! Bundling definitely is a great technique for maintainability and efficiency.

Copy link
Collaborator

@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.

This is going to be so helpful for understanding how to formulate YAMLs for drivers!

@maddenp-noaa
Copy link
Collaborator Author

maddenp-noaa commented Aug 23, 2024

@christinaholtNOAA

This is going to be so helpful for understanding how to formulate YAMLs for drivers!

I hadn't even thought of that use case -- great insight! Our prototype YAML files show some of the config options, but the schema tells much more of the story. We've discussed the tradeoff between strict/complete schemas for e.g. namelist content and more permissive ones, and I think this use case lends even more weight to the script/complete argument, in that a schema with more information is a better guide to figuring out what one's options are.

@maddenp-noaa maddenp-noaa merged commit 6273086 into ufs-community:main Aug 23, 2024
2 checks passed
@maddenp-noaa maddenp-noaa deleted the extract-schema branch August 23, 2024 21:32
Byrnetp added a commit that referenced this pull request Sep 3, 2024
* update_values() -> update_from() (#578)

* DRY out Driver._validate() (#579)

* Move execute() to its own API namespace, disambiguate (#580)

* Config classes to API (#582)

* Simplify unknown-extension error message (#584)

* UW-657 fs makedirs (#572)

* Docstring cleanup (#585)

* GH 586 bad stdin_ok prompt (#587)

* Fix issue with creating a metatask dep. (#589)

The rocoto schema is set up to allow metataskdep entries in the YAML, but the logic was not included in the tool to handle them. This addition fixes that.

* Add --show-schema support to drivers (#588)

* add file system notebook, unit tests, binder links

* Add missing newlines

* Add a table of contents

* Makefile and .gitignore changes from review

* Apply suggestions from code review

Co-authored-by: Paul Madden <136389411+maddenp-noaa@users.noreply.github.com>

* Apply review suggestions to all sections of the notebook

* Specific rmtree() targeting and output cell test update

* Apply suggestions from code review

Co-authored-by: Paul Madden <136389411+maddenp-noaa@users.noreply.github.com>

---------

Co-authored-by: Paul Madden <136389411+maddenp-noaa@users.noreply.github.com>
Co-authored-by: Christina Holt <56881914+christinaholtNOAA@users.noreply.github.com>
Byrnetp added a commit that referenced this pull request Oct 17, 2024
* update_values() -> update_from() (#578)

* DRY out Driver._validate() (#579)

* Move execute() to its own API namespace, disambiguate (#580)

* Config classes to API (#582)

* Simplify unknown-extension error message (#584)

* UW-657 fs makedirs (#572)

* Docstring cleanup (#585)

* GH 586 bad stdin_ok prompt (#587)

* Fix issue with creating a metatask dep. (#589)

The rocoto schema is set up to allow metataskdep entries in the YAML, but the logic was not included in the tool to handle them. This addition fixes that.

* Add --show-schema support to drivers (#588)

* Config notebook p2 and example notebook removal

* removing merge diff text

* pin python version for RtD

* improvements from code review

* add config.compare() format mismatch example

* Remove typo

Co-authored-by: Emily Carpenter <137525341+elcarpenterNOAA@users.noreply.github.com>

---------

Co-authored-by: Paul Madden <136389411+maddenp-noaa@users.noreply.github.com>
Co-authored-by: Christina Holt <56881914+christinaholtNOAA@users.noreply.github.com>
Co-authored-by: Emily Carpenter <137525341+elcarpenterNOAA@users.noreply.github.com>
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