-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
I saw the following comment in the SimpleParsing source code:
# The file should have the same format as the command-line args, e.g. contain the
# fields of the 'root' dataclass directly (e.g. "foo: 123"), rather a dict with
# "config: foo: 123" where foo is a field of the root dataclass at dest 'config'.
# Therefore, we add the prefix back here.
So it sounds like, if I was to use a config path in my main.py, e.g.:
@dataclass
class MyDataClass:
a: int
b: str
args = simple_parsing.parse(MyDataClass, config_path="config.yaml")
Then config.yaml would have to look like:
a: 12
b: test
Now say for example, due to some other external stipulation, I needed to have a root-level grouping in my config.yaml, e.g.:
parameters:
a: 12
b: test
Is there a feature that allows me to lookup that root key first before doing the parse? Something like:
args = simple_parsing.parse(
MyDataClass,
config_path="config.yaml",
config_root_key="parameters")
Metadata
Metadata
Assignees
Labels
No labels