Using jinja2 loops in config files? #563
Replies: 3 comments 9 replies
-
|
Can you show us a simple-as-possible reproducer? |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
I like where you're going here. I've also been feeling the pain of repeating a bunch of similar file names. I'd like to see that we could maybe use some very basic globbing/pattern matching to help with DRYing out info. I am also curious if a uwtools-supported |
Beta Was this translation helpful? Give feedback.
2 replies
-
Is that it? |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
benjamin-cash
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a case where I am using
uw file copyto copy a set of similar files into my run directory. E.g.,etc. I would like to set this up as a jinja2 loop inside my config file. However, I find that if I give a config file with a jinja2 variable declaration in it to
uw file copyoruw config realize, I get an error along the following lines:I tried using
uw template renderto resolve the jinja2 loop, but it turns outtemplate rendercan't resolve referencing values from within the yaml file, so that constructions like:will flag
expas an uprovided value.Is there a way to make use of both jinja2 loops AND referencing yaml values from within the file? Or does it need to be one or the other?
Beta Was this translation helpful? Give feedback.
All reactions