RESOURCES

Laco vs hydra-zen

Laco vs hydra-zen

Quick mapping of hydra-zen APIs to their Laco counterparts.

hydra-zenLacoNotes
builds(Cls, **kw)L.call(Cls)(**kw)Both produce DictConfig{_target_: …}. Laco validates kwargs against the signature by default (strict=True).
partial(builds(fn, **kw))L.partial(fn)(**kw)Emits _partial_: true. Laco returns functools.partial[R] statically.
just(obj)L.just(obj)Wrap a non-instantiable value. Both emit an identity node.
MISSINGL.required[T]()L.required[float]() types as float; MISSING types as str.
make_config(a=1, b=2)@L.config class S: a: int = 1; b: int = 2@L.config is a dataclass; pyright gives accurate field types.
ZenStore / store(Cls)class G(L.Group[T])Entries are class attributes; typos caught at edit time.
zen(fn)@L.taskInstantiates only requested config fields; leaves defaults untouched.
@hydra.main@laco.main(config_name=…)Thin wrapper; applies @L.task implicitly if the function is not yet wrapped.
instantiate(cfg)laco.instantiate(cfg)Delegates to hydra.utils.instantiate; passes through _PASSTHROUGH_TYPES unchanged.
to_yaml(cfg)laco.dump(cfg)Strips name/version meta keys; adds _laco_: 1 version marker.
store.add_to_hydra_store()implicit on class declarationGroup.__init_subclass__ registers to ConfigStore on class creation.
@hydra.main + ZenStore.add_to_hydra_store()@laco.main(config_name=…)Full app loop: compose + override + instantiate + call.

Key differences

  1. Lie-typing contract. Laco's L.call(T)(**kw) statically types as T (not DictConfig) so nested composition stays type-safe. hydra-zen returns DictConfig everywhere and relies on builds's populate_full_signature for validation.
  2. No magic strings. Group names, entry names, packages, and interpolation paths are Python identities validated by pyright. hydra-zen still uses string keys in several places.
  3. Tracing. L.trace(lambda: Model(encoder=Encoder(depth=24))) records a config tree from ordinary Python. hydra-zen has no direct equivalent.
  4. CLI. laco compose / run / show are built-in. hydra-zen defers entirely to Hydra's CLI.

Examples referenced in this table