rbgirshick / yacs

YACS -- Yet Another Configuration System
Apache License 2.0
1.28k stars 90 forks source link

construction from dict cleanup + .py override file support #5

Closed rbgirshick closed 6 years ago

rbgirshick commented 6 years ago

Diff bb2a01c

The CfgNode constructor can take a dict as an argument that defines that configuration keys and values. However, there were some funky implementation details:

This diff fixes these issues so that a dict can be provided to the constructor and nested dicts are recursively converted to CfgNode objects.

Diff 68dcec9

Based on feedback, there's a desire to be able to use Python source files to define config overrides. This diff implements the convention that any .py file implementing a module with a cfg attribute of type dict or CfgNode can be used in load_cfg (and hence be used a full config or a config override).

rbgirshick commented 6 years ago

meta: github workaround for stacked diffs seems legit :P

Except that I realized it totally fails as soon as you rebase and all of the hashes change.

There's this workflow https://graysonkoonce.com/stacked-pull-requests-keeping-github-diffs-small/ which is depressingly complex. #iheartphabricatorandhg