Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug where seed was not set for manual initialization #8539

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def initialize_from_scratch(_: Any) -> None:
ensemble=ensemble_selector.currentData(),
active_realizations=[int(i) for i in members_model.getSelectedItems()],
parameters=parameters,
random_seed=self.ert_config.random_seed,
)

def update_button_state() -> None:
Expand Down
4 changes: 4 additions & 0 deletions tests/unit_tests/gui/tools/test_manage_experiments_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
@pytest.mark.usefixtures("copy_poly_case")
def test_init_prior(qtbot, storage):
config = ErtConfig.from_file("poly.ert")
config.random_seed = 1234
notifier = ErtNotifier(config.config_path)
notifier.set_storage(storage)
ensemble = storage.create_experiment(
Expand Down Expand Up @@ -46,6 +47,9 @@ def test_init_prior(qtbot, storage):
ensemble.get_ensemble_state()
== [RealizationStorageState.INITIALIZED] * config.model_config.num_realizations
)
assert ensemble.load_parameters("COEFFS")[
"transformed_values"
].mean() == pytest.approx(1.41487404)


@pytest.mark.usefixtures("copy_poly_case")
Expand Down