API Reference

Top-level exports

CNN blocks (creyone_model.cnn)

Utilities (creyone_model.utils)

creyone_model.utils.config.type_subclass(cls, classinfo)[source]

Call issubclass safely, returning False if cls is not a type (e.g. MISSING).

Parameters:

cls (type)

Return type:

bool

class creyone_model.utils.config.BaseCfg[source]

Bases: object

Base class for hierarchical configuration dataclasses.

Subclasses should be decorated with @dataclass and may declare fields of primitive types or other BaseCfg subclasses. Fields whose default_factory is a BaseCfg subclass are built recursively by instance().

classmethod instance(**kwargs)[source]

Build an instance from kwargs and return any unconsumed kwargs.

Iterates over all dataclass fields, popping matching keys from kwargs. For fields whose default_factory is a BaseCfg subclass, the method recurses, passing both the field-specific kwargs and all remaining kwargs so that shared parameters propagate down. Each nested call returns its own unconsumed kwargs, which continue up the chain.

Parameters:

**kwargs – Keyword arguments keyed by field name. Values for nested BaseCfg fields should be provided as a dict of sub-kwargs for that config.

Returns:

A (instance, remaining_kwargs) tuple where remaining_kwargs holds any kwargs not consumed by this class or its nested configs.

Return type:

tuple[Any, dict[str, Any]]

__init__()
Return type:

None