ert 17.0.0__py3-none-any.whl → 19.0.0rc2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- _ert/events.py +19 -2
- _ert/forward_model_runner/client.py +6 -2
- ert/__main__.py +28 -13
- ert/analysis/_enif_update.py +8 -4
- ert/analysis/_es_update.py +19 -6
- ert/analysis/_update_commons.py +16 -6
- ert/cli/main.py +13 -6
- ert/cli/monitor.py +7 -0
- ert/config/__init__.py +15 -6
- ert/config/_create_observation_dataframes.py +117 -20
- ert/config/_get_num_cpu.py +1 -1
- ert/config/_observations.py +91 -2
- ert/config/_read_summary.py +8 -6
- ert/config/design_matrix.py +51 -24
- ert/config/distribution.py +1 -1
- ert/config/ensemble_config.py +9 -17
- ert/config/ert_config.py +103 -19
- ert/config/everest_control.py +234 -0
- ert/config/{everest_objective_config.py → everest_response.py} +24 -15
- ert/config/field.py +96 -84
- ert/config/forward_model_step.py +122 -17
- ert/config/gen_data_config.py +5 -10
- ert/config/gen_kw_config.py +5 -35
- ert/config/known_response_types.py +14 -0
- ert/config/parameter_config.py +1 -33
- ert/config/parsing/_option_dict.py +10 -2
- ert/config/parsing/config_keywords.py +2 -0
- ert/config/parsing/config_schema.py +23 -3
- ert/config/parsing/config_schema_deprecations.py +3 -14
- ert/config/parsing/config_schema_item.py +26 -11
- ert/config/parsing/context_values.py +3 -3
- ert/config/parsing/file_context_token.py +1 -1
- ert/config/parsing/observations_parser.py +6 -2
- ert/config/parsing/queue_system.py +9 -0
- ert/config/parsing/schema_item_type.py +1 -0
- ert/config/queue_config.py +4 -5
- ert/config/response_config.py +0 -8
- ert/config/rft_config.py +275 -0
- ert/config/summary_config.py +3 -8
- ert/config/surface_config.py +59 -16
- ert/config/workflow_fixtures.py +2 -1
- ert/dark_storage/client/__init__.py +2 -2
- ert/dark_storage/client/_session.py +4 -4
- ert/dark_storage/client/client.py +2 -2
- ert/dark_storage/common.py +1 -1
- ert/dark_storage/compute/misfits.py +11 -7
- ert/dark_storage/endpoints/compute/misfits.py +6 -4
- ert/dark_storage/endpoints/experiment_server.py +12 -9
- ert/dark_storage/endpoints/experiments.py +2 -2
- ert/dark_storage/endpoints/observations.py +8 -6
- ert/dark_storage/endpoints/parameters.py +2 -18
- ert/dark_storage/endpoints/responses.py +24 -5
- ert/dark_storage/json_schema/experiment.py +1 -1
- ert/data/_measured_data.py +6 -5
- ert/ensemble_evaluator/__init__.py +8 -1
- ert/ensemble_evaluator/config.py +2 -1
- ert/ensemble_evaluator/evaluator.py +81 -29
- ert/ensemble_evaluator/event.py +6 -0
- ert/ensemble_evaluator/snapshot.py +3 -1
- ert/ensemble_evaluator/state.py +1 -0
- ert/field_utils/__init__.py +8 -0
- ert/field_utils/field_utils.py +212 -3
- ert/field_utils/roff_io.py +1 -1
- ert/gui/__init__.py +5 -2
- ert/gui/ertnotifier.py +1 -1
- ert/gui/ertwidgets/__init__.py +23 -16
- ert/gui/ertwidgets/analysismoduleedit.py +2 -2
- ert/gui/ertwidgets/checklist.py +1 -1
- ert/gui/ertwidgets/create_experiment_dialog.py +3 -1
- ert/gui/ertwidgets/ensembleselector.py +2 -2
- ert/gui/ertwidgets/models/__init__.py +2 -0
- ert/gui/ertwidgets/models/activerealizationsmodel.py +2 -1
- ert/gui/ertwidgets/models/path_model.py +1 -1
- ert/gui/ertwidgets/models/targetensemblemodel.py +2 -1
- ert/gui/ertwidgets/models/text_model.py +1 -1
- ert/gui/ertwidgets/pathchooser.py +0 -3
- ert/gui/ertwidgets/searchbox.py +13 -4
- ert/gui/{suggestor → ertwidgets/suggestor}/_suggestor_message.py +13 -4
- ert/gui/{suggestor → ertwidgets/suggestor}/suggestor.py +63 -30
- ert/gui/main.py +37 -8
- ert/gui/main_window.py +1 -7
- ert/gui/simulation/ensemble_experiment_panel.py +1 -1
- ert/gui/simulation/ensemble_information_filter_panel.py +1 -1
- ert/gui/simulation/ensemble_smoother_panel.py +1 -1
- ert/gui/simulation/evaluate_ensemble_panel.py +1 -1
- ert/gui/simulation/experiment_panel.py +16 -3
- ert/gui/simulation/manual_update_panel.py +31 -8
- ert/gui/simulation/multiple_data_assimilation_panel.py +12 -8
- ert/gui/simulation/run_dialog.py +27 -20
- ert/gui/simulation/single_test_run_panel.py +2 -2
- ert/gui/summarypanel.py +20 -1
- ert/gui/tools/load_results/load_results_panel.py +1 -1
- ert/gui/tools/manage_experiments/export_dialog.py +136 -0
- ert/gui/tools/manage_experiments/storage_info_widget.py +121 -16
- ert/gui/tools/manage_experiments/storage_widget.py +1 -2
- ert/gui/tools/plot/plot_api.py +37 -25
- ert/gui/tools/plot/plot_widget.py +10 -2
- ert/gui/tools/plot/plot_window.py +38 -18
- ert/gui/tools/plot/plottery/plot_config.py +2 -0
- ert/gui/tools/plot/plottery/plot_context.py +14 -0
- ert/gui/tools/plot/plottery/plots/__init__.py +2 -0
- ert/gui/tools/plot/plottery/plots/cesp.py +3 -1
- ert/gui/tools/plot/plottery/plots/distribution.py +6 -1
- ert/gui/tools/plot/plottery/plots/ensemble.py +12 -3
- ert/gui/tools/plot/plottery/plots/gaussian_kde.py +12 -2
- ert/gui/tools/plot/plottery/plots/histogram.py +3 -1
- ert/gui/tools/plot/plottery/plots/misfits.py +436 -0
- ert/gui/tools/plot/plottery/plots/observations.py +18 -4
- ert/gui/tools/plot/plottery/plots/statistics.py +62 -20
- ert/gui/tools/plot/plottery/plots/std_dev.py +3 -1
- ert/mode_definitions.py +2 -0
- ert/plugins/__init__.py +0 -1
- ert/plugins/hook_implementations/workflows/csv_export.py +2 -3
- ert/plugins/hook_implementations/workflows/gen_data_rft_export.py +10 -2
- ert/plugins/hook_specifications/__init__.py +0 -2
- ert/plugins/hook_specifications/jobs.py +0 -9
- ert/plugins/plugin_manager.py +6 -33
- ert/resources/forward_models/run_reservoirsimulator.py +8 -3
- ert/resources/shell_scripts/delete_directory.py +2 -2
- ert/run_models/__init__.py +18 -5
- ert/run_models/_create_run_path.py +131 -37
- ert/run_models/ensemble_experiment.py +10 -4
- ert/run_models/ensemble_information_filter.py +8 -1
- ert/run_models/ensemble_smoother.py +9 -3
- ert/run_models/evaluate_ensemble.py +8 -6
- ert/run_models/event.py +7 -3
- ert/run_models/everest_run_model.py +159 -46
- ert/run_models/initial_ensemble_run_model.py +25 -24
- ert/run_models/manual_update.py +6 -3
- ert/run_models/manual_update_enif.py +37 -0
- ert/run_models/model_factory.py +81 -21
- ert/run_models/multiple_data_assimilation.py +22 -11
- ert/run_models/run_model.py +64 -55
- ert/run_models/single_test_run.py +7 -4
- ert/run_models/update_run_model.py +4 -2
- ert/runpaths.py +5 -6
- ert/sample_prior.py +9 -4
- ert/scheduler/driver.py +37 -0
- ert/scheduler/event.py +3 -1
- ert/scheduler/job.py +23 -13
- ert/scheduler/lsf_driver.py +6 -2
- ert/scheduler/openpbs_driver.py +7 -1
- ert/scheduler/scheduler.py +5 -0
- ert/scheduler/slurm_driver.py +6 -2
- ert/services/__init__.py +2 -2
- ert/services/_base_service.py +37 -20
- ert/services/ert_server.py +317 -0
- ert/shared/_doc_utils/__init__.py +4 -2
- ert/shared/_doc_utils/ert_jobs.py +1 -4
- ert/shared/net_utils.py +43 -18
- ert/shared/storage/connection.py +3 -3
- ert/shared/version.py +3 -3
- ert/storage/__init__.py +2 -0
- ert/storage/local_ensemble.py +38 -12
- ert/storage/local_experiment.py +8 -16
- ert/storage/local_storage.py +68 -42
- ert/storage/migration/to11.py +1 -1
- ert/storage/migration/to16.py +38 -0
- ert/storage/migration/to17.py +42 -0
- ert/storage/migration/to18.py +11 -0
- ert/storage/migration/to19.py +34 -0
- ert/storage/migration/to20.py +23 -0
- ert/storage/migration/to21.py +25 -0
- ert/storage/migration/to8.py +4 -4
- ert/substitutions.py +12 -28
- ert/validation/active_range.py +7 -7
- ert/validation/rangestring.py +16 -16
- ert/workflow_runner.py +2 -1
- {ert-17.0.0.dist-info → ert-19.0.0rc2.dist-info}/METADATA +9 -8
- {ert-17.0.0.dist-info → ert-19.0.0rc2.dist-info}/RECORD +208 -205
- {ert-17.0.0.dist-info → ert-19.0.0rc2.dist-info}/WHEEL +1 -1
- everest/api/everest_data_api.py +14 -1
- everest/bin/config_branch_script.py +3 -6
- everest/bin/everconfigdump_script.py +1 -9
- everest/bin/everest_script.py +21 -11
- everest/bin/everlint_script.py +0 -2
- everest/bin/kill_script.py +2 -2
- everest/bin/monitor_script.py +2 -2
- everest/bin/utils.py +8 -4
- everest/bin/visualization_script.py +6 -14
- everest/config/__init__.py +4 -1
- everest/config/control_config.py +81 -6
- everest/config/control_variable_config.py +4 -3
- everest/config/everest_config.py +75 -42
- everest/config/forward_model_config.py +5 -3
- everest/config/install_data_config.py +7 -5
- everest/config/install_job_config.py +7 -3
- everest/config/install_template_config.py +3 -3
- everest/config/optimization_config.py +19 -6
- everest/config/output_constraint_config.py +8 -2
- everest/config/server_config.py +6 -49
- everest/config/utils.py +25 -105
- everest/config/validation_utils.py +17 -11
- everest/config_file_loader.py +13 -4
- everest/detached/client.py +3 -3
- everest/detached/everserver.py +7 -8
- everest/everest_storage.py +6 -12
- everest/gui/everest_client.py +2 -3
- everest/gui/main_window.py +2 -2
- everest/optimizer/everest2ropt.py +59 -32
- everest/optimizer/opt_model_transforms.py +12 -13
- everest/optimizer/utils.py +0 -29
- everest/strings.py +0 -5
- ert/config/everest_constraints_config.py +0 -95
- ert/config/ext_param_config.py +0 -106
- ert/gui/tools/export/__init__.py +0 -3
- ert/gui/tools/export/export_panel.py +0 -83
- ert/gui/tools/export/export_tool.py +0 -69
- ert/gui/tools/export/exporter.py +0 -36
- ert/services/storage_service.py +0 -127
- everest/config/sampler_config.py +0 -103
- everest/simulator/__init__.py +0 -88
- everest/simulator/everest_to_ert.py +0 -51
- /ert/gui/{suggestor → ertwidgets/suggestor}/__init__.py +0 -0
- /ert/gui/{suggestor → ertwidgets/suggestor}/_colors.py +0 -0
- {ert-17.0.0.dist-info → ert-19.0.0rc2.dist-info}/entry_points.txt +0 -0
- {ert-17.0.0.dist-info → ert-19.0.0rc2.dist-info}/licenses/COPYING +0 -0
- {ert-17.0.0.dist-info → ert-19.0.0rc2.dist-info}/top_level.txt +0 -0
_ert/events.py
CHANGED
|
@@ -41,10 +41,12 @@ class Id:
|
|
|
41
41
|
ENSEMBLE_SUCCEEDED_TYPE = Literal["ensemble.succeeded"]
|
|
42
42
|
ENSEMBLE_CANCELLED_TYPE = Literal["ensemble.cancelled"]
|
|
43
43
|
ENSEMBLE_FAILED_TYPE = Literal["ensemble.failed"]
|
|
44
|
+
ENSEMBLE_WARNING_TYPE = Literal["ensemble.warning"]
|
|
44
45
|
ENSEMBLE_STARTED: Final = "ensemble.started"
|
|
45
46
|
ENSEMBLE_SUCCEEDED: Final = "ensemble.succeeded"
|
|
46
47
|
ENSEMBLE_CANCELLED: Final = "ensemble.cancelled"
|
|
47
48
|
ENSEMBLE_FAILED: Final = "ensemble.failed"
|
|
49
|
+
ENSEMBLE_WARNING: Final = "ensemble.warning"
|
|
48
50
|
ENSEMBLE_TYPES = (
|
|
49
51
|
ENSEMBLE_STARTED_TYPE
|
|
50
52
|
| ENSEMBLE_FAILED_TYPE
|
|
@@ -170,6 +172,15 @@ class EnsembleCancelled(EnsembleBaseEvent):
|
|
|
170
172
|
event_type: Id.ENSEMBLE_CANCELLED_TYPE = Id.ENSEMBLE_CANCELLED
|
|
171
173
|
|
|
172
174
|
|
|
175
|
+
class EnsembleEvaluationWarning(EnsembleBaseEvent):
|
|
176
|
+
"""This event is to indicate that something unexpected happened while
|
|
177
|
+
running the ensemble, and that it might be stuck in an unresponsive state.
|
|
178
|
+
"""
|
|
179
|
+
|
|
180
|
+
event_type: Id.ENSEMBLE_WARNING_TYPE = Id.ENSEMBLE_WARNING
|
|
181
|
+
warning_message: str
|
|
182
|
+
|
|
183
|
+
|
|
173
184
|
class EESnapshot(EnsembleBaseEvent):
|
|
174
185
|
event_type: Id.EE_SNAPSHOT_TYPE = Id.EE_SNAPSHOT
|
|
175
186
|
snapshot: Any
|
|
@@ -200,9 +211,15 @@ RealizationEvent = (
|
|
|
200
211
|
| RealizationResubmit
|
|
201
212
|
)
|
|
202
213
|
|
|
203
|
-
EnsembleEvent =
|
|
214
|
+
EnsembleEvent = (
|
|
215
|
+
EnsembleStarted
|
|
216
|
+
| EnsembleSucceeded
|
|
217
|
+
| EnsembleFailed
|
|
218
|
+
| EnsembleCancelled
|
|
219
|
+
| EnsembleEvaluationWarning
|
|
220
|
+
)
|
|
204
221
|
|
|
205
|
-
EEEvent = EESnapshot | EESnapshotUpdate
|
|
222
|
+
EEEvent = EESnapshot | EESnapshotUpdate | EnsembleEvaluationWarning
|
|
206
223
|
|
|
207
224
|
SnapshotInputEvent = RealizationEvent | EnsembleEvent | FMEvent
|
|
208
225
|
|
|
@@ -2,8 +2,9 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import asyncio
|
|
4
4
|
import logging
|
|
5
|
+
import types
|
|
5
6
|
import uuid
|
|
6
|
-
from typing import
|
|
7
|
+
from typing import Self
|
|
7
8
|
|
|
8
9
|
import zmq
|
|
9
10
|
import zmq.asyncio
|
|
@@ -67,7 +68,10 @@ class Client:
|
|
|
67
68
|
return self
|
|
68
69
|
|
|
69
70
|
async def __aexit__(
|
|
70
|
-
self,
|
|
71
|
+
self,
|
|
72
|
+
exc_type: type[BaseException] | None,
|
|
73
|
+
exc_value: BaseException | None,
|
|
74
|
+
exc_traceback: types.TracebackType | None,
|
|
71
75
|
) -> None:
|
|
72
76
|
try:
|
|
73
77
|
await self.send(DISCONNECT_MSG)
|
ert/__main__.py
CHANGED
|
@@ -35,8 +35,9 @@ from ert.mode_definitions import (
|
|
|
35
35
|
)
|
|
36
36
|
from ert.namespace import Namespace
|
|
37
37
|
from ert.plugins import ErtRuntimePlugins, get_site_plugins, setup_site_logging
|
|
38
|
-
from ert.run_models.multiple_data_assimilation import
|
|
39
|
-
from ert.services import
|
|
38
|
+
from ert.run_models.multiple_data_assimilation import MultipleDataAssimilationConfig
|
|
39
|
+
from ert.services import ErtServer, WebvizErt
|
|
40
|
+
from ert.shared.status.utils import get_ert_memory_usage
|
|
40
41
|
from ert.shared.storage.command import add_parser_options as ert_api_add_parser_options
|
|
41
42
|
from ert.storage import ErtStorageException, ErtStoragePermissionError
|
|
42
43
|
from ert.trace import trace, tracer
|
|
@@ -53,9 +54,9 @@ logger = logging.getLogger(__name__)
|
|
|
53
54
|
|
|
54
55
|
|
|
55
56
|
def run_ert_storage(args: Namespace, _: ErtRuntimePlugins | None = None) -> None:
|
|
56
|
-
with
|
|
57
|
+
with ErtServer.start_server(
|
|
57
58
|
verbose=True,
|
|
58
|
-
project=ErtConfig.from_file(args.config).ens_path,
|
|
59
|
+
project=Path(ErtConfig.from_file(args.config).ens_path),
|
|
59
60
|
parent_pid=os.getpid(),
|
|
60
61
|
) as server:
|
|
61
62
|
server.wait()
|
|
@@ -79,18 +80,32 @@ def run_webviz_ert(args: Namespace, _: ErtRuntimePlugins | None = None) -> None:
|
|
|
79
80
|
# only use the base name of the config file path
|
|
80
81
|
kwargs["ert_config"] = os.path.basename(args.config)
|
|
81
82
|
kwargs["project"] = os.path.abspath(ens_path)
|
|
83
|
+
|
|
84
|
+
yellow = "\x1b[33m"
|
|
85
|
+
green = "\x1b[32m"
|
|
86
|
+
bold = "\x1b[1m"
|
|
87
|
+
reset = "\x1b[0m"
|
|
88
|
+
|
|
82
89
|
try:
|
|
83
|
-
with
|
|
90
|
+
with ErtServer.init_service(project=Path(ens_path).absolute()) as storage:
|
|
84
91
|
storage.wait_until_ready()
|
|
85
92
|
print(
|
|
86
|
-
"""
|
|
87
|
-
|
|
93
|
+
f"""
|
|
94
|
+
---------------------------------------------------------------
|
|
95
|
+
|
|
96
|
+
{yellow}{bold}Webviz-ERT is deprecated and will be removed in the near future{reset}
|
|
97
|
+
|
|
98
|
+
{green}{bold}Plotting capabilities provided by Webviz-ERT are now available
|
|
99
|
+
using the ERT plotter{reset}
|
|
100
|
+
|
|
101
|
+
---------------------------------------------------------------
|
|
88
102
|
|
|
89
103
|
Starting up Webviz-ERT. This might take more than a minute.
|
|
90
104
|
|
|
91
|
-
|
|
105
|
+
---------------------------------------------------------------
|
|
92
106
|
"""
|
|
93
107
|
)
|
|
108
|
+
logger.info("Show Webviz-ert deprecation warning")
|
|
94
109
|
webviz_kwargs = {
|
|
95
110
|
"experimental_mode": args.experimental_mode,
|
|
96
111
|
"verbose": args.verbose,
|
|
@@ -501,7 +516,7 @@ def get_ert_parser(parser: ArgumentParser | None = None) -> ArgumentParser:
|
|
|
501
516
|
es_mda_parser.add_argument(
|
|
502
517
|
"--weights",
|
|
503
518
|
type=valid_weights,
|
|
504
|
-
default=
|
|
519
|
+
default=MultipleDataAssimilationConfig.default_weights,
|
|
505
520
|
help="Example custom relative weights: '8,4,2,1'. This means multiple data "
|
|
506
521
|
"assimilation ensemble smoother will half the weight applied to the "
|
|
507
522
|
"observation errors from one iteration to the next across 4 iterations.",
|
|
@@ -566,15 +581,15 @@ def get_ert_parser(parser: ArgumentParser | None = None) -> ArgumentParser:
|
|
|
566
581
|
"--color-always",
|
|
567
582
|
action="store_true",
|
|
568
583
|
help="Force coloring of monitor output, which is automatically"
|
|
569
|
-
|
|
584
|
+
" disabled if the output stream is not a terminal.",
|
|
570
585
|
default=False,
|
|
571
586
|
)
|
|
572
587
|
cli_parser.add_argument(
|
|
573
588
|
"--disable-monitoring",
|
|
574
589
|
action="store_true",
|
|
575
590
|
help="Monitoring will continuously print the status of the realisations"
|
|
576
|
-
|
|
577
|
-
|
|
591
|
+
" classified into Waiting, Pending, Running, Failed, Finished"
|
|
592
|
+
" and Unknown.",
|
|
578
593
|
default=False,
|
|
579
594
|
)
|
|
580
595
|
cli_parser.add_argument(
|
|
@@ -598,7 +613,7 @@ def ert_parser(parser: ArgumentParser | None, args: Sequence[str]) -> Namespace:
|
|
|
598
613
|
def log_process_usage() -> None:
|
|
599
614
|
try:
|
|
600
615
|
usage = resource.getrusage(resource.RUSAGE_SELF)
|
|
601
|
-
max_rss =
|
|
616
|
+
max_rss = get_ert_memory_usage()
|
|
602
617
|
|
|
603
618
|
usage_dict: dict[str, int | float] = {
|
|
604
619
|
"User time": usage.ru_utime,
|
ert/analysis/_enif_update.py
CHANGED
|
@@ -160,10 +160,14 @@ def analysis_EnIF(
|
|
|
160
160
|
Y=S.T,
|
|
161
161
|
verbose_level=5,
|
|
162
162
|
)
|
|
163
|
-
|
|
163
|
+
updated_parameters = [
|
|
164
|
+
p
|
|
165
|
+
for p, config in source_ensemble.experiment.parameter_configuration.items()
|
|
166
|
+
if config.update
|
|
167
|
+
]
|
|
164
168
|
# Learn the precision matrix block-sparse over parameter groups
|
|
165
169
|
Prec_u = sp.sparse.csc_matrix((0, 0), dtype=float)
|
|
166
|
-
for param_group in
|
|
170
|
+
for param_group in updated_parameters:
|
|
167
171
|
config_node = source_ensemble.experiment.parameter_configuration[param_group]
|
|
168
172
|
X_local = source_ensemble.load_parameters_numpy(param_group, iens_active_index)
|
|
169
173
|
X_local_scaler = StandardScaler()
|
|
@@ -215,7 +219,7 @@ def analysis_EnIF(
|
|
|
215
219
|
|
|
216
220
|
# Iterate over parameters to store the updated ensemble
|
|
217
221
|
parameters_updated = 0
|
|
218
|
-
for param_group in
|
|
222
|
+
for param_group in updated_parameters:
|
|
219
223
|
log_msg = f"Storing data for {param_group}.."
|
|
220
224
|
logger.info(log_msg)
|
|
221
225
|
progress_callback(AnalysisStatusEvent(msg=log_msg))
|
|
@@ -241,7 +245,7 @@ def analysis_EnIF(
|
|
|
241
245
|
)
|
|
242
246
|
_copy_unupdated_parameters(
|
|
243
247
|
list(source_ensemble.experiment.parameter_configuration.keys()),
|
|
244
|
-
|
|
248
|
+
updated_parameters,
|
|
245
249
|
iens_active_index,
|
|
246
250
|
source_ensemble,
|
|
247
251
|
target_ensemble,
|
ert/analysis/_es_update.py
CHANGED
|
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import functools
|
|
4
4
|
import logging
|
|
5
|
+
import re
|
|
5
6
|
import time
|
|
6
7
|
import warnings
|
|
7
8
|
from collections.abc import Callable, Iterable, Sequence
|
|
@@ -441,6 +442,12 @@ def smoother_update(
|
|
|
441
442
|
with warnings.catch_warnings():
|
|
442
443
|
original_showwarning = warnings.showwarning
|
|
443
444
|
|
|
445
|
+
ILL_CONDITIONED_RE = re.compile(
|
|
446
|
+
r"^LinAlgWarning:.*ill[- ]?conditioned\s+matrix", re.IGNORECASE
|
|
447
|
+
)
|
|
448
|
+
LIMIT_ILL_CONDITIONED_WARNING = 1000
|
|
449
|
+
illconditioned_warn_counter = 0
|
|
450
|
+
|
|
444
451
|
def log_warning(
|
|
445
452
|
message: Warning | str,
|
|
446
453
|
category: type[Warning],
|
|
@@ -449,12 +456,18 @@ def smoother_update(
|
|
|
449
456
|
file: TextIO | None = None,
|
|
450
457
|
line: str | None = None,
|
|
451
458
|
) -> None:
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
)
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
459
|
+
nonlocal illconditioned_warn_counter
|
|
460
|
+
|
|
461
|
+
if ILL_CONDITIONED_RE.search(str(message)):
|
|
462
|
+
illconditioned_warn_counter += 1
|
|
463
|
+
|
|
464
|
+
if illconditioned_warn_counter < LIMIT_ILL_CONDITIONED_WARNING:
|
|
465
|
+
logger.warning(
|
|
466
|
+
f"{category.__name__}: {message} (from {filename}:{lineno})"
|
|
467
|
+
)
|
|
468
|
+
original_showwarning(
|
|
469
|
+
message, category, filename, lineno, file=file, line=line
|
|
470
|
+
)
|
|
458
471
|
|
|
459
472
|
warnings.showwarning = log_warning
|
|
460
473
|
analysis_ES(
|
ert/analysis/_update_commons.py
CHANGED
|
@@ -61,10 +61,19 @@ def _copy_unupdated_parameters(
|
|
|
61
61
|
|
|
62
62
|
# Copy the non-updated parameter groups from source to target
|
|
63
63
|
# for each active realization
|
|
64
|
+
complete_df: pl.DataFrame | None = None
|
|
64
65
|
for parameter_group in not_updated_parameter_groups:
|
|
65
|
-
source_ensemble.
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
data = source_ensemble.load_parameters(parameter_group, iens_active_index)
|
|
67
|
+
if isinstance(data, pl.DataFrame):
|
|
68
|
+
if complete_df is None:
|
|
69
|
+
complete_df = data
|
|
70
|
+
else:
|
|
71
|
+
complete_df = complete_df.join(data, on="realization")
|
|
72
|
+
else:
|
|
73
|
+
target_ensemble.save_parameters(dataset=data)
|
|
74
|
+
|
|
75
|
+
if complete_df is not None:
|
|
76
|
+
target_ensemble.save_parameters(complete_df)
|
|
68
77
|
|
|
69
78
|
|
|
70
79
|
def _expand_wildcards(
|
|
@@ -331,11 +340,12 @@ def _all_parameters(
|
|
|
331
340
|
) -> npt.NDArray[np.float64]:
|
|
332
341
|
"""Return all parameters in assimilation problem"""
|
|
333
342
|
|
|
334
|
-
|
|
335
|
-
|
|
343
|
+
groups_to_update = [
|
|
344
|
+
k for k, v in ensemble.experiment.parameter_configuration.items() if v.update
|
|
345
|
+
]
|
|
336
346
|
param_arrays = [
|
|
337
347
|
ensemble.load_parameters_numpy(param_group, iens_active_index)
|
|
338
|
-
for param_group in
|
|
348
|
+
for param_group in groups_to_update
|
|
339
349
|
]
|
|
340
350
|
|
|
341
351
|
return np.vstack(param_arrays)
|
ert/cli/main.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
1
|
from __future__ import annotations
|
|
3
2
|
|
|
4
3
|
import contextlib
|
|
@@ -7,6 +6,7 @@ import os
|
|
|
7
6
|
import queue
|
|
8
7
|
import sys
|
|
9
8
|
from collections import Counter
|
|
9
|
+
from pathlib import Path
|
|
10
10
|
from typing import TextIO
|
|
11
11
|
|
|
12
12
|
from _ert.threading import ErtThread
|
|
@@ -27,7 +27,7 @@ from ert.namespace import Namespace
|
|
|
27
27
|
from ert.plugins import ErtRuntimePlugins, get_site_plugins
|
|
28
28
|
from ert.run_models.event import StatusEvents
|
|
29
29
|
from ert.run_models.model_factory import create_model
|
|
30
|
-
from ert.storage import open_storage
|
|
30
|
+
from ert.storage import LocalStorage, open_storage
|
|
31
31
|
from ert.storage.local_storage import local_storage_set_ert_config
|
|
32
32
|
|
|
33
33
|
|
|
@@ -88,11 +88,15 @@ def run_cli(args: Namespace, runtime_plugins: ErtRuntimePlugins | None = None) -
|
|
|
88
88
|
)
|
|
89
89
|
|
|
90
90
|
if args.mode == WORKFLOW_MODE:
|
|
91
|
-
|
|
91
|
+
path = Path(ert_config.ens_path)
|
|
92
|
+
if LocalStorage.check_migration_needed(path):
|
|
93
|
+
LocalStorage.perform_migration(path)
|
|
94
|
+
with open_storage(path, "w") as storage:
|
|
92
95
|
execute_workflow(ert_config, storage, args.name)
|
|
93
96
|
return
|
|
94
97
|
|
|
95
98
|
status_queue: queue.SimpleQueue[StatusEvents] = queue.SimpleQueue()
|
|
99
|
+
using_local_queuesystem: bool = True
|
|
96
100
|
try:
|
|
97
101
|
with use_runtime_plugins(get_site_plugins()):
|
|
98
102
|
model = create_model(
|
|
@@ -100,6 +104,9 @@ def run_cli(args: Namespace, runtime_plugins: ErtRuntimePlugins | None = None) -
|
|
|
100
104
|
args,
|
|
101
105
|
status_queue,
|
|
102
106
|
)
|
|
107
|
+
using_local_queuesystem = (
|
|
108
|
+
ert_config.queue_config.queue_system == QueueSystem.LOCAL
|
|
109
|
+
)
|
|
103
110
|
except ValueError as e:
|
|
104
111
|
raise ErtCliError(f"{args.mode} was not valid, failed with: {e}") from e
|
|
105
112
|
|
|
@@ -116,17 +123,17 @@ def run_cli(args: Namespace, runtime_plugins: ErtRuntimePlugins | None = None) -
|
|
|
116
123
|
f"and DESIGN_MATRIX ({model.active_realizations.count(True)})"
|
|
117
124
|
)
|
|
118
125
|
|
|
119
|
-
if args.port_range is None and
|
|
126
|
+
if args.port_range is None and using_local_queuesystem:
|
|
120
127
|
# This is within the range for ephemeral ports as defined by
|
|
121
128
|
# most unix flavors https://en.wikipedia.org/wiki/Ephemeral_port
|
|
122
129
|
args.port_range = range(49152, 51819)
|
|
123
130
|
|
|
124
|
-
use_ipc_protocol = model.queue_system == QueueSystem.LOCAL
|
|
125
131
|
evaluator_server_config = EvaluatorServerConfig(
|
|
126
132
|
port_range=None
|
|
127
133
|
if args.port_range is None
|
|
128
134
|
else (min(args.port_range), max(args.port_range) + 1),
|
|
129
|
-
use_ipc_protocol=
|
|
135
|
+
use_ipc_protocol=using_local_queuesystem,
|
|
136
|
+
prioritize_private_ip_address=ert_config.prioritize_private_ip_address,
|
|
130
137
|
)
|
|
131
138
|
|
|
132
139
|
if model.check_if_runpath_exists():
|
ert/cli/monitor.py
CHANGED
|
@@ -9,6 +9,7 @@ from typing import TextIO
|
|
|
9
9
|
import humanize
|
|
10
10
|
from tqdm import tqdm
|
|
11
11
|
|
|
12
|
+
from _ert.events import EnsembleEvaluationWarning
|
|
12
13
|
from ert.ensemble_evaluator import (
|
|
13
14
|
EndEvent,
|
|
14
15
|
EnsembleSnapshot,
|
|
@@ -19,6 +20,7 @@ from ert.ensemble_evaluator import identifiers as ids
|
|
|
19
20
|
from ert.ensemble_evaluator.state import (
|
|
20
21
|
COLOR_FAILED,
|
|
21
22
|
COLOR_FINISHED,
|
|
23
|
+
COLOR_WARNING,
|
|
22
24
|
FORWARD_MODEL_STATE_FAILURE,
|
|
23
25
|
REAL_STATE_TO_COLOR,
|
|
24
26
|
)
|
|
@@ -96,6 +98,11 @@ class Monitor:
|
|
|
96
98
|
| RunModelErrorEvent() as event
|
|
97
99
|
):
|
|
98
100
|
event.write_as_csv(output_path)
|
|
101
|
+
case EnsembleEvaluationWarning(warning_message=msg):
|
|
102
|
+
print(
|
|
103
|
+
self._colorize(msg, color=COLOR_WARNING),
|
|
104
|
+
file=self._out,
|
|
105
|
+
)
|
|
99
106
|
|
|
100
107
|
def _print_step_errors(self) -> None:
|
|
101
108
|
failed_steps: dict[str | None, int] = {}
|
ert/config/__init__.py
CHANGED
|
@@ -11,9 +11,8 @@ from .ensemble_config import EnsembleConfig
|
|
|
11
11
|
from .ert_config import ErtConfig, forward_model_step_from_config_contents
|
|
12
12
|
from .ert_plugin import ErtPlugin
|
|
13
13
|
from .ert_script import ErtScript
|
|
14
|
-
from .
|
|
15
|
-
from .
|
|
16
|
-
from .ext_param_config import ExtParamConfig
|
|
14
|
+
from .everest_control import EverestControl, SamplerConfig
|
|
15
|
+
from .everest_response import EverestConstraintsConfig, EverestObjectivesConfig
|
|
17
16
|
from .external_ert_script import ExternalErtScript
|
|
18
17
|
from .field import Field, field_transform
|
|
19
18
|
from .forward_model_step import (
|
|
@@ -23,12 +22,16 @@ from .forward_model_step import (
|
|
|
23
22
|
ForwardModelStepPlugin,
|
|
24
23
|
ForwardModelStepValidationError,
|
|
25
24
|
ForwardModelStepWarning,
|
|
25
|
+
SiteInstalledForwardModelStep,
|
|
26
|
+
SiteOrUserForwardModelStep,
|
|
27
|
+
UserInstalledForwardModelStep,
|
|
26
28
|
)
|
|
27
29
|
from .gen_data_config import GenDataConfig
|
|
28
30
|
from .gen_kw_config import DataSource, GenKwConfig, PriorDict
|
|
31
|
+
from .known_response_types import KnownResponseTypes
|
|
29
32
|
from .lint_file import lint_file
|
|
30
33
|
from .model_config import ModelConfig
|
|
31
|
-
from .parameter_config import ParameterCardinality, ParameterConfig
|
|
34
|
+
from .parameter_config import ParameterCardinality, ParameterConfig
|
|
32
35
|
from .parsing import (
|
|
33
36
|
ConfigValidationError,
|
|
34
37
|
ConfigWarning,
|
|
@@ -45,6 +48,7 @@ from .queue_config import (
|
|
|
45
48
|
QueueConfig,
|
|
46
49
|
)
|
|
47
50
|
from .response_config import InvalidResponseFile, ResponseConfig, ResponseMetadata
|
|
51
|
+
from .rft_config import RFTConfig
|
|
48
52
|
from .summary_config import SummaryConfig
|
|
49
53
|
from .surface_config import SurfaceConfig
|
|
50
54
|
from .workflow import Workflow
|
|
@@ -86,9 +90,9 @@ __all__ = [
|
|
|
86
90
|
"ErtScript",
|
|
87
91
|
"ErtScriptWorkflow",
|
|
88
92
|
"EverestConstraintsConfig",
|
|
93
|
+
"EverestControl",
|
|
89
94
|
"EverestObjectivesConfig",
|
|
90
95
|
"ExecutableWorkflow",
|
|
91
|
-
"ExtParamConfig",
|
|
92
96
|
"ExternalErtScript",
|
|
93
97
|
"Field",
|
|
94
98
|
"ForwardModelStep",
|
|
@@ -105,6 +109,7 @@ __all__ = [
|
|
|
105
109
|
"InversionTypeES",
|
|
106
110
|
"KnownQueueOptions",
|
|
107
111
|
"KnownQueueOptionsAdapter",
|
|
112
|
+
"KnownResponseTypes",
|
|
108
113
|
"LegacyWorkflowConfigs",
|
|
109
114
|
"LocalQueueOptions",
|
|
110
115
|
"ModelConfig",
|
|
@@ -114,7 +119,6 @@ __all__ = [
|
|
|
114
119
|
"OutlierSettings",
|
|
115
120
|
"ParameterCardinality",
|
|
116
121
|
"ParameterConfig",
|
|
117
|
-
"ParameterMetadata",
|
|
118
122
|
"PostExperimentFixtures",
|
|
119
123
|
"PostSimulationFixtures",
|
|
120
124
|
"PostUpdateFixtures",
|
|
@@ -125,10 +129,15 @@ __all__ = [
|
|
|
125
129
|
"PriorDict",
|
|
126
130
|
"QueueConfig",
|
|
127
131
|
"QueueSystem",
|
|
132
|
+
"RFTConfig",
|
|
128
133
|
"ResponseConfig",
|
|
129
134
|
"ResponseMetadata",
|
|
135
|
+
"SamplerConfig",
|
|
136
|
+
"SiteInstalledForwardModelStep",
|
|
137
|
+
"SiteOrUserForwardModelStep",
|
|
130
138
|
"SummaryConfig",
|
|
131
139
|
"SurfaceConfig",
|
|
140
|
+
"UserInstalledForwardModelStep",
|
|
132
141
|
"WarningInfo",
|
|
133
142
|
"Workflow",
|
|
134
143
|
"WorkflowConfigs",
|