kd.konfig.ConfigDict

kd.konfig.ConfigDict#

class kauldron.konfig.ConfigDict(
init_dict: dict[str, Any] | ml_collections.config_dict.config_dict.ConfigDict | None = None,
*,
_normalized: bool = False,
)[source]

Bases: ml_collections.config_dict.config_dict.ConfigDict

Wrapper around ConfigDict.

to_json(**dumps_kwargs) str[source]

Returns a JSON representation of the object, fails if there is a cycle.

Parameters:
  • json_encoder_cls – An optional JSON encoder class to customize JSON serialization.

  • **kwargs – Keyword arguments for json.dumps. They cannot contain “cls” as this method specifies it on its own.

Returns:

JSON representation of the object.

Raises:

TypeError – If self contains set, frozenset, custom type fields or any other objects that are not JSON serializable.

property ref: kauldron.konfig.configdict_base._SelfT

Lazy reference access.

Before:

cfg.get_ref('workdir')

After:

cfg.ref.workdir
Raises:

RuntimeError – When used outside of a konfig.ConfigDict context.