You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies b/c below is quite long winded. The basic idea and question is pretty straightforward, I'm just having trouble compressing it down much further (despite hydra_zen's exceptional ability to reduce boilerplate 😄 )
Building on the ideas outlined here, I'm trying to understand why config objects generated by builds are needed for store-ing higher-level/top-level objects.
What works
To try and make this more clear, hear is an example that I adapted from the docs, which works as expected:
But when I try to run this, there seems to be an issue if I try to override bar:
python ex2.py +op=foo +op/bar=default
> In 'op/bar/default': ValidationError raised while composing config:
> Value '{'_target_': '__main__.bar', 'a': 1}' of type'DictConfig' could not be converted to Integer
> full_key: op.bar
> object_type=PartialBuilds_foo
> Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
Why I'm confused
I can understand the basic issue here (I think): essentially in the second case there's no alignment between the group op/bar and the argument bar for foo. Or at least, it appears hydra_zen isn't instaniating op/bar in the same way in this case. So my question is essentially: why doesn't this work?
My expectation is that it shouldn't matter whether the store call for foo is given a builds config to work correctly, but clearly it does. I figure this is either
An opportunity for me to better understand why this is expected, which I would appreciate any suggestions on
or, functionality that could actually be supported by hydra_zen
Why bother?
In case it's useful, here's a slightly expanded example of why I'm going through all this trouble in the first place. Essentially, I want to provide a variable operation CLI, with overrides providing paths to different sub-commands (which I'm calling op).
To be clear these all work as expected and are fine. I just wouldn't mind avoiding the extra steps of creating a separate config object for the nested bar and buz components.
Also alternatively, maybe there's just a more clear path for supporting subcommands with hydra_zen that I'm just missing or unware of?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Apologies b/c below is quite long winded. The basic idea and question is pretty straightforward, I'm just having trouble compressing it down much further (despite
hydra_zen
's exceptional ability to reduce boilerplate 😄 )Building on the ideas outlined here, I'm trying to understand why config objects generated by
builds
are needed forstore
-ing higher-level/top-level objects.What works
To try and make this more clear, hear is an example that I adapted from the docs, which works as expected:
This works as I expect, I can call directly
As well as supporting nested overrides
What doesn't work
Basically the differences are:
bar
directly with astore
decoratorfoo
This works fine if not overriding
bar
But when I try to run this, there seems to be an issue if I try to override
bar
:Why I'm confused
I can understand the basic issue here (I think): essentially in the second case there's no alignment between the group
op/bar
and the argumentbar
forfoo
. Or at least, it appearshydra_zen
isn't instaniatingop/bar
in the same way in this case. So my question is essentially: why doesn't this work?My expectation is that it shouldn't matter whether the
store
call forfoo
is given abuilds
config to work correctly, but clearly it does. I figure this is eitherhydra_zen
Why bother?
In case it's useful, here's a slightly expanded example of why I'm going through all this trouble in the first place. Essentially, I want to provide a variable operation CLI, with overrides providing paths to different sub-commands (which I'm calling
op
).Then I can mix and match calls like
To be clear these all work as expected and are fine. I just wouldn't mind avoiding the extra steps of creating a separate config object for the nested
bar
andbuz
components.Also alternatively, maybe there's just a more clear path for supporting subcommands with
hydra_zen
that I'm just missing or unware of?Beta Was this translation helpful? Give feedback.
All reactions