-
Notifications
You must be signed in to change notification settings - Fork 2
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
Upgrade to Hydra 1.0 #19
Comments
Great, thank you |
@omry Does Hydra 1.0.0rc1 support loading StructuredConfig's from a python file, instead of yaml? Looking at OmegaConf 2.0, the typing in StructuredConfig is great, but I don't see any functionality for Hydra to load non-yaml files |
@goodmattg: There is an entire new tutorial dedicated to Structured Configs. |
@omry Thanks for the link to the new docs; the Structured Config documentation looks good. I'm sure you frequently get this question, but is there planned future support for user methods? One of the few patterns I wanted to include from |
@goodmattg , Structured Configs are new, so no - it's the first time someone ask for it. Generally speaking, OmegaConf is not open to arbitrary types, and at the moment there is no way to extend the types it supports. (the list includes primitives like int,float, bool, string and Enums, as well as dicts, lists and dataclasses or instances containing those types). Supporting user methods in Structured Configs would not mean that you can put arbitrary user data in the config. With respect to further validation: For the time being you can do the validation on your side, and when (if) 131 is implemented you will be able to offload it to OmegaConf. |
@omry struggling with something that feels trivial looking at the documentation. We want to access Any help is appreciated! |
What do you mean by "no luck getting this into a .yaml config"? Please be more specific, ideally even provide a minimal example. |
Specifically, I would like to populate a yaml field with the value of
then access with I would prefer to set a field in our config.yaml:
then access with |
You are talking about multiple things:
config.yaml: cwd : ${hydra:runtime.cwd} app.py: import hydra
from omegaconf import DictConfig, OmegaConf
import os
@hydra.main(config_name="config")
def my_app(cfg: DictConfig):
print("Accessing hydra cwd from config: ", cfg.cwd)
print("Populating yaml file hydra cwd: ", os.path.join(os.getcwd(), "config.yaml"))
OmegaConf.save(cfg, "config.yaml", resolve=True)
print(
"Accessing hydra.cwd through API: ", hydra.utils.get_original_cwd(),
)
if __name__ == "__main__":
my_app() on a side note, feel free to ask these kind of questions on Stack overflow under #fb-hydra or #omegaconf |
Hello,
I released Hydra 1.0.0rc1 about a week ago.
I suggest that you use it for this project.
Check out the release notes.
It is still a release candidate, but as I get more feedback about it and address new issues it will become the primary version.
The text was updated successfully, but these errors were encountered: