FetchADRIO
adrio.adrio.FetchADRIO()
A specialization of ADRIO
that adds structure for ADRIOs that load data from an external source, such as an API. FetchADRIO provides an implementation of inspect
, and requires that you implement methods _fetch
and _process
instead.
FetchADRIO is an abstract class.
Attributes
class_name: str
-
The class name of the SimulationFunction.
context:
Context
-
The full context object.
dim:
Dimensions
-
The simulation’s dimensional information. This is a re-packaging of information contained in other context elements, like the geo scope.
ipm: BaseCompartmentModel
-
The simulation IPM.
name: AbsoluteName
-
The name under which this attribute is being evaluated.
randomized: bool
-
Should this function be re-evaluated every time it’s referenced in a RUME? (Mostly useful for randomized results.) If False, even a function that utilizes the context RNG will only be computed once, resulting in a single random value that is shared by all references during evaluation.
requirements: Sequence[AttributeDef] | property
-
The attribute definitions describing the data requirements for this function.
For advanced use-cases, you may specify requirements as a property if you need it to be dynamically computed.
result_format: ResultFormat[
ValueT
]-
Information about the format of the ADRIO’s resulting data.
This is an abstract method.
rng: np.random.Generator
-
The simulation’s random number generator.
scope:
GeoScope
-
The simulation GeoScope.
time_frame: TimeFrame
-
The simulation TimeFrame.
Methods
Name | Description |
---|---|
data |
Retrieve the value of a requirement. You must declare the attribute in this function’s requirements list. |
defer |
Defer processing to another instance of a SimulationFunction, returning the result of evaluation. |
defer_context |
Defer processing to another instance of a SimulationFunction. |
estimate_data |
Estimate the data usage for this ADRIO in a RUME. |
evaluate |
Evaluates the ADRIO in the current context. |
inspect |
Produce an inspection of the ADRIO’s data for the current context. |
validate |
Override this method to validate the function evaluation result. Implementations should raise an appropriate error if results are not valid. |
validate_context |
Validates the context before ADRIO evaluation. |
validate_result |
Validates that the result produced by an ADRIO adheres to the declared result format. |
with_context |
Constructs a clone of this instance which has access to the given context. |
with_context_internal |
Constructs a clone of this instance which has access to the given context. |