external_measurement
mlte/measurement/external_measurement.py
Base class for measurements calculated by external functions.
ExternalMeasurement
Bases: Measurement
Source code in mlte/measurement/external_measurement.py
15 16 17 18 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 |
|
function = function
instance-attribute
Store the callable function itself.
__call__(*args, **kwargs)
Evaluate a measurement and return values without semantics.
Source code in mlte/measurement/external_measurement.py
46 47 48 49 50 51 52 53 54 |
|
__init__(identifier, value_type, function=None)
Initialize a new ExternalMeasurement measurement.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier
|
str
|
A unique identifier for the instance |
required |
value_type
|
type
|
The type of the Value this measurement will return. |
required |
function
|
Optional[Callable[..., Any]]
|
The function to be used when evaluating. |
None
|
Source code in mlte/measurement/external_measurement.py
16 17 18 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 |
|
ingest(*args, **kwargs)
Ingest data without evaluating a function, to wrap it as the configured Value type. Currently works the same as evaluate().
Source code in mlte/measurement/external_measurement.py
56 57 58 59 |
|
value()
classmethod
Returns the class type object for the Value produced by the Measurement.
Source code in mlte/measurement/external_measurement.py
61 62 63 64 |
|