Skip to content
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

Abstract config sources to allow additional configuration sources #257

Closed
omry opened this issue Oct 23, 2019 · 1 comment · Fixed by #363
Closed

Abstract config sources to allow additional configuration sources #257

omry opened this issue Oct 23, 2019 · 1 comment · Fixed by #363
Labels
enhancement Enhanvement request
Milestone

Comments

@omry
Copy link
Collaborator

omry commented Oct 23, 2019

Currently Hydra supports absolute path (file system) and pkg:// (pkg_resource) for loading config files, but the implementation is a bit of a zoo.
Create an interface for ConfigSource, possible methods (inspired by pkg_resource):

class ConfigSource:
    def resource_stream()
    def resource_exists()
    def resource_listdir()
    def resource_isdir()

There is also the possibility that pkg_resource is extensible enough and can be used somehow.

Once this is done, it opens up the possibility of additional config sources, provided that they can implement the minimal required interface.

Finally, it should be possible to extend the supported configuration sources via a plugin.

@omry omry added the enhancement Enhanvement request label Oct 23, 2019
@omry
Copy link
Collaborator Author

omry commented Nov 21, 2019

This can be used as base to support config in code at some point.

Initial idea:

hydra.experimental.HydraConfig.add("config_group", "config_name", OmegaConf.create({"blah": 10}))

and later config_group=config_name might be able to be used if HydraConfig is added to the search path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhanvement request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant