MetricsDelegate#
- class lsst.daf.butler.tests.MetricsDelegate(storageClass: StorageClass)#
Bases:
StorageClassDelegateParameter handler for parameters using Metrics.
Methods Summary
getComponent(composite, componentName)Attempt to retrieve component from composite object by heuristic.
handleParameters(inMemoryDataset[, parameters])Modify the in-memory dataset using the supplied parameters, returning a possibly new object.
selectResponsibleComponent(readComponent, ...)Select the best component for calculating a derived component.
Methods Documentation
- getComponent(composite: Any, componentName: str) Any#
Attempt to retrieve component from composite object by heuristic.
Will attempt a direct attribute retrieval, or else getter methods of the form “get_componentName” and “getComponentName”.
Parameters#
- composite
object Item to query for the component.
- componentName
str Name of component to retrieve.
Returns#
- component
object Component extracted from composite.
Raises#
- AttributeError
The attribute could not be read from the composite.
- composite
- handleParameters(inMemoryDataset: Any, parameters: Mapping[str, Any] | None = None) Any#
Modify the in-memory dataset using the supplied parameters, returning a possibly new object.
Parameters#
- inMemoryDataset
object Object to modify based on the parameters.
- parameters
dict Parameters to apply. Values are specific to the parameter. Supported parameters are defined in the associated
StorageClass. If no relevant parameters are specified the inMemoryDataset will be return unchanged.
Returns#
- inMemoryDataset
object Updated form of supplied in-memory dataset, after parameters have been used.
- inMemoryDataset
- classmethod selectResponsibleComponent(readComponent: str, fromComponents: set[str | None]) str#
Select the best component for calculating a derived component.
Given a possible set of components to choose from, return the component that should be used to calculate the requested derived component.
Parameters#
- derivedComponent
str The derived component that is being requested.
- fromComponents
setofstr The available set of component options from which that derived component can be computed.
Nonecan be included but should be ignored.
Returns#
- required
str The component that should be used.
Raises#
- NotImplementedError
Raised if this delegate refuses to answer the question.
- ValueError
Raised if this delegate can not determine a relevant component from the supplied options.
- derivedComponent