lowpolypy icon indicating copy to clipboard operation
lowpolypy copied to clipboard

Switch from Plain OmegaConf to Hydra

Open omry opened this issue 5 years ago • 3 comments

Hi, I noticed you are using OmegaConf and I think Hydra would be an even better fit for a project like this. Please give it a shot. if you have any questions feel free to join the Hydra chat.

omry avatar Sep 12 '20 01:09 omry

Hi omry, thanks for reaching out!

First off, thanks a ton for your excellent work on both packages.

I'd initially attempted to use Hydra, but ran into issues with relative file paths. I wanted to maintain support for a non-command line interface (i.e. bypassing the Hydra main function), but was unable to find a way to stop Hydra from changing the working directory. If this feature is something you're planning, I'd gladly consider switching over to Hydra once it's ready.

tasercake avatar Sep 12 '20 01:09 tasercake

You can already disable the directory change: Simply override hydra.run.dir to . in your config.

hydra:
  run:
    dir: .

You will probably also want to disable the .hydra output dir (look at the docs).

However, I recommend that you use hydra.utils.to_absolute_path (documented here).

Independently of the two above solutions: You can maintain support for non cli (say tests or notebooks) using the Compose API.

omry avatar Sep 12 '20 01:09 omry

@omry thanks, I had no idea it was already implemented! I'll check it out when I get the time.

tasercake avatar Sep 12 '20 10:09 tasercake