source
optimus_dl.modules.metrics.source
¶
MetricSource
¶
Bases: ABC
Base class for data producers that extract information from the model.
Source code in optimus_dl/modules/metrics/source.py
config_hash
property
¶
Returns a deterministic hash of the source's configuration for cross-group caching.
provides
abstractmethod
property
¶
Returns the set of protocol strings this source provides.
requires
property
¶
Mapping from internal dependency role name to required protocol strings.
Override this if your source depends on the output of other sources.
__call__(dependencies, **kwargs)
abstractmethod
¶
Execute the source and return a dictionary mapping Protocol string to data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dependencies
|
dict[str, dict[str, Any]]
|
Data from required sources, mapped by protocol. |
required |
Source code in optimus_dl/modules/metrics/source.py
MetricSourceConfig
dataclass
¶
Bases: RegistryConfigStrict
Base configuration for metric sources.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dependencies
|
dict[str, str]
|
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2) |
<class 'dict'>
|
Source code in optimus_dl/modules/metrics/source.py
StandardProtocols
¶
Standardized string constants for common metric data protocols.