real
An Evidence instance for a scalar, real value.
Real
Bases: Evidence
Real implements the Evidence interface for a single real value.
Source code in mlte/evidence/types/real.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 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | |
unit = unit
instance-attribute
The unit, if any.
value = value
instance-attribute
The wrapped real value.
__eq__(other)
Comparison between Real values.
Source code in mlte/evidence/types/real.py
79 80 81 82 83 | |
__init__(value, unit=None)
Initialize a Real instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
float
|
The real 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/real.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
__str__()
Return a string representation of the Real.
Source code in mlte/evidence/types/real.py
75 76 77 | |
from_model(model)
classmethod
Convert a real value model to its corresponding artifact.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
BaseModel
|
The model representation |
required |
Returns:
| Type | Description |
|---|---|
Real
|
The real value |
Source code in mlte/evidence/types/real.py
62 63 64 65 66 67 68 69 70 71 72 73 | |
get_value_w_units()
Returns the float value as a Quantity, potentially with units.
Source code in mlte/evidence/types/real.py
45 46 47 48 49 | |
greater_or_equal_to(threshold, unit=None, success='', failure='')
classmethod
Determine if real is greater than or equal to threshold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
float
|
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/real.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | |
greater_than(threshold, unit=None, success='', failure='')
classmethod
Determine if real is strictly greater than threshold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
float
|
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/real.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
less_or_equal_to(threshold, unit=None, success='', failure='')
classmethod
Determine if real is less than or equal to threshold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
float
|
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/real.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 | |
less_than(threshold, unit=None, success='', failure='')
classmethod
Determine if real is strictly less than threshold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
float
|
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/real.py
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 a real value artifact to its corresponding model.
Returns:
| Type | Description |
|---|---|
ArtifactModel
|
The artifact model |
Source code in mlte/evidence/types/real.py
51 52 53 54 55 56 57 58 59 60 | |