Skip to content

model

Model implementation for the Measurement artifact.

MeasurementMetadata

Bases: BaseModel

Info about a Measurement.

Source code in mlte/measurement/model.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class MeasurementMetadata(BaseModel):
    """Info about a Measurement."""

    measurement_class: str
    """The module/name of the class used for this measurement."""

    output_class: str
    """The module/class of the output produced by this measurement."""

    additional_data: dict[str, str] = {}
    """Additional metadata to add."""

    def __str__(self) -> str:
        """Return a string representation."""
        representation = (
            f"{self.measurement_class} - output class: {self.output_class}"
        )
        for key, additional_data in self.additional_data.items():
            representation += f"; {key}: {additional_data}"
        return representation

additional_data = {} class-attribute instance-attribute

Additional metadata to add.

measurement_class instance-attribute

The module/name of the class used for this measurement.

output_class instance-attribute

The module/class of the output produced by this measurement.

__str__()

Return a string representation.

Source code in mlte/measurement/model.py
20
21
22
23
24
25
26
27
def __str__(self) -> str:
    """Return a string representation."""
    representation = (
        f"{self.measurement_class} - output class: {self.output_class}"
    )
    for key, additional_data in self.additional_data.items():
        representation += f"; {key}: {additional_data}"
    return representation