Skip to content

Commit 3fd3a0f

Browse files
committed
fix after rebase
1 parent b527dcc commit 3fd3a0f

10 files changed

Lines changed: 17 additions & 40 deletions

File tree

src/ert/config/gen_data_config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ def from_config_dict(cls, config_dict: ConfigDict) -> Self:
129129
input_files.append(res_file)
130130

131131
return cls(
132-
name="gen_data",
133132
keys=keys,
134133
input_files=input_files,
135134
report_steps_list=report_steps,

src/ert/config/response_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class InvalidResponseFile(Exception):
1414
"""
1515

1616

17-
class BaseResponseConfig(BaseModel):
17+
class BaseResponseConfig(BaseModel, extra="forbid"):
1818
type: str
1919

2020
@property

src/ert/config/summary_config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def from_config_dict(cls, config_dict: ConfigDict) -> SummaryConfig | None:
8282
"steps known to generate summary files"
8383
)
8484
return cls(
85-
name="summary",
8685
input_files=[eclbase.replace("%d", "<IENS>")],
8786
keys=[key for keys in summary_keys for key in keys],
8887
)

tests/ert/performance_tests/test_obs_and_responses_performance.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,13 @@ def create_experiment_args(
7474
random.seed(seed)
7575

7676
gen_data_config = GenDataConfig(
77-
name="gen_data",
7877
report_steps_list=[list(range(num_gen_data_report_steps))] * num_gen_data_keys,
7978
keys=[f"gen_data_{i}" for i in range(num_gen_data_keys)],
8079
).model_dump(mode="json")
8180

8281
# Remember to do one explicit .save_parameters to an ensemble
8382
# to get the finalized summary keys stored in the experiment
84-
summary_config = SummaryConfig(name="summary", keys=["*"]).model_dump(mode="json")
83+
summary_config = SummaryConfig(keys=["*"]).model_dump(mode="json")
8584

8685
genkw_data = (
8786
pl.DataFrame(

tests/ert/unit_tests/analysis/test_es_update.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ def test_update_handles_precision_loss_in_std_dev(tmp_path):
234234
"parameter_configuration": [gen_kw.model_dump(mode="json")],
235235
"response_configuration": [
236236
GenDataConfig(
237-
name="gen_data",
238237
input_files=["poly.out"],
239238
keys=["RES"],
240239
has_finalized_keys=True,

tests/ert/unit_tests/config/test_gen_data_config.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ def test_that_invalid_gendata_outfile_error_propagates(tmp_path):
120120
""")
121121

122122
config = GenDataConfig(
123-
name="gen_data",
124123
keys=["something"],
125124
report_steps_list=[None],
126125
input_files=["poly.out"],
@@ -142,7 +141,6 @@ def test_that_read_file_does_not_raise_unexpected_exceptions_on_invalid_file(con
142141
Path("./output").write_bytes(contents)
143142
with suppress(InvalidResponseFile):
144143
GenDataConfig(
145-
name="gen_data",
146144
keys=["something"],
147145
report_steps_list=[None],
148146
input_files=["output"],
@@ -152,7 +150,6 @@ def test_that_read_file_does_not_raise_unexpected_exceptions_on_invalid_file(con
152150
def test_that_read_file_does_not_raise_unexpected_exceptions_on_missing_file(tmpdir):
153151
with pytest.raises(FileNotFoundError, match="DOES_NOT_EXIST not found"):
154152
GenDataConfig(
155-
name="gen_data",
156153
keys=["something"],
157154
report_steps_list=[None],
158155
input_files=["DOES_NOT_EXIST"],
@@ -164,7 +161,6 @@ def test_that_read_file_does_not_raise_unexpected_exceptions_on_missing_director
164161
):
165162
with pytest.raises(FileNotFoundError, match="DOES_NOT_EXIST not found"):
166163
GenDataConfig(
167-
name="gen_data",
168164
keys=["something"],
169165
report_steps_list=[None],
170166
input_files=["DOES_NOT_EXIST"],

tests/ert/unit_tests/config/test_summary_config.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ def test_reading_empty_summaries_raises(wopr_summary):
3434

3535

3636
def test_summary_config_normalizes_list_of_keys():
37-
assert SummaryConfig(
38-
name="summary", input_files=["CASE"], keys=["FOPR", "WOPR", "WOPR"]
39-
).keys == [
37+
assert SummaryConfig(input_files=["CASE"], keys=["FOPR", "WOPR", "WOPR"]).keys == [
4038
"FOPR",
4139
"WOPR",
4240
]
@@ -50,26 +48,26 @@ def test_that_read_file_does_not_raise_unexpected_exceptions_on_invalid_file(
5048
Path("CASE.UNSMRY").write_bytes(unsmry)
5149
Path("CASE.SMSPEC").write_bytes(smspec)
5250
with suppress(InvalidResponseFile):
53-
SummaryConfig(
54-
name="summary", input_files=["CASE"], keys=["FOPR"]
55-
).read_from_file(Path.cwd(), 1, 0)
51+
SummaryConfig(input_files=["CASE"], keys=["FOPR"]).read_from_file(
52+
Path.cwd(), 1, 0
53+
)
5654

5755

5856
def test_that_read_file_does_not_raise_unexpected_exceptions_on_missing_file(tmpdir):
5957
with pytest.raises(FileNotFoundError):
60-
SummaryConfig(
61-
name="summary", input_files=["NOT_CASE"], keys=["FOPR"]
62-
).read_from_file(tmpdir, 1, 0)
58+
SummaryConfig(input_files=["NOT_CASE"], keys=["FOPR"]).read_from_file(
59+
tmpdir, 1, 0
60+
)
6361

6462

6563
@pytest.mark.usefixtures("use_tmpdir")
6664
def test_that_read_file_does_not_raise_unexpected_exceptions_on_missing_directory(
6765
tmp_path,
6866
):
6967
with pytest.raises(FileNotFoundError):
70-
SummaryConfig(
71-
name="summary", input_files=["CASE"], keys=["FOPR"]
72-
).read_from_file(str(tmp_path / "DOES_NOT_EXIST"), 1, 0)
68+
SummaryConfig(input_files=["CASE"], keys=["FOPR"]).read_from_file(
69+
str(tmp_path / "DOES_NOT_EXIST"), 1, 0
70+
)
7371

7472

7573
def create_observations(config, obs_config):

tests/ert/unit_tests/dark_storage/test_common.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_data_for_response_gives_mean_for_duplicate_values(tmp_path):
2727
value1 = 1.1
2828
value2 = 1.0e19
2929
with open_storage(tmp_path / "storage", mode="w") as storage:
30-
summary_config = SummaryConfig(name="summary", input_files=["CASE"], keys=["*"])
30+
summary_config = SummaryConfig(input_files=["CASE"], keys=["*"])
3131
experiment = storage.create_experiment(
3232
experiment_config={
3333
"response_configuration": [summary_config.model_dump(mode="json")]
@@ -81,9 +81,7 @@ def test_data_for_response_gives_mean_for_duplicate_values(tmp_path):
8181

8282
def test_data_for_response_doesnt_mistake_history_for_response(tmp_path):
8383
with open_storage(tmp_path / "storage", mode="w") as storage:
84-
summary_config = SummaryConfig(
85-
name="summary", input_files=["CASE"], keys=["FGPR"]
86-
)
84+
summary_config = SummaryConfig(input_files=["CASE"], keys=["FGPR"])
8785
experiment = storage.create_experiment(
8886
experiment_config={
8987
"response_configuration": [summary_config.model_dump(mode="json")]

tests/ert/unit_tests/gui/tools/plot/conftest.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ def mocked_requests_get(*args, **kwargs):
192192
"type": "gen_kw",
193193
"name": "BPR_138_PERSISTENCE",
194194
"forward_init": False,
195-
"update": True,
196195
"dimensionality": 1,
197196
"distribution": {"name": "uniform", "min": 0.2, "max": 0.7},
198197
"group": "SNAKE_OIL_PARAM",
@@ -202,7 +201,6 @@ def mocked_requests_get(*args, **kwargs):
202201
"type": "gen_kw",
203202
"name": "OP1_DIVERGENCE_SCALE",
204203
"forward_init": False,
205-
"update": True,
206204
"dimensionality": 1,
207205
"distribution": {"name": "uniform", "min": 0.5, "max": 1.5},
208206
"group": "SNAKE_OIL_PARAM",
@@ -212,7 +210,6 @@ def mocked_requests_get(*args, **kwargs):
212210
"type": "gen_kw",
213211
"name": "I_AM_A_PARAM",
214212
"forward_init": False,
215-
"update": True,
216213
"dimensionality": 1,
217214
"distribution": {"name": "normal", "mean": 0.0, "std": 1.0},
218215
"group": "SNAKE_OIL_PARAM",

tests/ert/unit_tests/gui/tools/plot/test_plot_api.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def test_key_def_structure(api: PlotApi):
9191
{
9292
"name": "BPR_138_PERSISTENCE",
9393
"forward_init": False,
94-
"update": True,
9594
"dimensionality": 1,
9695
"distribution": {"name": "uniform", "min": 0.2, "max": 0.7},
9796
"group": "SNAKE_OIL_PARAM",
@@ -225,7 +224,6 @@ def test_plot_api_handles_urlescape(api_and_storage):
225224
"parameter_configuration": [],
226225
"response_configuration": [
227226
SummaryConfig(
228-
name="summary",
229227
input_files=["CASE.UNSMRY", "CASE.SMSPEC"],
230228
keys=[key],
231229
).model_dump(mode="json")
@@ -371,7 +369,6 @@ def test_that_multiple_observations_are_parsed_correctly(api_and_storage):
371369
"parameter_configuration": [],
372370
"response_configuration": [
373371
SummaryConfig(
374-
name="summary",
375372
input_files=[""],
376373
keys=["WOPR:OP1"],
377374
has_finalized_keys=True,
@@ -419,9 +416,9 @@ def test_that_observations_for_empty_ensemble_returns_empty_data(api_and_storage
419416
experiment_config={
420417
"parameter_configuration": [],
421418
"response_configuration": [
422-
SummaryConfig(
423-
name="summary", input_files=[""], keys=["NAIMFRAC"]
424-
).model_dump(mode="json")
419+
SummaryConfig(input_files=[""], keys=["NAIMFRAC"]).model_dump(
420+
mode="json"
421+
)
425422
],
426423
"ert_templates": [],
427424
"observations": [],
@@ -443,7 +440,6 @@ def test_that_data_for_response_is_empty_for_ensembles_without_responses(
443440
"parameter_configuration": [],
444441
"response_configuration": [
445442
SummaryConfig(
446-
name="summary",
447443
input_files=[],
448444
keys=["FOPT"],
449445
has_finalized_keys=True,
@@ -474,7 +470,6 @@ def test_that_response_key_has_observation_when_only_one_experiment_has_observat
474470
"parameter_configuration": [],
475471
"response_configuration": [
476472
SummaryConfig(
477-
name="summary",
478473
input_files=["CASE.UNSMRY", "CASE.SMSPEC"],
479474
keys=["FOPR"],
480475
).model_dump(mode="json")
@@ -499,7 +494,6 @@ def test_that_response_key_has_observation_when_only_one_experiment_has_observat
499494
"parameter_configuration": [],
500495
"response_configuration": [
501496
SummaryConfig(
502-
name="summary",
503497
input_files=["CASE.UNSMRY", "CASE.SMSPEC"],
504498
keys=["FOPR"],
505499
).model_dump(mode="json")
@@ -563,7 +557,6 @@ def test_that_response_keys_do_not_match_keys_that_are_substrings(
563557
"parameter_configuration": [],
564558
"response_configuration": [
565559
SummaryConfig(
566-
name="summary",
567560
input_files=["CASE.UNSMRY", "CASE.SMSPEC"],
568561
keys=[key, history_key(key), "FOPR"],
569562
).model_dump(mode="json")
@@ -621,7 +614,6 @@ def _create_gradient_only_ensemble(storage):
621614
"parameter_configuration": [],
622615
"response_configuration": [
623616
EverestObjectivesConfig(
624-
name="everest_objectives",
625617
input_files=[f"{objective_key}.json"],
626618
keys=[objective_key],
627619
scales=[1.0],

0 commit comments

Comments
 (0)