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-639 Mixed cyclestr / text support #606

Merged
merged 9 commits into from
Sep 12, 2024

Conversation

maddenp-noaa
Copy link
Contributor

Synopsis

Add UW YAML for Rocoto support for mixed <cyclestr> and text content by extending the definition of compoundTimeString. Where, previously, only a single string, integer, or cyclestr: block was allowed, now a sequence of these values is accepted, which is rendered as a mix of text and element XML children.

For example, we can now realize rocoto.yaml

workflow:
  attrs:
    realtime: false
    scheduler: slurm
  cycledef:
    - spec: 202409100000 202409110000 06:00:00
  log:
    - rocoto-
    - cyclestr:
        value: "@Y@m@d"
    - -through-
    - cyclestr:
        value: "@Y@m@d"
        attrs:
          offset: "06:00:00"
    - .log
  tasks:
    task_foo:
      command: /bin/true
      cores: 1
      walltime: 00:01:00

as Rocoto XML

$ uw rocoto realize --config-file rocoto.yaml
[2024-09-10T20:17:38]     INFO 0 UW schema-validation errors found in Rocoto config
[2024-09-10T20:17:38]     INFO 0 Rocoto XML validation errors found
<?xml version='1.0' encoding='utf-8'?>
<workflow realtime="False" scheduler="slurm">
  <cycledef>202409100000 202409110000 06:00:00</cycledef>
  <log>rocoto-<cyclestr>@Y@m@d</cyclestr>-through-<cyclestr offset="06:00:00">@Y@m@d</cyclestr>.log</log>
  <task name="foo">
    <cores>1</cores>
    <walltime>00:01:00</walltime>
    <command>/bin/true</command>
    <jobname>foo</jobname>
  </task>
</workflow>

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 Sep 10, 2024
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.

I think this will work, at least until we find another odd formatting to account for! Thanks for the quick fix!

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.

@maddenp-noaa maddenp-noaa merged commit afce2f2 into ufs-community:main Sep 12, 2024
2 checks passed
@maddenp-noaa maddenp-noaa deleted the uw-639-cyclestr branch September 12, 2024 19:53
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