tasercake / lowpolypy

Robust Low-Poly Image Generator
MIT License
76 stars 11 forks source link

Switch from Plain OmegaConf to Hydra #6

Open omry opened 4 years ago

omry commented 4 years ago

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.

tasercake commented 4 years ago

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.

omry commented 4 years ago

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.

tasercake commented 4 years ago

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