Skip to content

What is the appropriate way to reference other "typed" variables in a config yaml? #595

Closed Answered by christinaholtNOAA
mkavulich asked this question in Q&A
Discussion options

You must be logged in to vote

I have replicated the example you provided and locally modified uwtools to accept a !datetime tag that will convert a Jinja expression to a datetime object after it's dereferenced. During that process, I also tested a theory that pyyaml understands an entry that looks like a date without the !!timestamp tag, and found that it's unnecessary when you don't include quotes. This might make things a little less frustrating when the requirement to use a tag for the Jinja-templated version comes into play.

Here's the behavior I see with my local mod. Let me know if this is what you think might work. My test.yaml contains:

hafs:
  DATE_FIRST_CYCL: 1900-01-01 12:00:00
  DATE_LAST_CYCL: !datetime '…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mkavulich
Comment options

Answer selected by mkavulich
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants