Skip to content

Commit d7bf0e9

Browse files
committed
Remove unused property from ErtNotifier
1 parent d7efcc9 commit d7bf0e9

File tree

4 files changed

+11
-16
lines changed

4 files changed

+11
-16
lines changed

src/ert/gui/ertnotifier.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ class ErtNotifier(QObject):
1010
storage_changed = Signal(object, name="storageChanged")
1111
current_ensemble_changed = Signal(object, name="currentEnsembleChanged")
1212

13-
def __init__(self, config_file: str):
13+
def __init__(self) -> None:
1414
QObject.__init__(self)
15-
self._config_file = config_file
1615
self._storage: Storage | None = None
1716
self._current_ensemble: Ensemble | None = None
1817
self._is_simulation_running = False
@@ -26,10 +25,6 @@ def storage(self) -> Storage:
2625
assert self.is_storage_available
2726
return self._storage # type: ignore
2827

29-
@property
30-
def config_file(self) -> str:
31-
return self._config_file
32-
3328
@property
3429
def current_ensemble(self) -> Ensemble | None:
3530
if self._current_ensemble is None and self._storage is not None:

src/ert/gui/main_window.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def __init__(
8888
log_handler: GUILogHandler | None = None,
8989
):
9090
QMainWindow.__init__(self)
91-
self.notifier = ErtNotifier(config_file)
91+
self.notifier = ErtNotifier()
9292
self.plugins_tool: PluginsTool | None = None
9393
self.ert_config = ert_config
9494
self.config_file = config_file

tests/ert/ui_tests/gui/test_manage_experiments_tool.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
def test_init_prior(qtbot, storage):
2929
config = ErtConfig.from_file("poly.ert")
3030
config.random_seed = 1234
31-
notifier = ErtNotifier(config.config_path)
31+
notifier = ErtNotifier()
3232
notifier.set_storage(storage)
3333
ensemble = storage.create_experiment(
3434
parameters=config.ensemble_config.parameter_configuration,
@@ -62,7 +62,7 @@ def test_init_prior(qtbot, storage):
6262
@pytest.mark.usefixtures("copy_poly_case")
6363
def test_that_init_updates_the_info_tab(qtbot, storage):
6464
config = ErtConfig.from_file("poly.ert")
65-
notifier = ErtNotifier(config.config_path)
65+
notifier = ErtNotifier()
6666
notifier.set_storage(storage)
6767

6868
ensemble = storage.create_experiment(
@@ -132,7 +132,7 @@ def test_experiment_view(
132132
config = snake_oil_case_storage
133133
storage = snake_oil_storage
134134

135-
notifier = ErtNotifier(config.config_path)
135+
notifier = ErtNotifier()
136136
notifier.set_storage(storage)
137137

138138
tool = ManageExperimentsPanel(
@@ -164,7 +164,7 @@ def test_ensemble_view(
164164
config = snake_oil_case_storage
165165
storage = snake_oil_storage
166166

167-
notifier = ErtNotifier(config.config_path)
167+
notifier = ErtNotifier()
168168
notifier.set_storage(storage)
169169

170170
tool = ManageExperimentsPanel(
@@ -303,7 +303,7 @@ def _evaluate(coeffs, x):
303303
prior_ens, _ = run_cli_ES_with_case("poly_localization_0.ert")
304304
config = ErtConfig.from_file("poly_localization_0.ert")
305305

306-
notifier = ErtNotifier(config.config_path)
306+
notifier = ErtNotifier()
307307
with open_storage(config.ens_path, mode="w") as storage:
308308
notifier.set_storage(storage)
309309

@@ -349,7 +349,7 @@ def _evaluate(coeffs, x):
349349
@pytest.mark.usefixtures("copy_poly_case")
350350
def test_ensemble_observations_view_on_empty_ensemble(qtbot):
351351
config = ErtConfig.from_file("poly.ert")
352-
notifier = ErtNotifier(config.config_path)
352+
notifier = ErtNotifier()
353353
with open_storage(config.ens_path, mode="w") as storage:
354354
notifier.set_storage(storage)
355355
storage.create_experiment(
@@ -413,7 +413,7 @@ def test_realization_view(
413413
config = snake_oil_case_storage
414414
storage = snake_oil_storage
415415

416-
notifier = ErtNotifier(config.config_path)
416+
notifier = ErtNotifier()
417417
notifier.set_storage(storage)
418418

419419
tool = ManageExperimentsPanel(

tests/ert/unit_tests/gui/ertwidgets/test_ensembleselector.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from ert.config import ErtConfig, GenDataConfig, GenKwConfig
3+
from ert.config import GenDataConfig, GenKwConfig
44
from ert.config.gen_kw_config import TransformFunctionDefinition
55
from ert.gui.ertnotifier import ErtNotifier
66
from ert.gui.ertwidgets.ensembleselector import EnsembleSelector
@@ -27,7 +27,7 @@ def response():
2727

2828
@pytest.fixture
2929
def notifier():
30-
return ErtNotifier(ErtConfig())
30+
return ErtNotifier()
3131

3232

3333
def test_empty(qtbot, notifier):

0 commit comments

Comments
 (0)