-
Notifications
You must be signed in to change notification settings - Fork 3
Provide utility functions for calling from hydra #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Nijat Khanbabayev <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #128 +/- ##
==========================================
+ Coverage 95.08% 95.20% +0.11%
==========================================
Files 126 130 +4
Lines 7281 7524 +243
Branches 481 491 +10
==========================================
+ Hits 6923 7163 +240
- Misses 237 240 +3
Partials 121 121 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This is a relatively big change, and I have to think about other ways of accomplishing this. For example, instead of the configs referencing python paths of other configs, if those other configs were in the registry already, then the existing mechanisms would work to reference them. Then the question becomes how to take some model instances that are defined in python and add them as named objects to the registry. I think this may be doable leveraging hydra's |
Signed-off-by: Nijat Khanbabayev <[email protected]>
Signed-off-by: Nijat Khanbabayev <[email protected]>
3839e3f to
9f65232
Compare
Good point. I added a function |
Signed-off-by: Nijat Khanbabayev <[email protected]>
9f65232 to
00b9d53
Compare
Signed-off-by: Nijat Khanbabayev <[email protected]>
Signed-off-by: Nijat Khanbabayev <[email protected]>
29d0f7c to
3cc6109
Compare
Signed-off-by: Nijat Khanbabayev <[email protected]>
Signed-off-by: Nijat Khanbabayev <[email protected]>
Signed-off-by: Nijat Khanbabayev <[email protected]>
135aef3 to
438cb63
Compare
Signed-off-by: Nijat Khanbabayev <[email protected]>
Signed-off-by: Nijat Khanbabayev <[email protected]>
Signed-off-by: Nijat Khanbabayev <[email protected]>
Signed-off-by: Nijat Khanbabayev <[email protected]>
This PR now adds
"update_from_base",
"from_python",
functions.
update_from_basestarts with a base object, applies updates, and then optionally converts to another class.from_pythonis a utility function to allow instantiating arbitrary python objects in hydra.Original (outdated)
Add
PathKeyResolverMixinwhich allows specifying some key/value pairs from python code via aPyObjectPath. This allows offloading some of the configuration to python, getting benefits from:easier testability, cohesiveness of related configurations, and deduplication.
One specific workflow this helps with, is that partial functions can be constructed by taking a general CallableModel, and specializing (specifying specific/partial configuration options) it for various use-cases. The default
resolved_wins, provides a (overrideable) check that pre-defined configurations in the code are not accidentally overwritten, and reduces the surface area exposed that could be overriden via yaml.This functionality is opt-in, since base
ccflow.BaseModelclasses do not inherit from it via default.Motivation (including in docs file added):