Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete unused evaluate method in ensemble_evaluator_utils #9472

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading