external
The base class for MLTE Evidence extensions.
NOTE: The ExternalEvidence implementation in this module should not be
confused with the Evidence implementation in the artifact module.
The Evidence implementation in artifact is a proper MLTE artifact, it
should be used for all "internal" types part of the MLTE evidence system.
The ExternalEvidence implementation in this module is meant to be extended by users
of MLTE to enrich the evidence system with their own evidence types; it provides
the link between the statically-typed MLTE evidence system and dynamic extensions.
ExternalEvidence
Bases: Evidence, ABC
The base class for MLTE evidence extensions.
Source code in mlte/evidence/external.py
25 26 27 28 29 30 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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |
__init__()
Initialize an instance
Source code in mlte/evidence/external.py
28 29 30 | |
__str__()
Return a string representation of this Evidence.
Source code in mlte/evidence/external.py
56 57 58 | |
__subclasshook__(subclass)
classmethod
Define the interface for all Evidence subclasses.
Source code in mlte/evidence/external.py
32 33 34 35 | |
deserialize(data)
abstractmethod
classmethod
Deserialize an Evidence instance from serialized representation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict[str, Any]
|
The serialized representation |
required |
Returns:
| Type | Description |
|---|---|
ExternalEvidence
|
The deserialized :param metadata: Evidence metadata associated with the evidence |
Source code in mlte/evidence/external.py
45 46 47 48 49 50 51 52 53 54 | |
from_model(model)
classmethod
Deserialize an Evidence from its corresponding model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
BaseModel
|
The artifact model |
required |
Returns:
| Type | Description |
|---|---|
ExternalEvidence
|
The deserialized artifact |
Source code in mlte/evidence/external.py
69 70 71 72 73 74 75 76 77 | |
serialize()
abstractmethod
Serialize the Evidence to a JSON-compatible dictionary.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
The dictionary representation |
Source code in mlte/evidence/external.py
37 38 39 40 41 42 43 | |
to_model()
Serialize an Evidence to its corresponding model.
Returns:
| Type | Description |
|---|---|
ArtifactModel
|
The artifact model |
Source code in mlte/evidence/external.py
60 61 62 63 64 65 66 67 | |