integer
mlte/value/types/integer.py
A Value instance for a scalar, integral value.
Integer
Bases: Value
Integer implements the Value interface for a single integer value.
Source code in mlte/value/types/integer.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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|
value = value
instance-attribute
The wrapped integer value.
__eq__(other)
Comparison between Integer values.
Source code in mlte/value/types/integer.py
71 72 73 74 75 |
|
__init__(metadata, value)
Initialize an Integer instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
metadata
|
EvidenceMetadata
|
The generating measurement's metadata |
required |
value
|
int
|
The integer value |
required |
Source code in mlte/value/types/integer.py
24 25 26 27 28 29 30 31 32 33 34 |
|
__str__()
Return a string representation of the Integer.
Source code in mlte/value/types/integer.py
77 78 79 |
|
from_model(model)
classmethod
Convert an integer value model to its corresponding artifact.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
ArtifactModel
|
The model representation |
required |
Returns:
Type | Description |
---|---|
Integer
|
The integer value |
Source code in mlte/value/types/integer.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
less_or_equal_to(threshold)
classmethod
Determine if integer is less than or equal to value
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
threshold
|
int
|
The threshold value |
required |
Returns:
Type | Description |
---|---|
Condition
|
The Condition that can be used to validate a Value. |
Source code in mlte/value/types/integer.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|
less_than(threshold)
classmethod
Determine if integer is strictly less than value
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
threshold
|
int
|
The threshold value |
required |
Returns:
Type | Description |
---|---|
Condition
|
The Condition that can be used to validate a Value. |
Source code in mlte/value/types/integer.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
to_model()
Convert an integer value artifact to its corresponding model.
Returns:
Type | Description |
---|---|
ArtifactModel
|
The artifact model |
Source code in mlte/value/types/integer.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|