integer
An Evidence instance for a scalar, integral value.
Integer
Bases: Evidence
Integer implements the Value interface for a single integer value.
Source code in mlte/evidence/types/integer.py
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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |
unit = unit
instance-attribute
The unit, if any.
value = value
instance-attribute
The wrapped integer value.
__eq__(other)
Comparison between Integer values.
Source code in mlte/evidence/types/integer.py
74 75 76 77 78 | |
__init__(value, unit=None)
Initialize an Integer instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
int
|
The integer value |
required |
unit
|
Optional[Unit]
|
The unit the values comes in, as a value from Units, defaults to None. |
None
|
Source code in mlte/evidence/types/integer.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
__str__()
Return a string representation of this Evidence.
Source code in mlte/evidence/types/integer.py
80 81 82 | |
from_model(model)
classmethod
Convert an integer value model to its corresponding artifact.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
BaseModel
|
The model representation |
required |
Returns:
| Type | Description |
|---|---|
Integer
|
The integer value |
Source code in mlte/evidence/types/integer.py
61 62 63 64 65 66 67 68 69 70 71 72 | |
get_value_w_units()
Returns the int value as a Quantity, potentially with units.
Source code in mlte/evidence/types/integer.py
44 45 46 47 48 | |
less_or_equal_to(threshold, unit=None, success='', failure='')
classmethod
Determine if integer is less than or equal to value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
int
|
The threshold value |
required |
unit
|
Optional[Unit]
|
the unit the values comes in, as a value from Units |
None
|
Returns:
| Type | Description |
|---|---|
Validator
|
The Validator that can be used to validate Evidence. |
Source code in mlte/evidence/types/integer.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | |
less_than(threshold, unit=None, success='', failure='')
classmethod
Determine if integer is strictly less than value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
int
|
The threshold value |
required |
unit
|
Optional[Unit]
|
the unit the values comes in, as a value from Units |
None
|
Returns:
| Type | Description |
|---|---|
Validator
|
The Validator that can be used to validate Evidence. |
Source code in mlte/evidence/types/integer.py
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 110 111 112 | |
to_model()
Convert an integer value artifact to its corresponding model.
Returns:
| Type | Description |
|---|---|
ArtifactModel
|
The artifact model |
Source code in mlte/evidence/types/integer.py
50 51 52 53 54 55 56 57 58 59 | |