Skip to content

Latest commit

 

History

History
80 lines (61 loc) · 5.95 KB

NEWS.md

File metadata and controls

80 lines (61 loc) · 5.95 KB

2.0.0rc6 (2020-01-29)

OmegaConf 2.0 is a major release introducing substantial new features, dropping Python 2.7 support, changing the internal data model and renaming some classes. As such it may require changes to client code in rare cases. The biggest new feature here is structured configs. With structured configs you can create OmegaConf objects from standard dataclasses or attr classes, or objects of each. OmegaConf will retain the type information from the source object/class and will validate against it at runtime.

Features

  • Add support for initializing OmegaConf from typed objects and classes (#87)
  • Enums can now be used as values and keys (#87),(#137)
  • In struct mode, exceptions raised on invalid access are now consistent with Python (#138),(#94)
    • KeyError is raised when using dictionary access style for a missing key: cfg["foo"]
    • AttributeError is raised when using attribute access style for a missing attribute: cfg.foo
  • DictConfig and ListConfig now implements typing.MutableMapping and typing.MutableSequence. (#114)
  • Structured configs can now inherit from Dict, making them open to arbitrary fields (#134)
  • Add OmegaConf.{is_config, is_list, is_dict} to test if an Object is an OmegaConf object, and if it's a list or a dict (#101)
  • Add OmegaConf.is_missing(cfg, key) to test if a key is missing ('???') in a config (#102)
  • fields with Dict and List types in structured configs can now be MISSING (#139)
  • OmegaConf now passes strict mypy tests (#105)
  • Add isort to ensure imports are kept sorted (#107)

Bug Fixes

  • Disable automatic conversion of date strings in yaml decoding (#95)
  • Fixed pretty to handle strings with unicode characters correctly (#111)
  • Fix eq fails if object contains unresolveable values (#124)
  • Correctly throw MissingMandatoryValue on indirect access of missing value (#99)
  • DictConfig pop now returns underlying value and not ValueNode (#127)
  • Container.select(key) now returns the root node when key is "" (#135)

Deprecations and Removals

  • Renamed omegaconf.Config to omegaconf.Container (#103)
  • Dropped support Python 2.7 and 3.5 (#88)

1.4.0 (2019-11-19)

Features

  • ListConfig now implements + operator (Allowing concatenation with other ListConfigs) (#36)
  • OmegaConf.save() now takes a resolve flag (defaults False) (#37)
  • Add OmegaConf.masked_copy(keys) function that returns a copy of a config with a subset of the keys (#42)
  • Improve built-in env resolver to return properly typed values ("1" -> int, "1.0" -> float etc) (#44)
  • Resolvers can now accept a list of zero or more arguments, for example: "${foo:a,b,..,n}" (#46)
  • Change semantics of contains check ('x' in conf): Missing mandatory values ('???') are now considered not included and contains test returns false for them (#49)
  • Allow assignment of a tuple value into a Config (#74)

Bug Fixes

  • Read-only list can no longer be replaced with command line override (#39)
  • Fix an error when expanding an empty dictionary in PyCharm debugger (#40)
  • Fix a bug in open_dict causing improper restoration of struct flag in some cases (#47)
  • Fix a bug preventing dotlist values from containing '=' (foo=bar=10 -> key: foo, value: bar=10) (#56)
  • Config.merge_with_dotlist() now throws if input is not a list or tuple of strings (#72)
  • Add copy method for DictConfig and improve shallow copy support (#82)

Deprecations and Removals

  • Deprecated Config.to_container() in favor of OmegaConf.to_container() (##41)
  • Deprecated config.save(file) in favor of OmegaConf.save(config, file) (#66)
  • Remove OmegaConf.{empty(), from_string(), from_dict(), from_list()}. Use OmegaConf.create() (deprecated since 1.1.5) (#67)
  • Remove Config.merge_from(). Use Config.merge_with() (deprecated since 1.1.0) (#67)
  • Remove OmegaConf.from_filename() and OmegaConf.from_file(). Use OmegaConf.load() (deprecated since 1.1.5) (#67)

Miscellaneous changes

  • Switch from tox to nox for test automation (#54)
  • Formatting code with Black (#54)
  • Switch from Travis to CircleCI for CI (#54)