forked from equinor/ert
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge everest examples and ert test-data
- Loading branch information
Showing
557 changed files
with
233 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[submodule "test-data/block_storage"] | ||
path = test-data/block_storage | ||
[submodule "test-data/ert/block_storage"] | ||
path = test-data/ert/block_storage | ||
url = https://github.com/equinor/ert-testdata | ||
ignore = dirty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Submodule block_storage
updated
from 000000 to d5c676
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +0,0 @@ | ||
import importlib.util | ||
import sys | ||
from copy import deepcopy | ||
from datetime import datetime | ||
from typing import Any, Dict, Optional, Sequence | ||
|
||
from pydantic import BaseModel | ||
|
||
from ert.ensemble_evaluator.snapshot import ( | ||
EnsembleSnapshot, | ||
FMStepSnapshot, | ||
RealizationSnapshot, | ||
_filter_nones, | ||
) | ||
|
||
|
||
def import_from_location(name, location): | ||
spec = importlib.util.spec_from_file_location(name, location) | ||
if spec is None: | ||
raise ImportError(f"Could not find {name}") | ||
module = importlib.util.module_from_spec(spec) | ||
sys.modules[name] = module | ||
if spec.loader is None: | ||
raise ImportError(f"No loader for {name}") | ||
spec.loader.exec_module(module) | ||
return module | ||
|
||
|
||
class SnapshotBuilder(BaseModel): | ||
fm_steps: Dict[str, FMStepSnapshot] = {} | ||
metadata: Dict[str, Any] = {} | ||
|
||
def build( | ||
self, | ||
real_ids: Sequence[str], | ||
status: Optional[str], | ||
start_time: Optional[datetime] = None, | ||
end_time: Optional[datetime] = None, | ||
) -> EnsembleSnapshot: | ||
snapshot = EnsembleSnapshot() | ||
snapshot._ensemble_state = status | ||
snapshot._metadata = self.metadata | ||
|
||
for r_id in real_ids: | ||
snapshot.add_realization( | ||
r_id, | ||
RealizationSnapshot( | ||
active=True, | ||
fm_steps=deepcopy(self.fm_steps), | ||
start_time=start_time, | ||
end_time=end_time, | ||
status=status, | ||
), | ||
) | ||
return snapshot | ||
|
||
def add_fm_step( | ||
self, | ||
fm_step_id: str, | ||
index: str, | ||
name: Optional[str], | ||
status: Optional[str], | ||
current_memory_usage: Optional[str] = None, | ||
max_memory_usage: Optional[str] = None, | ||
start_time: Optional[datetime] = None, | ||
end_time: Optional[datetime] = None, | ||
stdout: Optional[str] = None, | ||
stderr: Optional[str] = None, | ||
) -> "SnapshotBuilder": | ||
self.fm_steps[fm_step_id] = _filter_nones( | ||
FMStepSnapshot( | ||
status=status, | ||
index=index, | ||
start_time=start_time, | ||
end_time=end_time, | ||
name=name, | ||
stdout=stdout, | ||
stderr=stderr, | ||
current_memory_usage=current_memory_usage, | ||
max_memory_usage=max_memory_usage, | ||
) | ||
) | ||
return self | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import importlib.util | ||
import sys | ||
from copy import deepcopy | ||
from datetime import datetime | ||
from typing import Any, Dict, Optional, Sequence | ||
|
||
from pydantic import BaseModel | ||
|
||
from ert.ensemble_evaluator.snapshot import ( | ||
EnsembleSnapshot, | ||
FMStepSnapshot, | ||
RealizationSnapshot, | ||
_filter_nones, | ||
) | ||
|
||
|
||
def import_from_location(name, location): | ||
spec = importlib.util.spec_from_file_location(name, location) | ||
if spec is None: | ||
raise ImportError(f"Could not find {name}") | ||
module = importlib.util.module_from_spec(spec) | ||
sys.modules[name] = module | ||
if spec.loader is None: | ||
raise ImportError(f"No loader for {name}") | ||
spec.loader.exec_module(module) | ||
return module | ||
|
||
|
||
class SnapshotBuilder(BaseModel): | ||
fm_steps: Dict[str, FMStepSnapshot] = {} | ||
metadata: Dict[str, Any] = {} | ||
|
||
def build( | ||
self, | ||
real_ids: Sequence[str], | ||
status: Optional[str], | ||
start_time: Optional[datetime] = None, | ||
end_time: Optional[datetime] = None, | ||
) -> EnsembleSnapshot: | ||
snapshot = EnsembleSnapshot() | ||
snapshot._ensemble_state = status | ||
snapshot._metadata = self.metadata | ||
|
||
for r_id in real_ids: | ||
snapshot.add_realization( | ||
r_id, | ||
RealizationSnapshot( | ||
active=True, | ||
fm_steps=deepcopy(self.fm_steps), | ||
start_time=start_time, | ||
end_time=end_time, | ||
status=status, | ||
), | ||
) | ||
return snapshot | ||
|
||
def add_fm_step( | ||
self, | ||
fm_step_id: str, | ||
index: str, | ||
name: Optional[str], | ||
status: Optional[str], | ||
current_memory_usage: Optional[str] = None, | ||
max_memory_usage: Optional[str] = None, | ||
start_time: Optional[datetime] = None, | ||
end_time: Optional[datetime] = None, | ||
stdout: Optional[str] = None, | ||
stderr: Optional[str] = None, | ||
) -> "SnapshotBuilder": | ||
self.fm_steps[fm_step_id] = _filter_nones( | ||
FMStepSnapshot( | ||
status=status, | ||
index=index, | ||
start_time=start_time, | ||
end_time=end_time, | ||
name=name, | ||
stdout=stdout, | ||
stderr=stderr, | ||
current_memory_usage=current_memory_usage, | ||
max_memory_usage=max_memory_usage, | ||
) | ||
) | ||
return self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Oops, something went wrong.