ert
ert copied to clipboard
Implement experiment interface in all run models
The current interface is
class Experiment(Protocol):
"""The experiment protocol which all experiments must implement."""
async def run(self, evaluator_server_config: "EvaluatorServerConfig") -> None:
"""Run the experiment to completion."""
pass
async def dispatch(self, event: CloudEvent, iter_: int) -> None:
"""Pass an event for iter_ to the experiment. The experiment will internalize
the event and update its state."""
pass
# TODO: this is preliminary, see https://github.com/equinor/ert/issues/3407
async def successful_realizations(self, iter_: int) -> int:
pass
@property
def id_(self) -> str:
"""The id of the experiment."""
pass
@id_.setter
def id_(self, value: str) -> None:
"""Set the id of the experiment. It should not be possible to set this
more than once."""
pass
Majority of run models are now implementing this interface in this branch: https://github.com/jondequinor/ert/tree/complete-experiment-api