Skip to content

Commit

Permalink
Delete unused evaluate method in ensemble_evaluator_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-eq committed Dec 6, 2024
1 parent 710e6d5 commit 4b34fc9
Showing 1 changed file with 1 addition and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,9 @@
import websockets

from _ert.async_utils import new_event_loop
from _ert.events import (
EnsembleStarted,
EnsembleSucceeded,
ForwardModelStepRunning,
ForwardModelStepSuccess,
RealizationSuccess,
RealizationUnknown,
event_to_json,
)
from _ert.forward_model_runner.client import Client
from ert.config import QueueConfig
from ert.ensemble_evaluator import Ensemble
from ert.ensemble_evaluator._ensemble import ForwardModelStep, Realization
from ert.ensemble_evaluator._wait_for_evaluator import wait_for_evaluator


def _mock_ws(host, port, messages, delay_startup=0):
Expand Down Expand Up @@ -68,52 +57,7 @@ def __init__(self, _iter, reals, fm_steps, id_):
super().__init__(the_reals, {}, QueueConfig(), 0, id_)

async def evaluate(self, config, _, __):
event_id = 0
await wait_for_evaluator(
base_url=config.url,
token=config.token,
cert=config.cert,
)
async with Client(config.url + "/dispatch") as dispatch:
event = EnsembleStarted(ensemble=self.id_)
await dispatch._send(event_to_json(event))

event_id += 1
for real in range(0, self.test_reals):
real = str(real)

event = RealizationUnknown(ensemble=self.id_, real=real)
await dispatch._send(event_to_json(event))

event_id += 1
for fm_step in range(0, self.fm_steps):
fm_step = str(fm_step)

event = ForwardModelStepRunning(
ensemble=self.id_,
real=real,
fm_step=fm_step,
current_memory_usage=1000,
)
await dispatch._send(event_to_json(event))
event_id += 1

event = ForwardModelStepSuccess(
ensemble=self.id_,
real=real,
fm_step=fm_step,
current_memory_usage=1000,
)
await dispatch._send(event_to_json(event))
event_id += 1
event_id += 1

event = RealizationSuccess(ensemble=self.id_, real=real)
await dispatch._send(event_to_json(event))
event_id += 1

event = EnsembleSucceeded(ensemble=self.id_)
await dispatch._send(event_to_json(event))
pass

@property
def cancellable(self) -> bool:
Expand Down

0 comments on commit 4b34fc9

Please sign in to comment.