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

Better support for realizing scalar YAML values #512

Merged
merged 6 commits into from
Jun 19, 2024

Conversation

maddenp-noaa
Copy link
Contributor

Synopsis

Add YAML configuration to omit ... end-of-stream marker when dumping scalar values. For example:

Old behavior:

(DEV-uwtools) ~/git/uwtools ∴ echo "{foo: {bar: baz}}" | uw config realize --input-format yaml --output-format yaml --key-path foo.bar
baz
...

New behavior:

(DEV-uwtools) ~/git/uwtools ∴ echo "{foo: {bar: baz}}" | uw config realize --input-format yaml --output-format yaml --key-path foo.bar
baz

This supports easier lookups of single values from input configs.

Works for e.g. namelist inputs, too:

(DEV-uwtools) ~/git/uwtools ∴ echo "&nl res = 768 /" | uw config realize --input-format nml --output-format yaml --key-path nl.res
768

Type

  • 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 Jun 18, 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.

LGTM!

Copy link
Contributor

@WeirAE WeirAE left a comment

Choose a reason for hiding this comment

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

LGTM

@maddenp-noaa maddenp-noaa marked this pull request as ready for review June 19, 2024 01:23
@maddenp-noaa maddenp-noaa merged commit fd5bdae into ufs-community:main Jun 19, 2024
2 checks passed
@maddenp-noaa maddenp-noaa deleted the yaml-scalar-dump branch June 19, 2024 01:23
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.

None yet

3 participants