Skip to content

Commit

Permalink
Remove seba snapshot from test_main_everest_entry.py
Browse files Browse the repository at this point in the history
  • Loading branch information
yngve-sk committed Jan 10, 2025
1 parent 4c172d3 commit 26c506a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/everest/functional/test_main_everest_entry.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os
from pathlib import Path
from textwrap import dedent

import pytest
from ruamel.yaml import YAML
from seba_sqlite.snapshot import SebaSnapshot
from tests.everest.utils import (
capture_streams,
skipif_no_everest_models,
Expand All @@ -13,6 +13,7 @@
from everest.bin.main import start_everest
from everest.config import EverestConfig, ServerConfig
from everest.detached import ServerStatus, everserver_status
from everest.everest_storage import EverestStorage

WELL_ORDER = "everest/model/config.yml"

Expand Down Expand Up @@ -56,14 +57,15 @@ def test_everest_entry_run(cached_example):

assert status["status"] == ServerStatus.completed

snapshot = SebaSnapshot(config.optimization_output_dir).get_snapshot()
storage = EverestStorage(Path(config.optimization_output_dir))
storage.read_from_output_dir()
optimal = storage.get_optimal_result()

best_settings = snapshot.optimization_data[-1]
assert best_settings.controls["point_x"] == pytest.approx(0.5, abs=0.05)
assert best_settings.controls["point_y"] == pytest.approx(0.5, abs=0.05)
assert best_settings.controls["point_z"] == pytest.approx(0.5, abs=0.05)
assert optimal.controls["point_x"] == pytest.approx(0.5, abs=0.05)
assert optimal.controls["point_y"] == pytest.approx(0.5, abs=0.05)
assert optimal.controls["point_z"] == pytest.approx(0.5, abs=0.05)

assert best_settings.objective_value == pytest.approx(0.0, abs=0.0005)
assert optimal.total_objective == pytest.approx(0.0, abs=0.0005)

with capture_streams():
start_everest(["everest", "monitor", config_file])
Expand Down

0 comments on commit 26c506a

Please sign in to comment.