omry / omegaconf

Flexible Python configuration system. The last one you will ever need.
BSD 3-Clause "New" or "Revised" License
1.99k stars 115 forks source link

Interpolation of defaults does not work #1193

Closed noppelmax closed 2 months ago

noppelmax commented 2 months ago

Describe the bug I want to run an interpolation with the defaults I have defined in subdirectories. However, I get an Interpolation error (see below).

My file structure is

max@merry ~/demo                                                     [18:22:30]
(base) > $ tree                                                                
.
├── conf
│   ├── config.yaml
│   └── targetexplanation
│       ├── blob.yaml
│       └── square.yaml
└── demo.py

and conf/config.yaml is

defaults:
  - targetexplanation: square

experimentpath: ./${targetexplanation}

I expect experimentpath to be ./square. I also tried ${targetexplanation.name}, which also does not work.

To Reproduce Please find a demo project here:

demo.zip

Expected behavior See above. I would expect to get the interpolation working.

Additional context

noppelmax commented 2 months ago

Nevermind! I think the defaults: functionality comes from Hydra. Thank you for OmegaConf. This issue can be closed.