Skip to content

Commit

Permalink
Gather, join & save dataframes
Browse files Browse the repository at this point in the history
  • Loading branch information
yngve-sk committed Nov 7, 2024
1 parent 8325cbd commit 4f059b6
Show file tree
Hide file tree
Showing 3 changed files with 719 additions and 252 deletions.
9 changes: 9 additions & 0 deletions src/ert/run_models/everest_run_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from ert.ensemble_evaluator import EvaluatorServerConfig
from ert.storage import open_storage
from everest.config import EverestConfig
from everest.everest_storage import EverestStorage
from everest.optimizer.everest2ropt import everest2ropt
from everest.simulator import Simulator
from everest.simulator.everest_to_ert import everest_to_ert_config
Expand Down Expand Up @@ -401,6 +402,14 @@ def run_experiment(
# Initialize the ropt optimizer:
optimizer = self._create_optimizer(simulator)

self.ever_storage = EverestStorage(
simulator,
optimizer,
Path(self.everest_config.optimization_output_dir)
/ "dakota"
/ "OPT_DEFAULT.out",
)

# The SqliteStorage object is used to store optimization results from
# Seba in an sqlite database. It reacts directly to events emitted by
# Seba and is not called by Everest directly. The stored results are
Expand Down
5 changes: 5 additions & 0 deletions src/ert/storage/local_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from ert.config.gen_kw_config import GenKwConfig
from ert.storage.mode import BaseMode, Mode, require_write
from everest.everest_storage import JoinedBatchDataFrames

from .realization_storage_state import RealizationStorageState

Expand Down Expand Up @@ -502,6 +503,10 @@ def _find_state(realization: int) -> RealizationStorageState:

return [_find_state(i) for i in range(self.ensemble_size)]

def save_optimization_results(self, data: JoinedBatchDataFrames):

Check failure on line 506 in src/ert/storage/local_ensemble.py

View workflow job for this annotation

GitHub Actions / type-checking (3.12)

Function is missing a return type annotation
os.mkdir(self.mount_point / "optimization_results")
data.write_to_folder(self.mount_point / "optimization_results")

def get_summary_keyset(self) -> List[str]:
"""
Find the first folder with summary data then load the
Expand Down
Loading

0 comments on commit 4f059b6

Please sign in to comment.