-
With a configuration like this: cfg = OmegaConf.create({
"foo" : 10,
"bar": {
"bla":"${foo}"
}
}) How can I check if my key "bla" has an interpolation value or not? I've tried all of the following:
But all of those return "False", where I'm expecting to get "True". |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You need to operate on the parent Node. OmegaConf.is_interpolation(cfg.bar, "bla") If you want to drill in programmatically , you can use OmegaConf.select to select the parent node first: node = OmegaConf.select(cfg, "foo.bar.baz")
OmegaConf.is_interpolation(node, "biz") |
Beta Was this translation helpful? Give feedback.
-
Happy to help. |
Beta Was this translation helpful? Give feedback.
You need to operate on the parent Node.
Something like:
If you want to drill in programmatically , you can use OmegaConf.select to select the parent node first:
e.g, to check if foo.bar.baz.biz is an interpolation: