opaque
mlte/value/types/opaque.py
An opaque evaluation value, without semantics.
Opaque
Bases: Value
The 'default' Value instance for measurements that do not provide their own.
Source code in mlte/value/types/opaque.py
19 20 21 22 23 24 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 78 79 80 81 82 83 84 85 86 |
|
data = data
instance-attribute
The raw output from measurement execution.
__eq__(other)
Compare Opaque instances for equality.
Source code in mlte/value/types/opaque.py
82 83 84 85 86 |
|
__getitem__(key)
Access an item from the wrapped data object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The key that identifies the item to access |
required |
Returns:
Type | Description |
---|---|
Any
|
The value associated with |
Raises:
Type | Description |
---|---|
KeyError
|
If the key is not present |
Source code in mlte/value/types/opaque.py
67 68 69 70 71 72 73 74 75 76 |
|
__init__(metadata, data)
Initialize an Opaque instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
metadata
|
EvidenceMetadata
|
The generating measurement's metadata |
required |
data
|
Dict[str, Any]
|
The output of the measurement |
required |
Source code in mlte/value/types/opaque.py
24 25 26 27 28 29 30 31 32 33 |
|
__setitem__(key, value)
Raise ValueError to indicate Opaque is read-only.
Source code in mlte/value/types/opaque.py
78 79 80 |
|
from_model(model)
classmethod
Convert an opaque value model to its corresponding artifact.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
ArtifactModel
|
The model representation |
required |
Returns:
Type | Description |
---|---|
Opaque
|
The real value |
Source code in mlte/value/types/opaque.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
to_model()
Convert an opaque value artifact to its corresponding model.
Returns:
Type | Description |
---|---|
ArtifactModel
|
The artifact model |
Source code in mlte/value/types/opaque.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|