diff --git a/NEWS.md b/NEWS.md index cd83320c9..60aebb004 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,106 @@ +## 2.1.0.rc1 (2021-05-12) +OmegaConf 2.1 is a major release introducing substantial new features, and introducing some incompatible changes. +The biggest area of improvement in 2.1 is interpolations and resolvers. In addition - OmegaConf containers are now +much more compatible with their plain Python container counterparts (dict and list). + +### Features +#### API Enhancements +- OmegaConf.select() now takes an optional default value to return if a key is not found ([#228](https://github.com/omry/omegaconf/issues/228)) +- flag_override can now override multiple flags at the same time ([#400](https://github.com/omry/omegaconf/issues/400)) +- Add the OmegaConf.to_object method, which converts Structured Configs to native instances of the underlying `@dataclass` or `@attr.s` class. ([#472](https://github.com/omry/omegaconf/issues/472)) +- Add OmegaConf.unsafe_merge(), a fast merge variant that destroys the input configs ([#482](https://github.com/omry/omegaconf/issues/482)) +- New function `OmegaConf.has_resolver()` allows checking whether a resolver has already been registered. ([#608](https://github.com/omry/omegaconf/issues/608)) +- Adds OmegaConf.resolve(cfg) for in-place interpolation resolution on cfg ([#640](https://github.com/omry/omegaconf/issues/640)) +- force_add flag added to OmegaConf.update(), ensuring that the path is created even if it will result in insertion of new values into struct nodes. ([#664](https://github.com/omry/omegaconf/issues/664)) +- Add DictConfig support for keys of type int, float and bool ([#149](https://github.com/omry/omegaconf/issues/149)), ([#483](https://github.com/omry/omegaconf/issues/483)) +- Structured Configs fields without a value are now automatically treated as `OmegaConf.MISSING` ([#390](https://github.com/omry/omegaconf/issues/390)) +- Add minimal support for typing.TypedDict ([#473](https://github.com/omry/omegaconf/issues/473)) +- OmegaConf.to_container now takes a `structured_config_mode` keyword argument. Setting `structured_config_mode=SCMode.DICT_CONFIG` causes `to_container` to not convert Structured Config objects to python dicts (it leaves them as DictConfig objects). ([#548](https://github.com/omry/omegaconf/issues/548)) +#### Interpolation and resolvers +- Support for relative interpolation ([#48](https://github.com/omry/omegaconf/issues/48)) +- Add ability to nest interpolations, e.g. ${foo.${bar}}}, ${oc.env:{$var1},${var2}}, or ${${func}:x1,x2} ([#445](https://github.com/omry/omegaconf/issues/445)) +- Custom resolvers can now access the parent and the root config nodes ([#266](https://github.com/omry/omegaconf/issues/266)) +- For `OmegaConf.{update, select}` and in interpolations, bracketed keys may be used as an alternative form to dot notation, + e.g. foo.1 is equivalent to foo[1], [foo].1 and [foo][1]. ([#179](https://github.com/omry/omegaconf/issues/179)) +- Custom resolvers may take non string arguments as input, and control whether to use the cache. ([#445](https://github.com/omry/omegaconf/issues/445)) +- Dots may now be used in resolver names to denote namespaces (e.g: `${namespace.my_func:123}`) ([#539](https://github.com/omry/omegaconf/issues/539)) +- New resolver `oc.select`, enabling node selection with a default value to use if the node cannot be selected ([#541](https://github.com/omry/omegaconf/issues/541)) +- New resolver `oc.decode` that can be used to automatically convert a string to bool, int, float, dict, list, etc. ([#574](https://github.com/omry/omegaconf/issues/574)) +- New resolvers `oc.dict.keys` and `oc.dict.values` provide a list view of the keys or values of a DictConfig node. ([#643](https://github.com/omry/omegaconf/issues/643)) +- New resolver `oc.create` can be used to dynamically generate config nodes ([#645](https://github.com/omry/omegaconf/issues/645)) +- New resolver `oc.deprecated`, that enables deprecating config nodes ([#681](https://github.com/omry/omegaconf/issues/681)) +- The dollar character `$` is now allowed in interpolated key names, e.g. `${$var}` ([#600](https://github.com/omry/omegaconf/issues/600)) +#### Misc +- New PyDev.Debugger resolver plugin for easier debugging in PyCharm and VSCode ([#214](https://github.com/omry/omegaconf/issues/214)) +- OmegaConf now supports Python 3.9 ([#447](https://github.com/omry/omegaconf/issues/447)) +- Support for Python 3.10 postponed annotation evaluation ([#303](https://github.com/omry/omegaconf/issues/303)) +- Experimental support for enabling objects in config via "allow_objects" flag ([#382](https://github.com/omry/omegaconf/issues/382)) + +### Bug Fixes + +- Fix support for forward declarations in Dict and Lists ([#378](https://github.com/omry/omegaconf/issues/378)) +- Fix bug that allowed instances of Structured Configs to be assigned to DictConfig with different element type. ([#386](https://github.com/omry/omegaconf/issues/386)) +- Fix exception raised when checking for the existence of a key with an incompatible type in DictConfig ([#394](https://github.com/omry/omegaconf/issues/394)) +- Fix loading of an empty file via a file-pointer to return an empty dictionary ([#403](https://github.com/omry/omegaconf/issues/403)) +- Fix pickling of Structured Configs with fields annotated as Dict[KT, VT] or List[T] on Python 3.6. ([#407](https://github.com/omry/omegaconf/issues/407)) +- Assigning a primitive type to a Subscripted Dict now raises a descriptive message. ([#409](https://github.com/omry/omegaconf/issues/409)) +- Fix assignment of an invalid value to a DictConfig to raise an exception without modifying the config object ([#409](https://github.com/omry/omegaconf/issues/409)) +- Assigning a Structured Config to a Dict annotation now raises a descriptive error message. ([#410](https://github.com/omry/omegaconf/issues/410)) +- OmegaConf.to_container() raises a ValueError on invalid input ([#418](https://github.com/omry/omegaconf/issues/418)) +- Fix ConfigKeyError in some cases when merging lists containing interpolation values ([#422](https://github.com/omry/omegaconf/issues/442)) +- DictConfig.get() in struct mode return None like standard Dict for non-existing keys ([#425](https://github.com/omry/omegaconf/issues/425)) +- Fix bug where interpolations were unnecessarily resolved during merge ([#431](https://github.com/omry/omegaconf/issues/431)) +- Fix bug where assignment of an invalid value to a ListConfig raised an exception but left the object modified. ([#433](https://github.com/omry/omegaconf/issues/433)) +- When initializing a Structured Config with an incorrectly-typed value, the resulting ValidationError now properly reports the offending value in its error message. ([#435](https://github.com/omry/omegaconf/issues/435)) +- Fix assignment of a Container to itself causing it to clear its content ([#449](https://github.com/omry/omegaconf/issues/449)) +- Fix bug where DictConfig's shallow copy didn't work properly in some cases. ([#450](https://github.com/omry/omegaconf/issues/450)) +- Fix support for merge tags in YAML files ([#470](https://github.com/omry/omegaconf/issues/470)) +- Fix merge into a custom resolver node that raises an exception ([#486](https://github.com/omry/omegaconf/issues/486)) +- Fix merge when element type is a Structured Config ([#496](https://github.com/omry/omegaconf/issues/496)) +- Fix ValidationError when setting to None an optional field currently interpolated to a non-optional one ([#524](https://github.com/omry/omegaconf/issues/524)) +- Fix OmegaConf.to_yaml(cfg) when keys are of Enum type ([#531](https://github.com/omry/omegaconf/issues/531)) +- When a DictConfig has enum-typed keys, `__delitem__` can now be called with a string naming the enum member to be deleted. ([#554](https://github.com/omry/omegaconf/issues/554)) +- `OmegaConf.select()` of a missing (`???`) node from a ListConfig with `throw_on_missing` set to True now raises the intended exception. ([#563](https://github.com/omry/omegaconf/issues/563)) +- `DictConfig.{get(),pop()}` now return `None` when the accessed key evaluates to `None`, instead of the specified default value (for consistency with regular Python dictionaries). ([#583](https://github.com/omry/omegaconf/issues/583)) +- `ListConfig.get()` now return `None` when the accessed key evaluates to `None`, instead of the specified default value (for consistency with DictConfig). ([#583](https://github.com/omry/omegaconf/issues/583)) +- Fix creation of structured config from a dict subclass: data from the dict is no longer thrown away. ([#584](https://github.com/omry/omegaconf/issues/584)) +- Assignment of a dict/list to an existing node in a parent in struct mode no longer raises ValidationError ([#586](https://github.com/omry/omegaconf/issues/586)) +- Nested flag_override now properly restore the original state ([#589](https://github.com/omry/omegaconf/issues/589)) +- Fix OmegaConf.create() to set the provided `parent` when creating a config from a YAML string. ([#648](https://github.com/omry/omegaconf/issues/648)) +- OmegaConf.select now returns None when attempting to select a child of a value or None node ([#678](https://github.com/omry/omegaconf/issues/678)) +- Improve error message when creating a config from a Structured Config that fails type validation ([#697](https://github.com/omry/omegaconf/issues/697)) + +### API changes and deprecations + +- DictConfig `__getattr__` access, e.g. `cfg.foo`, is now raising a AttributeError if the key "foo" does not exist ([#515](https://github.com/omry/omegaconf/issues/515)) +- DictConfig `__getitem__` access, e.g. `cfg["foo"]`, is now raising a KeyError if the key "foo" does not exist ([#515](https://github.com/omry/omegaconf/issues/515)) +- DictConfig get access, e.g. `cfg.get("foo")`, now returns `None` if the key "foo" does not exist ([#527](https://github.com/omry/omegaconf/issues/527)) +- `Omegaconf.select(cfg, key, default, throw_on_missing)` now requires keyword arguments for everything after `key` ([#228](https://github.com/omry/omegaconf/issues/228)) +- Structured Configs with nested Structured config field that does not specify a default value are now interpreted as MISSING (`???`) instead of auto-expanding ([#411](https://github.com/omry/omegaconf/issues/411)) +- OmegaConf.update() is now merging dict/list values into the destination node by default. Call with merge=False to replace instead. ([#667](https://github.com/omry/omegaconf/issues/667)) +- `register_resolver()` is deprecated in favor of `register_new_resolver()`, allowing resolvers to (i) take non-string arguments like int, float, dict, interpolations, etc. and (ii) control the cache behavior (now disabled by default) ([#426](https://github.com/omry/omegaconf/issues/426)) +- Merging a MISSING value onto an existing value no longer changes the target value to MISSING. ([#462](https://github.com/omry/omegaconf/issues/462)) +- When resolving an interpolation of a config value with a primitive type, the interpolated value is validated and possibly converted based on the node's type. ([#488](https://github.com/omry/omegaconf/issues/488)) +- DictConfig and ListConfig shallow copy is now performing a deepcopy ([#492](https://github.com/omry/omegaconf/issues/492)) +- `OmegaConf.select()`, `DictConfig.{get(),pop()}`, `ListConfig.{get(),pop()}` no longer return the specified default value when the accessed key is an interpolation that cannot be resolved: instead, an exception is raised. ([#543](https://github.com/omry/omegaconf/issues/543)) +- OmegaConf.{merge, unsafe_merge, to_yaml} now raises a ValueError when called on a str input. Previously an AssertionError was raised. ([#560](https://github.com/omry/omegaconf/issues/560)) +- All exceptions raised during the resolution of an interpolation are either `InterpolationResolutionError` or a subclass of it. ([#561](https://github.com/omry/omegaconf/issues/561)) +- `key in cfg` now returns True when `key` is an interpolation even if the interpolation target is a missing ("???") value. ([#562](https://github.com/omry/omegaconf/issues/562)) +- `OmegaConf.select()` as well as container methods `get()` and `pop()` do not return their default value anymore when the accessed key is an interpolation that cannot be resolved: instead, an exception is raised. ([#565](https://github.com/omry/omegaconf/issues/565)) +- Implicitly empty resolver arguments (e.g., `${foo:a,}`) are deprecated in favor of explicit quoted strings (e.g., `${foo:a,""}`) ([#572](https://github.com/omry/omegaconf/issues/572)) +- The `env` resolver is deprecated in favor of `oc.env`, which keeps the string representation of environment variables, does not cache the resulting value, and handles "null" as default value. ([#573](https://github.com/omry/omegaconf/issues/573)) +- `OmegaConf.get_resolver()` is deprecated: use the new `OmegaConf.has_resolver()` to check for the existence of a resolver. ([#608](https://github.com/omry/omegaconf/issues/608)) +- Interpolation cycles are now forbidden and will trigger an InterpolationResolutionError on access. ([#662](https://github.com/omry/omegaconf/issues/662)) +- Support for Structured Configs that subclass `typing.Dict` is now deprecated. ([#663](https://github.com/omry/omegaconf/issues/663)) +- Remove BaseContainer.{pretty,select,update_node} that have been deprecated since OmegaConf 2.0. ([#671](https://github.com/omry/omegaconf/issues/671)) + +### Miscellaneous changes + +- Optimized config creation time. Faster by 1.25x to 4x in benchmarks ([#477](https://github.com/omry/omegaconf/issues/477)) +- ListConfig.__contains__ optimized, about 15x faster in a benchmark ([#529](https://github.com/omry/omegaconf/issues/529)) +- Optimized ListConfig iteration by 12x in a benchmark ([#532](https://github.com/omry/omegaconf/issues/532)) + + ## 2.0.6 (2021-01-19) ### Bug Fixes @@ -81,13 +184,13 @@ The notable change is the config.pretty() is now deprecated in favor of OmegaCon ## 2.0.0 (2020-05-04) -OmegaConf 2.0 is a major release introducing substantial new ### Features, and introducing some incompatible changes. -The biggest new feature is Structured Configs, which extends OmegaConf into an schema validation system +OmegaConf 2.0 is a major release introducing substantial new features, and introducing some incompatible changes. +The biggest new feature is Structured Configs, which extends OmegaConf into a schema validation system as well as a configuration system. With Structured Configs you can create OmegaConf objects from standard dataclasses or attr classes (or objects). OmegaConf will retain the type information from the source object/class and validate that config mutations are legal. -This is the biggest OmegaConf release ever, the number of unit tests more than trippled (485 to 1571). +This is the biggest OmegaConf release ever, the number of unit tests more than tripled (485 to 1571). ### Features diff --git a/news/149.feature b/news/149.feature deleted file mode 100644 index c85412de5..000000000 --- a/news/149.feature +++ /dev/null @@ -1 +0,0 @@ -Add support for `int` key type in OmegaConf dictionaries diff --git a/news/179.feature b/news/179.feature deleted file mode 100644 index 9fb4726b9..000000000 --- a/news/179.feature +++ /dev/null @@ -1,2 +0,0 @@ -Bracketed keys may be used as an alternative form to dot notation, e.g. foo.1 is equivalent to foo[1], [foo].1 and [foo][1]. -This affects OmegaConf.{update, select} and interpolation usage. diff --git a/news/214.feature b/news/214.feature deleted file mode 100644 index 4feb86e2b..000000000 --- a/news/214.feature +++ /dev/null @@ -1 +0,0 @@ -New PyDev.Debugger resolver plugin for easier debugging diff --git a/news/228.api_change b/news/228.api_change deleted file mode 100644 index 14429183d..000000000 --- a/news/228.api_change +++ /dev/null @@ -1 +0,0 @@ -Omegaconf.select(cfg, key, default, thorw_on_missing) now requires keyword arguments for everything after key diff --git a/news/228.feature b/news/228.feature deleted file mode 100644 index 8ec39e461..000000000 --- a/news/228.feature +++ /dev/null @@ -1 +0,0 @@ -OmegaConf.select() now takes an optional default value to return if a key is not found diff --git a/news/266.feature b/news/266.feature deleted file mode 100644 index f4a6a91f2..000000000 --- a/news/266.feature +++ /dev/null @@ -1 +0,0 @@ -Custom resolvers can now access the parent and the root config nodes diff --git a/news/303.feature b/news/303.feature deleted file mode 100644 index 528b3b4b7..000000000 --- a/news/303.feature +++ /dev/null @@ -1 +0,0 @@ -Support for Python 3.10 postponed annotation evaluation diff --git a/news/378.bugfix b/news/378.bugfix deleted file mode 100644 index 3f5278aba..000000000 --- a/news/378.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix support for forward declarations in Dict and Lists diff --git a/news/379.bugfix b/news/379.bugfix deleted file mode 100644 index 59eec3827..000000000 --- a/news/379.bugfix +++ /dev/null @@ -1 +0,0 @@ -Using Any instead of None to represent unknown key and element types. diff --git a/news/382.feature b/news/382.feature deleted file mode 100644 index 63a93ef5c..000000000 --- a/news/382.feature +++ /dev/null @@ -1 +0,0 @@ -Experimental support for enabling objects in config via "allow_objects" flag diff --git a/news/386.bugfix b/news/386.bugfix deleted file mode 100644 index f82121c29..000000000 --- a/news/386.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix bug that allowed instances of Structured Configs to be assigned to DictConfig with different element type. diff --git a/news/390.feature b/news/390.feature deleted file mode 100644 index 0f30f564c..000000000 --- a/news/390.feature +++ /dev/null @@ -1 +0,0 @@ -Structured Configs fields without a value are now automatically treated as OmegaConf.MISSING diff --git a/news/394.bugfix b/news/394.bugfix deleted file mode 100644 index 3f38dbfcd..000000000 --- a/news/394.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix exception raised when checking for an existance of a key with an incompatible type in DictConfig diff --git a/news/400.feature b/news/400.feature deleted file mode 100644 index 95e5c300b..000000000 --- a/news/400.feature +++ /dev/null @@ -1 +0,0 @@ -flag_override can now override multiple flags at the same time diff --git a/news/403.bugfix b/news/403.bugfix deleted file mode 100644 index 3b6543722..000000000 --- a/news/403.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix loading of an empty file via a file-pointer to return an empty dictionary diff --git a/news/407.bugfix b/news/407.bugfix deleted file mode 100644 index 700052273..000000000 --- a/news/407.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix pickling of Structured Configs with fields annotated as Dict[KT, VT] or List[T] on Python 3.6. diff --git a/news/409.bugfix.1 b/news/409.bugfix.1 deleted file mode 100644 index 45134f2eb..000000000 --- a/news/409.bugfix.1 +++ /dev/null @@ -1 +0,0 @@ -Assigning a primitive type to a Subscripted Dict now raises a descriptive message. diff --git a/news/409.bugfix.2 b/news/409.bugfix.2 deleted file mode 100644 index ee8fb3e6d..000000000 --- a/news/409.bugfix.2 +++ /dev/null @@ -1 +0,0 @@ -Fix assignment of an invalid value to a DictConfig to raise an exception without modifying the config object diff --git a/news/410.bugfix b/news/410.bugfix deleted file mode 100644 index b492fbcf1..000000000 --- a/news/410.bugfix +++ /dev/null @@ -1 +0,0 @@ -Assigning an Structured Config to a Dict annotation now raises a descriptive error message. diff --git a/news/411.api_change b/news/411.api_change deleted file mode 100644 index 4b99ba283..000000000 --- a/news/411.api_change +++ /dev/null @@ -1 +0,0 @@ -Structured Configs with nested Structured config field that does not specify a default value are now interpreted as MISSING (`???`) instead of auto-expanding diff --git a/news/418.bugfix b/news/418.bugfix deleted file mode 100644 index b846ed1da..000000000 --- a/news/418.bugfix +++ /dev/null @@ -1 +0,0 @@ -OmegaConf.to_container() raises a ValueError on invalid input diff --git a/news/422.bugfix b/news/422.bugfix deleted file mode 100644 index 9654e9da5..000000000 --- a/news/422.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix ConfigKeyError in some cases when merging lists containing interpolation values diff --git a/news/425.bugfix b/news/425.bugfix deleted file mode 100644 index 9082fee19..000000000 --- a/news/425.bugfix +++ /dev/null @@ -1 +0,0 @@ -DictConfig.get() in struct mode return None like standard Dict for non-existing keys diff --git a/news/426.api_change b/news/426.api_change deleted file mode 100644 index 0930f08e1..000000000 --- a/news/426.api_change +++ /dev/null @@ -1 +0,0 @@ -`register_resolver()` is deprecated in favor of `register_new_resolver()`, allowing resolvers to (i) take non-string arguments like int, float, dict, interpolations, etc. and (ii) control the cache behavior (now disabled by default) diff --git a/news/431.bugfix b/news/431.bugfix deleted file mode 100644 index 19af09c97..000000000 --- a/news/431.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix bug where interpolations were unnecessarily resolved during merge diff --git a/news/433.bugfix b/news/433.bugfix deleted file mode 100644 index 99f88c523..000000000 --- a/news/433.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix bug where assignment of an invalid value to a ListConfig raised an exception but left the object modified. diff --git a/news/435.bugfix b/news/435.bugfix deleted file mode 100644 index 4065af67e..000000000 --- a/news/435.bugfix +++ /dev/null @@ -1 +0,0 @@ -When initializing a Structured Config with an incorrectly-typed value, the resulting ValidationError now properly reports the offending value in its error message. diff --git a/news/445.feature.1 b/news/445.feature.1 deleted file mode 100644 index 31bec183b..000000000 --- a/news/445.feature.1 +++ /dev/null @@ -1 +0,0 @@ -Add ability to nest interpolations, e.g. ${foo.${bar}}}, ${oc.env:{$var1},${var2}}, or ${${func}:x1,x2} diff --git a/news/445.feature.2 b/news/445.feature.2 deleted file mode 100644 index 8326bd016..000000000 --- a/news/445.feature.2 +++ /dev/null @@ -1 +0,0 @@ -Custom resolvers may take non string arguments as input, and control whether or not to use the cache. diff --git a/news/445.feature.3 b/news/445.feature.3 deleted file mode 100644 index 0ec958b12..000000000 --- a/news/445.feature.3 +++ /dev/null @@ -1 +0,0 @@ -The `env` resolver parses environment variables. Supported types includes primitives (int, float, bool, ...) and containers like dict and list. The used grammar is a subset of the interpolation grammar. diff --git a/news/447.feature b/news/447.feature deleted file mode 100644 index 602fa17e2..000000000 --- a/news/447.feature +++ /dev/null @@ -1 +0,0 @@ -OmegaConf now supports Python 3.9 \ No newline at end of file diff --git a/news/449.bugfix b/news/449.bugfix deleted file mode 100644 index 19849777d..000000000 --- a/news/449.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix assignment of a Container to itself causing it to clear it's content diff --git a/news/450.bugfix b/news/450.bugfix deleted file mode 100644 index 9a52116ee..000000000 --- a/news/450.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix bug where DictConfig's shallow copy didn't work properly in some cases. diff --git a/news/462.api_change b/news/462.api_change deleted file mode 100644 index 4b19c6469..000000000 --- a/news/462.api_change +++ /dev/null @@ -1 +0,0 @@ -Merging a MISSING value onto an existing value no longer changes the target value to MISSING. diff --git a/news/470.bugfix b/news/470.bugfix deleted file mode 100644 index 0bda78b3d..000000000 --- a/news/470.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix support for merge tags in YAML files diff --git a/news/472.feature b/news/472.feature deleted file mode 100644 index c51b70e8d..000000000 --- a/news/472.feature +++ /dev/null @@ -1 +0,0 @@ -Add the OmegaConf.to_object method, which converts Structured Configs to native instances of the underlying `@dataclass` or `@attr.s` class. diff --git a/news/473.feature b/news/473.feature deleted file mode 100644 index 01061c606..000000000 --- a/news/473.feature +++ /dev/null @@ -1 +0,0 @@ -Add minimal support for typing.TypedDict diff --git a/news/477.misc b/news/477.misc deleted file mode 100644 index 1ba1b6f55..000000000 --- a/news/477.misc +++ /dev/null @@ -1 +0,0 @@ -Optimized config creation time. Faster by 1.25x to 4x in benchmarks diff --git a/news/48.feature b/news/48.feature deleted file mode 100644 index a92b883b8..000000000 --- a/news/48.feature +++ /dev/null @@ -1 +0,0 @@ -Support for relative interpolation diff --git a/news/482.feature b/news/482.feature deleted file mode 100644 index e158fd856..000000000 --- a/news/482.feature +++ /dev/null @@ -1 +0,0 @@ -Add OmegaConf.unsafe_merge(), a fast merge variant that destroys the input configs diff --git a/news/483.feature b/news/483.feature deleted file mode 100644 index c72e40405..000000000 --- a/news/483.feature +++ /dev/null @@ -1 +0,0 @@ -Add DictConfig support for keys of type float and bool diff --git a/news/486.bugfix b/news/486.bugfix deleted file mode 100644 index 2698d89e1..000000000 --- a/news/486.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix merge into a custom resolver node that raises an exception diff --git a/news/488.api_change b/news/488.api_change deleted file mode 100644 index 3799c2e67..000000000 --- a/news/488.api_change +++ /dev/null @@ -1 +0,0 @@ -When resolving an interpolation of a config value with a primitive type, the interpolated value is validated and possibly converted based on the node's type. diff --git a/news/492.api_change b/news/492.api_change deleted file mode 100644 index cb47a084c..000000000 --- a/news/492.api_change +++ /dev/null @@ -1 +0,0 @@ -DictConfig and ListConfig shallow copy is now performing a deepcopy diff --git a/news/496.bugfix b/news/496.bugfix deleted file mode 100644 index bb74ba65c..000000000 --- a/news/496.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix merge when element type is a Structured Config diff --git a/news/515.api_change.1 b/news/515.api_change.1 deleted file mode 100644 index 1aaa4c1ac..000000000 --- a/news/515.api_change.1 +++ /dev/null @@ -1 +0,0 @@ -DictConfig __getitem__ access, e.g. `cfg["foo"]`, is now raising a KeyError if the key "foo" does not exist diff --git a/news/515.api_change.2 b/news/515.api_change.2 deleted file mode 100644 index fb440e320..000000000 --- a/news/515.api_change.2 +++ /dev/null @@ -1 +0,0 @@ -DictConfig __getattr__ access, e.g. `cfg.foo`, is now raising a AttributeError if the key "foo" does not exist diff --git a/news/524.bugfix b/news/524.bugfix deleted file mode 100644 index 3955e9d5a..000000000 --- a/news/524.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix ValidationError when setting to None an optional field currently interpolated to a non-optional one diff --git a/news/527.api_change b/news/527.api_change deleted file mode 100644 index d65f4db8c..000000000 --- a/news/527.api_change +++ /dev/null @@ -1 +0,0 @@ -DictConfig get access, e.g. `cfg.get("foo")`, now returns `None` if the key "foo" does not exist diff --git a/news/529.misc b/news/529.misc deleted file mode 100644 index e5b05dbb4..000000000 --- a/news/529.misc +++ /dev/null @@ -1 +0,0 @@ -ListConfig.__contains__ optimized, about 15x faster in a benchmark diff --git a/news/531.bugfix b/news/531.bugfix deleted file mode 100644 index 6c6e6339e..000000000 --- a/news/531.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix OmegaConf.to_yaml(cfg) when keys are of Enum type diff --git a/news/532.misc b/news/532.misc deleted file mode 100644 index 15f484bb6..000000000 --- a/news/532.misc +++ /dev/null @@ -1 +0,0 @@ -Optimized ListConfig iteration by 12x in a benchmark diff --git a/news/539.feature b/news/539.feature deleted file mode 100644 index 921b6bb57..000000000 --- a/news/539.feature +++ /dev/null @@ -1 +0,0 @@ -Dots may now be used in resolver names to denote namespaces (e.g: `${namespace.my_func:123}`) diff --git a/news/540.api_change b/news/540.api_change deleted file mode 100644 index b81ba0144..000000000 --- a/news/540.api_change +++ /dev/null @@ -1 +0,0 @@ -A custom resolver interpolation whose output is a list or dictionary is now automatically converted into a ListConfig or DictConfig. diff --git a/news/540.feature b/news/540.feature deleted file mode 100644 index a3d2fd8b8..000000000 --- a/news/540.feature +++ /dev/null @@ -1 +0,0 @@ -Custom resolvers can now generate transient config nodes dynamically. diff --git a/news/541.feature b/news/541.feature deleted file mode 100644 index 803b345fb..000000000 --- a/news/541.feature +++ /dev/null @@ -1 +0,0 @@ -Add oc.select, enabling node selection with a default value to use if the node cannot be selected diff --git a/news/543.api_change b/news/543.api_change deleted file mode 100644 index 78391de36..000000000 --- a/news/543.api_change +++ /dev/null @@ -1 +0,0 @@ -`OmegaConf.select()`, `DictConfig.{get(),pop()}`, `ListConfig.{get(),pop()}` no longer return the specified default value when the accessed key is an interpolation that cannot be resolved: instead, an exception is raised. diff --git a/news/548.api_change b/news/548.api_change deleted file mode 100644 index c5231373a..000000000 --- a/news/548.api_change +++ /dev/null @@ -1 +0,0 @@ -OmegaConf.to_container now takes a `structured_config_mode` keyword argument. Setting `structured_config_mode=SCMode.DICT_CONFIG` causes `to_container` to not convert Structured Config objects to python dicts (it leaves them as DictConfig objects). diff --git a/news/554.bugfix b/news/554.bugfix deleted file mode 100644 index 5959ad7a5..000000000 --- a/news/554.bugfix +++ /dev/null @@ -1 +0,0 @@ -When a dictconfig has enum-typed keys, __delitem__ can now be called with a string naming the enum member to be deleted. diff --git a/news/560.api_change b/news/560.api_change deleted file mode 100644 index c521f8a28..000000000 --- a/news/560.api_change +++ /dev/null @@ -1 +0,0 @@ -OmegaConf.{merge, unsafe_merge, to_yaml} now raises a ValueError when called on a str input. Previously an AssertionError was raised. diff --git a/news/561.api_change b/news/561.api_change deleted file mode 100644 index f59c4276a..000000000 --- a/news/561.api_change +++ /dev/null @@ -1 +0,0 @@ -All exceptions raised during the resolution of an interpolation are either `InterpolationResolutionError` or a subclass of it. diff --git a/news/562.api_change b/news/562.api_change deleted file mode 100644 index 44a341eaa..000000000 --- a/news/562.api_change +++ /dev/null @@ -1 +0,0 @@ -`key in cfg` now returns True when `key` is an interpolation even if the interpolation target is a missing ("???") value. diff --git a/news/563.bugfix b/news/563.bugfix deleted file mode 100644 index a70adf663..000000000 --- a/news/563.bugfix +++ /dev/null @@ -1 +0,0 @@ -`OmegaConf.select()` of a missing ("???") node from a ListConfig with `throw_on_missing` set to True now raises the intended exception. diff --git a/news/565.api_change b/news/565.api_change deleted file mode 100644 index 8a153b548..000000000 --- a/news/565.api_change +++ /dev/null @@ -1,2 +0,0 @@ -`OmegaConf.select()` as well as container methods `get()` and `pop()` do not return their default value anymore when the accessed key is an interpolation that cannot be resolved: instead, an exception is raised. - diff --git a/news/572.api_change b/news/572.api_change deleted file mode 100644 index 4919b8762..000000000 --- a/news/572.api_change +++ /dev/null @@ -1,2 +0,0 @@ -Implicitly empty resolver arguments (e.g., `${foo:a,}`) are deprecated in favor of explicit quoted strings (e.g., `${foo:a,""}`) - diff --git a/news/573.api_change b/news/573.api_change deleted file mode 100644 index c7f9ccdd7..000000000 --- a/news/573.api_change +++ /dev/null @@ -1 +0,0 @@ -The `env` resolver is deprecated in favor of `oc.env`, which keeps the string representation of environment variables, does not cache the resulting value, and handles "null" as default value. diff --git a/news/574.feature b/news/574.feature deleted file mode 100644 index c62d93f6f..000000000 --- a/news/574.feature +++ /dev/null @@ -1 +0,0 @@ -New resolver `oc.decode` that can be used to automatically convert a string to bool, int, float, dict, list, etc. diff --git a/news/579.bugfix b/news/579.bugfix deleted file mode 100644 index 5b58c85de..000000000 --- a/news/579.bugfix +++ /dev/null @@ -1 +0,0 @@ -Prevent appending or inserting None in a ListConfig/DictConfig that has non-optional element/value type. diff --git a/news/583.bugfix.1 b/news/583.bugfix.1 deleted file mode 100644 index 03b60305f..000000000 --- a/news/583.bugfix.1 +++ /dev/null @@ -1 +0,0 @@ -`DictConfig.{get(),pop()}` now return `None` when the accessed key evaluates to `None`, instead of the specified default value (for consistency with regular Python dictionaries). diff --git a/news/583.bugfix.2 b/news/583.bugfix.2 deleted file mode 100644 index 2b8c3a2c7..000000000 --- a/news/583.bugfix.2 +++ /dev/null @@ -1,2 +0,0 @@ -`ListConfig.get()` now return `None` when the accessed key evaluates to `None`, instead of the specified default value (for consistency with DictConfig). - diff --git a/news/584.bugfix b/news/584.bugfix deleted file mode 100644 index efe509887..000000000 --- a/news/584.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix creation of structured config from a dict subclass: data from the dict is no longer thrown away. diff --git a/news/586.bugfix b/news/586.bugfix deleted file mode 100644 index ff20d1567..000000000 --- a/news/586.bugfix +++ /dev/null @@ -1 +0,0 @@ -Assignment of a dict/list to an existing node in a parent in struct mode no longer raises ValidationError diff --git a/news/589.bugfix b/news/589.bugfix deleted file mode 100644 index 586055e40..000000000 --- a/news/589.bugfix +++ /dev/null @@ -1 +0,0 @@ -Nested flag_override now properly restore the orignal state diff --git a/news/600.feature b/news/600.feature deleted file mode 100644 index 1fcf30f56..000000000 --- a/news/600.feature +++ /dev/null @@ -1 +0,0 @@ -The dollar character '$' is now allowed in interpolated key names, e.g. ${$var} diff --git a/news/608.api_change b/news/608.api_change deleted file mode 100644 index 1496337cf..000000000 --- a/news/608.api_change +++ /dev/null @@ -1 +0,0 @@ -`OmegaConf.get_resolver()` is deprecated: use the new `OmegaConf.has_resolver()` to check for the existence of a resolver. diff --git a/news/608.feature b/news/608.feature deleted file mode 100644 index 4edbc3363..000000000 --- a/news/608.feature +++ /dev/null @@ -1 +0,0 @@ -New function `OmegaConf.has_resolver()` allows checking whether a resolver has already been registered. diff --git a/news/640.feature b/news/640.feature deleted file mode 100644 index ec31b00e6..000000000 --- a/news/640.feature +++ /dev/null @@ -1 +0,0 @@ -Adds OmegaConf.resolve(cfg) for in-place interpolation resolution on cfg diff --git a/news/643.feature b/news/643.feature deleted file mode 100644 index a7fd0f083..000000000 --- a/news/643.feature +++ /dev/null @@ -1 +0,0 @@ -New resolvers `oc.dict.keys` and `oc.dict.values` provide a list view of the keys or values of a DictConfig node. diff --git a/news/645.feature b/news/645.feature deleted file mode 100644 index d03e889c9..000000000 --- a/news/645.feature +++ /dev/null @@ -1 +0,0 @@ -The new built-in resolver `oc.create` can be used to dynamically generate config nodes diff --git a/news/648.bugfix b/news/648.bugfix deleted file mode 100644 index 9e0766bf3..000000000 --- a/news/648.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix OmegaConf.create() to set the provided `parent` when creating a config from a YAML string. diff --git a/news/662.api_change b/news/662.api_change deleted file mode 100644 index 23daf7072..000000000 --- a/news/662.api_change +++ /dev/null @@ -1 +0,0 @@ -Interpolation cycles are now forbidden and will trigger an InterpolationResolutionError on access. diff --git a/news/663.api_change b/news/663.api_change deleted file mode 100644 index bf065c717..000000000 --- a/news/663.api_change +++ /dev/null @@ -1 +0,0 @@ -Support for Structured Configs that subclass `typing.Dict` is now deprecated. diff --git a/news/664.feature b/news/664.feature deleted file mode 100644 index 6709f418b..000000000 --- a/news/664.feature +++ /dev/null @@ -1 +0,0 @@ -force_add flag added to OmegaConf.update(), ensuring that the path is created even if it will result in insertion of new values into struct nodes. \ No newline at end of file diff --git a/news/667.api_change b/news/667.api_change deleted file mode 100644 index ced7e539b..000000000 --- a/news/667.api_change +++ /dev/null @@ -1 +0,0 @@ -OmegaConf.update() is now merging dict/list values into the destination node by default. Call with merge=False to replace instead. diff --git a/news/671.api_change b/news/671.api_change deleted file mode 100644 index b9d42fec1..000000000 --- a/news/671.api_change +++ /dev/null @@ -1 +0,0 @@ -Remove BaseContainer.{pretty,select,update_node} that have been deprecated since OmegaConf 2.0. diff --git a/news/678.bugfix b/news/678.bugfix deleted file mode 100644 index 8cbcd442d..000000000 --- a/news/678.bugfix +++ /dev/null @@ -1 +0,0 @@ -OmegaConf.select now returns None when attempting to select a child of a value or None node diff --git a/news/681.feature b/news/681.feature deleted file mode 100644 index e66dcac5f..000000000 --- a/news/681.feature +++ /dev/null @@ -1 +0,0 @@ -Introduce oc.deprecated resolver, that enables deprecating config nodes diff --git a/news/697.bugfix b/news/697.bugfix deleted file mode 100644 index a88460156..000000000 --- a/news/697.bugfix +++ /dev/null @@ -1 +0,0 @@ -Improve error message when creating a config from a Structured Config that fails type validation \ No newline at end of file diff --git a/omegaconf/version.py b/omegaconf/version.py index 50337d26d..9dff18c51 100644 --- a/omegaconf/version.py +++ b/omegaconf/version.py @@ -1,6 +1,6 @@ import sys # pragma: no cover -__version__ = "2.1.0dev27" +__version__ = "2.1.0.rc1" msg = """OmegaConf 2.0 and above is compatible with Python 3.6 and newer. You have the following options: