Skip to content

Commit 34bd5af

Browse files
committed
Use config es_settings instead of hardcoded ESSettings
Replace hardcoded `ESSettings(inversion="SUBSPACE")` and `ESSettings(localization=True)` with `config.analysis_config.es_settings` in integration and UI tests. Also remove stale comments in `test_update_snapshot`.
1 parent 59a7073 commit 34bd5af

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

tests/ert/ui_tests/cli/test_field_parameter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import xtgeo
1515

1616
from ert.analysis import build_strategy_map, smoother_update
17-
from ert.config import ErtConfig, ESSettings, ObservationSettings
17+
from ert.config import ErtConfig, ObservationSettings
1818
from ert.mode_definitions import ENSEMBLE_SMOOTHER_MODE
1919
from ert.storage import open_storage
2020

@@ -486,7 +486,7 @@ def test_field_param_update_using_heat_equation_zero_var_params_and_adaptive_loc
486486
with warnings.catch_warnings(record=True) as record:
487487
warnings.simplefilter("always") # Ensure all warnings are always recorded
488488
with caplog.at_level(logging.INFO):
489-
es_settings = ESSettings(localization=True)
489+
es_settings = config.analysis_config.es_settings
490490
strategy_map = build_strategy_map(
491491
parameters=config.ensemble_config.parameters,
492492
param_configs=new_prior.experiment.parameter_configuration,

tests/ert/unit_tests/analysis/test_es_update.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def test_update_report(
8686
)
8787
events = []
8888

89-
es_settings = ESSettings(inversion="SUBSPACE")
89+
es_settings = ert_config.analysis_config.es_settings
9090
strategy_map = build_strategy_map(
9191
parameters=ert_config.ensemble_config.parameters,
9292
param_configs=prior_ens.experiment.parameter_configuration,
@@ -162,7 +162,7 @@ def test_update_report_with_different_observation_status_from_smoother_update(
162162
)
163163
events = []
164164

165-
es_settings = ESSettings(inversion="SUBSPACE")
165+
es_settings = ert_config.analysis_config.es_settings
166166
strategy_map = build_strategy_map(
167167
parameters=ert_config.ensemble_config.parameters,
168168
param_configs=prior_ens.experiment.parameter_configuration,
@@ -446,9 +446,6 @@ def test_update_snapshot(
446446
]
447447
ert_config = snake_oil_case_storage
448448

449-
# Making sure that row scaling with a row scaling factor of 1.0
450-
# results in the same update as with ES.
451-
# Note: seed must be the same!
452449
experiment = snake_oil_storage.get_experiment_by_name("ensemble-experiment")
453450
prior_ens = experiment.get_ensemble_by_name("default_0")
454451
posterior_ens = snake_oil_storage.create_ensemble(
@@ -459,10 +456,9 @@ def test_update_snapshot(
459456
prior_ensemble=prior_ens,
460457
)
461458

462-
# Make sure we always have the same seed in updates
463459
rng = np.random.default_rng(42)
464460

465-
es_settings = ESSettings(inversion="SUBSPACE")
461+
es_settings = ert_config.analysis_config.es_settings
466462
strategy_map = build_strategy_map(
467463
parameters=list(ert_config.ensemble_config.parameters),
468464
param_configs=prior_ens.experiment.parameter_configuration,

0 commit comments

Comments
 (0)