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_configfor examples of usingZenField.- Parameters:
- hinttype, optional (default=Any)
- defaultAny, optional
- namestr, optional
- Attributes:
- zen_convert
Methods
hintdefault
name
See also
make_configcreate a config with customized field names, default values, and annotations.
Notes
defaultwill be returned as an instance ofdataclasses.Field. Mutable values (e.g. lists or dictionaries) passed todefaultwill automatically be “packaged” in a default-factory function [1].A type passed to
hintwill 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, ...])