Skip to content

model

Model implementation for MLTE catalog entries.

CatalogEntry

Bases: Filterable

The base model for MLTE catalog entries.

Source code in mlte/catalog/model.py
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class CatalogEntry(Filterable):
    """The base model for MLTE catalog entries."""

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

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

    quality_attribute: str = ""
    """The quality attribute for 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

code instance-attribute

The actual code for 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.

quality_attribute = '' 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
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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.