hydra_zen.uses_zen_processing#
- hydra_zen.uses_zen_processing(x)[source]#
Returns
True
if the input is a targeted structured config that relies on zen-processing features during its instantiation process. See notes for more details- Parameters:
- xAny
- Returns:
- uses_zenbool
Notes
In order to support zen meta-fields and zen wrappers, hydra-zen redirects Hydra to an intermediary function –
hydra_zen.funcs.zen_processing
– during instantiation; i.e.zen_processing
is made to be the_target_
of the config and_zen_target
indicates the object that is ultimately being configured for instantiation.Examples
>>> from hydra_zen import builds, uses_zen_processing, to_yaml >>> ConfA = builds(dict, a=1) >>> ConfB = builds(dict, a=1, zen_partial=True) >>> ConfC = builds(dict, a=1, zen_wrappers=lambda x: x) >>> ConfD = builds(dict, a=1, zen_meta=dict(hidden_field=None)) >>> ConfE = builds(dict, a=1, zen_meta=dict(hidden_field=None), zen_partial=True) >>> uses_zen_processing(ConfA) False >>> uses_zen_processing(ConfB) False >>> uses_zen_processing(ConfC) True >>> uses_zen_processing(ConfD) True >>> uses_zen_processing(ConfE) True
Demonstrating the indirection that is used to facilitate zen-processing features.
>>> print(to_yaml(ConfE)) _target_: hydra_zen.funcs.zen_processing _zen_target: builtins.dict _zen_partial: true _zen_exclude: - hidden_field a: 1 hidden_field: null