Skip to content

Commit

Permalink
Use baserunmodel in test_egg_simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
yngve-sk committed Oct 25, 2024
1 parent 2cb3ea0 commit 4ae6530
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions tests/everest/test_egg_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import everest
from ert.config import ErtConfig, QueueSystem
from ert.config.parsing import ConfigKeys as ErtConfigKeys
from ert.ensemble_evaluator import EvaluatorServerConfig
from ert.run_models.everest_run_model import EverestRunModel
from everest.config import EverestConfig
from everest.config.export_config import ExportConfig
from everest.config_keys import ConfigKeys
Expand Down Expand Up @@ -693,12 +695,13 @@ def sweetcallbackofmine(self, *args, **kwargs):
self.called = True

cbtracker = CBTracker()
workflow = everest.suite._EverestWorkflow(
config=config, simulation_callback=cbtracker.sweetcallbackofmine
)
assert workflow is not None

with PluginSiteConfigEnv():
workflow.start_optimization()
run_model = EverestRunModel.create(
config, simulation_callback=cbtracker.sweetcallbackofmine
)
evaluator_server_config = EvaluatorServerConfig()
run_model.run_experiment(evaluator_server_config)

assert cbtracker.called
# TODO: The comparison is currently disabled because we know it would
Expand Down Expand Up @@ -819,12 +822,12 @@ def sweetcallbackofmine(self, *args, **kwargs):
self.called = True

cbtracker = CBTracker()
workflow = everest.suite._EverestWorkflow(
config=config, simulation_callback=cbtracker.sweetcallbackofmine
)
assert workflow is not None
with PluginSiteConfigEnv():
workflow.start_optimization()
run_model = EverestRunModel.create(
config, simulation_callback=cbtracker.sweetcallbackofmine
)
evaluator_server_config = EvaluatorServerConfig()
run_model.run_experiment(evaluator_server_config)

assert cbtracker.called

Expand Down

0 comments on commit 4ae6530

Please sign in to comment.