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
-
I have a case where I am using
uw file copy
to 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 copy
oruw config realize
, I get an error along the following lines:I tried using
uw template render
to resolve the jinja2 loop, but it turns outtemplate render
can't resolve referencing values from within the yaml file, so that constructions like:will flag
exp
as 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