Skip to content

model

mlte/catalog/entry/model.py

Model implementation for MLTE catalog entries.

CatalogEntry

Bases: Filterable

The base model for MLTE catalog entries.

Source code in mlte/catalog/model.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
class CatalogEntry(Filterable):
    """The base model for MLTE catalog entries."""

    header: CatalogEntryHeader
    """The header."""

    tags: List[str] = []
    """Tags for the problem for the entry."""

    qa_category: Optional[str] = None
    """The QA category for the entry."""

    quality_attribute: Optional[str] = None
    """The quality attribute for the entry."""

    code_type: CatalogEntryType
    """The code type the entry."""

    code: str
    """The actual code for the entry."""

    description: Optional[str] = None
    """The description of the code for the entry."""

    inputs: Optional[str] = None
    """The input for the entry."""

    output: Optional[str] = None
    """The output for the entry."""

    def get_identifier(self) -> str:
        return self.header.identifier

    def get_type(self) -> Any:
        return self.code_type

code instance-attribute

The actual code for the entry.

code_type instance-attribute

The code type the entry.

description = None class-attribute instance-attribute

The description of the code for the entry.

header instance-attribute

The header.

inputs = None class-attribute instance-attribute

The input for the entry.

output = None class-attribute instance-attribute

The output for the entry.

qa_category = None class-attribute instance-attribute

The QA category for the entry.

quality_attribute = None class-attribute instance-attribute

The quality attribute for the entry.

tags = [] class-attribute instance-attribute

Tags for the problem for the entry.

CatalogEntryHeader

Bases: BaseModel

The ArtifactHeaderModel contains the common metadata for all artifacts.

Source code in mlte/catalog/model.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
class CatalogEntryHeader(BaseModel):
    """The ArtifactHeaderModel contains the common metadata for all artifacts."""

    identifier: str
    """The unique identifier for the entry."""

    creator: Optional[str] = None
    """The username of the author for the entry."""

    created: Optional[int] = -1
    """The timestamp of creation of this entry, as Unix time."""

    updater: Optional[str] = None
    """The username of the author of the last edition."""

    updated: Optional[int] = -1
    """The timestamp of last update of this entry, as Unix time."""

    catalog_id: Optional[str] = None
    """The id of the catalog this entry came from."""

catalog_id = None class-attribute instance-attribute

The id of the catalog this entry came from.

created = -1 class-attribute instance-attribute

The timestamp of creation of this entry, as Unix time.

creator = None class-attribute instance-attribute

The username of the author for the entry.

identifier instance-attribute

The unique identifier for the entry.

updated = -1 class-attribute instance-attribute

The timestamp of last update of this entry, as Unix time.

updater = None class-attribute instance-attribute

The username of the author of the last edition.

CatalogEntryType

Bases: StrEnum

Types of catalog entries.

Source code in mlte/catalog/model.py
15
16
17
18
19
20
21
22
class CatalogEntryType(StrEnum):
    """Types of catalog entries."""

    MEASUREMENT = "measurement"
    """Classes that calculate a metric."""

    VALIDATION = "validation"
    """Validator method or class that compare measuremets to conditions."""

MEASUREMENT = 'measurement' class-attribute instance-attribute

Classes that calculate a metric.

VALIDATION = 'validation' class-attribute instance-attribute

Validator method or class that compare measuremets to conditions.