Hydra 1.1.0
1.1.0 (2021-06-09)
This is the biggest Hydra release yet.
Highlights
- OmegaConf 2.1 supports relative interpolations, nested interpolations, more powerful resolvers and better compatibility with plain Python dict and list.
- Recursive defaults list: Every config can now have a Defaults List.
- Recursive instantiation: When instantiating objects using the
instantiate
API, nested defined objects are instantiated automatically.
There have also been many bug fixes and performance improvements, as well of as some breaking changes - both in Hydra and in OmegaConf.
Please check the API changes and deprecation sections in these release notes and in the OmegaConf release notes.
Features
General enhancements
- Upgrade to OmegaConf 2.1. Please check the release notes for it (#1426)
- Support for Python 3.9. (#1062)
- Improve performance of config composition in a benchmark by 64% (#1328)
- Allow
@
,$
and?
symbols in unquoted values in overrides (#1074, #1437, #1597) - Add a --resolve flag that can be used with the --cfg and --help flags to resolve interpolations before the config is printed. (#1585,#1482)
- It is now possible to disable Hydra's logging configuration (#1130)
- Support for Zsh tab completion (#347)
- Support for force-add of config values via
++key=value
(force-add overrides if the value exists and adds it otherwise) (#1049) - New experimental Callback API (#1402)
Config composition enhancements
- Support for Defaults List in any config (Recursive relative defaults) (#1170)
- Composition order of a config with a Defaults List can be specified with the
_self_
keyword. (#326) - Support for configuring the config search path from the primary config (#274)
- Add support for selecting multiple configs from the same Config Group (#499)
- Final choices of defaults list are retained in the dictionary hydra.runtime.choices (#956)
Object Instantiation enhancements
- Support for recursive instantiation with
hydra.utils.instantiate()
(#566) - Instantiate now fully supports positional arguments (#1432)
- Support for converting parameters to primitive containers during instantiation (#1015)
- It is now possible to override the
_target_
of instantiation with a Python type or a string (#1017)
API Change (Renames, deprecations and removals)
General changes
- Default composition order change, see this for details (#1217)
- Remove deprecated strict flag from
@hydra.main
and theCompose API
(#1010) - Passing a config name as config_path to
@hydra.main
is now an error (#1010) - Promote
hydra.experimental.{compose,initialize,initialize_config_dir,initialize_config_module}
out from thehydra.experimental
module to the hydra module. (#1030) - The override grammar now requires that, in quoted strings, any sequence of \ preceding a quote (either an escaped quote, or the closing quote) must be escaped (#1600)
- Support partial failures in MULTIRUN mode (#1377)
- Add
HydraContext
torun_job
and Launcher/Sweeper'ssetup
(#1498)
Instantiate changes
- Instantiate is now recursive by default, use
_recursive_=False
to disable recursive instantiation. (#566) - Deprecated TargetConf, you should no longer be extending or annotating with it (#1010)
- Remove ObjectConf and deprecated params support that was deprecated in Hydra 1.0 (#1010)
Plugins API changes
- HydraContext required in run_job, Launcher and Sweeper's setup methods, see issue for details (#1498)
- ConfigSourcePlugins needs to be modified to support recursive defaults, see link for details (#1080)
Bug Fixes
- Hydra no longer erroneously changes the USER environment variable in pytest unit tests once installed (#1059)
- Fix a bug where Structured Config has a field like
list : Optional[List[int]] = None
(#1117) - No longer modifies exception stack trace when running under a debugger (#1237)
hydra.job.{id,num}
are now properly passed to jobs in multirun (#1270)- Add support for
%f
directive (microseconds) to the${now:PATTERN}
resolver (#1287) - Fixed a bug where tab completion did not work if the Defaults List had a missing (???) item. (#1381)
- Fix
+
overrides to properly insert new values into Structured Configs. (#1515) - Fix edge cases where using the command line to set a key to a value containing a string ending with a backslash could crash (#1600)
--cfg=hydra
now works for read-only config (#1461)- Change hydra.job_logging and hydra.hydra_logging to be non-optional (#1656)
- Configs with unicode characters are now working on Windows (#1659)
Plugins
- Add Optuna Sweeper plugin
Improved Documentation
- New Defaults List page (#1170)
- New Extending Configs pattern (#1170)
- Major updates to the Packages page (#1170)
- New Configuring Experiments pattern (#1170)
- Documentation updates for configuring search path (#1449)
- Documentation for
hydra.callbacks
(#1526) - Document how to configure Hydra plugins (#1582)