hydra_zen.ZenField#

class hydra_zen.ZenField(hint=Any, default=<class 'NOTHING'>, name=<class 'NOTHING'>)[source]#

Specifies a field’s name and/or type-annotation and/or default value. Designed to specify fields in make_config.

See the Examples section of the docstring for make_config for examples of using ZenField.

Parameters:
hinttype, optional (default=Any)
defaultAny, optional
namestr, optional
Attributes:
zen_convert

Methods

hint

default

name

See also

make_config

create a config with customized field names, default values, and annotations.

Notes

default will be returned as an instance of dataclasses.Field. Mutable values (e.g. lists or dictionaries) passed to default will automatically be “packaged” in a default-factory function [1].

A type passed to hint will automatically be “broadened” such that the resulting type is compatible with Hydra’s set of supported type annotations [2].

References

__init__(hint=typing.Any, default=<class 'hydra_zen.structured_configs._implementations.NOTHING'>, name=<class 'hydra_zen.structured_configs._implementations.NOTHING'>, zen_convert=None, _builds_fn=<factory>)#

Methods

__init__([hint, default, name, zen_convert, ...])