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 f9c476a
Show file tree
Hide file tree
Showing 3 changed files with 710 additions and 288 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 @@ -25,6 +25,7 @@

from ert.storage.local_experiment import LocalExperiment
from ert.storage.local_storage import LocalStorage
from everest.everest_storage import JoinedBatchDataFrames

logger = logging.getLogger(__name__)

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 f9c476a

Please sign in to comment.