MetricsExampleModel

class lsst.daf.butler.tests.MetricsExampleModel(*, summary: dict[str, Any] | None = None, output: dict[str, Any] | None = None, data: list[Any] | None = None)

Bases: BaseModel

A variant of MetricsExample based on model.

Attributes Summary

model_computed_fields

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

Methods Summary

from_metrics(metrics)

Create a model based on an example.

Attributes Documentation

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'data': FieldInfo(annotation=Union[list[Any], NoneType], required=False, default=None), 'output': FieldInfo(annotation=Union[dict[str, Any], NoneType], required=False, default=None), 'summary': FieldInfo(annotation=Union[dict[str, Any], NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

Methods Documentation

classmethod from_metrics(metrics: MetricsExample) MetricsExampleModel

Create a model based on an example.

Parameters:
metricsMetricsExample

Metrics from which to construct the model.

Returns:
modelMetricsExampleModel

New model.