ert 18.0.3__py3-none-any.whl → 18.0.5__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.
@@ -217,15 +217,4 @@ deprecated_keywords_list = [
217
217
  ),
218
218
  check=lambda line: line[0] == "DESIGN2PARAMS",
219
219
  ),
220
- DeprecationInfo(
221
- keyword="FORWARD_MODEL",
222
- message=(
223
- "FORWARD_MODEL DESIGN_KW will be replaced with RUN_TEMPLATE. "
224
- "DESIGN2PARAMS has been replaced by DESIGN_MATRIX, so the "
225
- "parameters are already available for magic string replacement "
226
- "with the RUN_TEMPLATE keyword. Please use this format: "
227
- "'RUN_TEMPLATE my_text_file_template.txt my_text_output_file.txt'"
228
- ),
229
- check=lambda line: line[0] == "DESIGN_KW",
230
- ),
231
220
  ]
@@ -315,6 +315,8 @@ class SchemaItem:
315
315
  self, line: Sequence[FileContextToken]
316
316
  ) -> Sequence[FileContextToken | dict[FileContextToken, FileContextToken]]:
317
317
  n = self.options_after
318
+ if not line:
319
+ return []
318
320
  if isinstance(n, Varies):
319
321
  args, kwargs = parse_variable_options(list(line), n.max_positionals)
320
322
  return [*args, kwargs] # type: ignore
@@ -5,6 +5,7 @@ import logging
5
5
  import math
6
6
  import os
7
7
  import time
8
+ from collections import defaultdict
8
9
  from collections.abc import Iterable, Mapping
9
10
  from copy import deepcopy
10
11
  from datetime import UTC, datetime
@@ -59,15 +60,17 @@ def _value_export_txt(
59
60
  with path.open("w") as f:
60
61
  for key, param_map in values.items():
61
62
  for param, value in param_map.items():
62
- if isinstance(value, (int | float)):
63
- if key == DESIGN_MATRIX_GROUP:
64
- print(f"{param} {value:g}", file=f)
65
- else:
66
- print(f"{key}:{param} {value:g}", file=f)
67
- elif key == DESIGN_MATRIX_GROUP:
68
- print(f"{param} {value}", file=f)
63
+ if isinstance(value, int):
64
+ value_str = str(value)
65
+ elif isinstance(value, float):
66
+ value_str = f"{value:g}"
69
67
  else:
70
- print(f"{key}:{param} {value}", file=f)
68
+ value_str = str(value)
69
+
70
+ if key == DESIGN_MATRIX_GROUP:
71
+ print(f"{param} {value_str}", file=f)
72
+ else:
73
+ print(f"{key}:{param} {value_str}", file=f)
71
74
 
72
75
 
73
76
  def _value_export_json(
@@ -102,7 +105,7 @@ def _generate_parameter_files(
102
105
  iens: int,
103
106
  fs: Ensemble,
104
107
  iteration: int,
105
- ) -> Mapping[str, Mapping[str, float | str]]:
108
+ ) -> tuple[Mapping[str, Mapping[str, float | str]], Mapping[str, float]]:
106
109
  """
107
110
  Generate parameter files that are placed in each runtime directory for
108
111
  forward-model jobs to consume.
@@ -117,8 +120,9 @@ def _generate_parameter_files(
117
120
  fs: Ensemble from which to load parameter data
118
121
 
119
122
  Returns:
120
- Returns the union of parameters returned by write_to_runpath for each
121
- parameter_config.
123
+ Returns a tuple containing: the union of parameters returned by
124
+ write_to_runpath for each parameter_config, and a dict with
125
+ timings/durations for each parameter type.
122
126
  """
123
127
  # preload scalar parameters for this realization
124
128
  keys = [
@@ -126,18 +130,23 @@ def _generate_parameter_files(
126
130
  for p in parameter_configs
127
131
  if p.cardinality == ParameterCardinality.multiple_configs_per_ensemble_dataset
128
132
  ]
133
+ export_timings: defaultdict[str, float] = defaultdict(float)
129
134
  scalar_data: dict[str, float | str] = {}
130
135
  if keys:
136
+ start_time = time.perf_counter()
131
137
  df = fs._load_scalar_keys(keys=keys, realizations=iens, transformed=True)
132
138
  scalar_data = df.to_dicts()[0]
139
+ export_timings["load_scalar_keys"] = time.perf_counter() - start_time
133
140
  exports: dict[str, dict[str, float | str]] = {}
134
141
  log_exports: dict[str, dict[str, float | str]] = {}
142
+
135
143
  for param in parameter_configs:
136
144
  # For the first iteration we do not write the parameter
137
145
  # to run path, as we expect to read if after the forward
138
146
  # model has completed.
139
147
  if param.forward_init and iteration == 0:
140
148
  continue
149
+ start_time = time.perf_counter()
141
150
  export_values: dict[str, dict[str, float | str]] | None = None
142
151
  log_export_values: dict[str, dict[str, float | str]] | None = {}
143
152
  if param.name in scalar_data:
@@ -164,11 +173,15 @@ def _generate_parameter_files(
164
173
  if log_export_values:
165
174
  for group, vals in log_export_values.items():
166
175
  log_exports.setdefault(group, {}).update(vals)
176
+ export_timings[param.type] += time.perf_counter() - start_time
167
177
  continue
168
-
178
+ start_time = time.perf_counter()
169
179
  _value_export_txt(run_path, export_base_name, exports | log_exports)
180
+ export_timings["value_export_txt"] = time.perf_counter() - start_time
181
+ start_time = time.perf_counter()
170
182
  _value_export_json(run_path, export_base_name, exports)
171
- return exports
183
+ export_timings["value_export_json"] = time.perf_counter() - start_time
184
+ return (exports, dict(export_timings))
172
185
 
173
186
 
174
187
  def _manifest_to_json(ensemble: Ensemble, iens: int, iter_: int) -> dict[str, Any]:
@@ -203,11 +216,15 @@ def _make_param_substituter(
203
216
  param_substituter = deepcopy(substituter)
204
217
  for values in param_data.values():
205
218
  for param_name, value in values.items():
206
- if isinstance(value, (int, float)):
207
- formatted_value = f"{value:.6g}"
219
+ if isinstance(value, int):
220
+ formatted_value = str(value)
221
+ elif isinstance(value, float):
222
+ formatted_value = f"{value:g}"
208
223
  else:
209
224
  formatted_value = str(value)
225
+
210
226
  param_substituter[f"<{param_name}>"] = formatted_value
227
+
211
228
  return param_substituter
212
229
 
213
230
 
@@ -239,7 +256,7 @@ def create_run_path(
239
256
  if run_arg.active:
240
257
  run_path.mkdir(parents=True, exist_ok=True)
241
258
  start_time = time.perf_counter()
242
- param_data = _generate_parameter_files(
259
+ (param_data, detailed_parameter_timings) = _generate_parameter_files(
243
260
  ensemble.experiment.parameter_configuration.values(),
244
261
  parameters_file,
245
262
  run_path,
@@ -247,6 +264,11 @@ def create_run_path(
247
264
  ensemble,
248
265
  ensemble.iteration,
249
266
  )
267
+ for parameter_type, duration in detailed_parameter_timings.items():
268
+ if parameter_type not in timings:
269
+ timings[parameter_type] = 0.0
270
+ timings[parameter_type] += duration
271
+
250
272
  timings["generate_parameter_files"] += time.perf_counter() - start_time
251
273
  real_iter_substituter = substituter.real_iter_substituter(
252
274
  run_arg.iens, ensemble.iteration
ert/shared/version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '18.0.3'
32
- __version_tuple__ = version_tuple = (18, 0, 3)
31
+ __version__ = version = '18.0.5'
32
+ __version_tuple__ = version_tuple = (18, 0, 5)
33
33
 
34
- __commit_id__ = commit_id = 'g211bdcd43'
34
+ __commit_id__ = commit_id = 'g13b681fbe'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ert
3
- Version: 18.0.3
3
+ Version: 18.0.5
4
4
  Summary: Ensemble based Reservoir Tool (ERT)
5
5
  Author-email: Equinor ASA <fg_sib-scout@equinor.com>
6
6
  License-Expression: GPL-3.0-only
@@ -89,8 +89,8 @@ ert/config/parsing/config_dict.py,sha256=yyBb-NeaFnIjENrcziVA11Bq43uGguUiPECcKWL
89
89
  ert/config/parsing/config_errors.py,sha256=p3lAcRPXTm4okupdVyLwRCVWJ_86a7rgCohkDaLRM10,4806
90
90
  ert/config/parsing/config_keywords.py,sha256=J8kgzDVhuM8jvCwzO1kfOxvOH_DnDASOZPaJZujcIgQ,1860
91
91
  ert/config/parsing/config_schema.py,sha256=9ws2C3Oc-eT5uB_Xy2IEvPWON7b9rZnIc2FpID7hhWc,9614
92
- ert/config/parsing/config_schema_deprecations.py,sha256=fmzyxUBxR9GtDNIkP0ozHWU2SH1TvyhBFFyFhG8vZjA,9125
93
- ert/config/parsing/config_schema_item.py,sha256=jjHT1KqobQvpLxh9gZ0rR8x_YylV29pvvP7oUASFwtA,14448
92
+ ert/config/parsing/config_schema_deprecations.py,sha256=xUkbe-_UA8UawNcUF58YwHHpHTAfC6XO2ZBN97jchKc,8611
93
+ ert/config/parsing/config_schema_item.py,sha256=3BsemNNXoFisT67iSxhGKTtRtflwnBw79_83l3X-uuU,14491
94
94
  ert/config/parsing/context_values.py,sha256=S_j_BKuwqSm8RZNnw6Ki2ZQ4jz0VFXXmh0MZA2OstmQ,2288
95
95
  ert/config/parsing/deprecation_info.py,sha256=E31LBTiG1qNeqACU8lTxp54bESIeuuVHgFim8j8uVjg,663
96
96
  ert/config/parsing/error_info.py,sha256=AMOS0v-_ECHESj4aoy0m2fUPPlw9SE1DN_8MsaHeilY,2906
@@ -369,7 +369,7 @@ ert/resources/workflows/jobs/shell/MOVE_DIRECTORY,sha256=Lh_u0-eCr5Usa8Xien44d6q
369
369
  ert/resources/workflows/jobs/shell/MOVE_FILE,sha256=MET6aPtDTVaoEDiTZqKqx_hRayJP3Gn-yubdwrJqpjw,48
370
370
  ert/resources/workflows/jobs/shell/SYMLINK,sha256=P6wYoLM6y7IqzJQE5ZWkKEj7ERfK9VTRJa6N1pKigeg,46
371
371
  ert/run_models/__init__.py,sha256=PzLAD_gFRm_oUq_zDByAlQ05zShrBRoCR8oCn2qg43I,1348
372
- ert/run_models/_create_run_path.py,sha256=kcjx-Q1RqswzI-lx0Y-3dApZMCNSEZHq7y2xs9BxjrE,11734
372
+ ert/run_models/_create_run_path.py,sha256=Cev5Cwprca3CbIIAqIHElcieOuBamX91gRdstkKR-As,12764
373
373
  ert/run_models/ensemble_experiment.py,sha256=bbwZtuQQy-3V5VKK8WpGnGe4rDd9A8A4B0skt70ds3Q,2968
374
374
  ert/run_models/ensemble_information_filter.py,sha256=WecqKB9XlN0Ktxu43jTftjSkw0Kp_GfxSUh-tPrT0_E,1297
375
375
  ert/run_models/ensemble_smoother.py,sha256=zGEG6DvASDaz_XsXrUT8Vbv7bxWIWw-wR4b1DGx6H3I,3802
@@ -400,7 +400,7 @@ ert/services/ert_server.py,sha256=geh5mkdAKqNKgG56DcwSnEpvf0wcUc7vuw4feG1ykEI,10
400
400
  ert/services/webviz_ert_service.py,sha256=J5vznqb_-DjlDMOze7tdvuBE4GWEPgJ5dIIXvRLKd0Y,650
401
401
  ert/shared/__init__.py,sha256=OwgL-31MxA0fabETJ5Svw0tqJpHi569CZDRFHdHiqA0,644
402
402
  ert/shared/net_utils.py,sha256=DDHIZLHdBnh7ZZ--1s-FUlsoNTSJJsfHmLQE44E2JqU,5324
403
- ert/shared/version.py,sha256=llZW1syJ0X_XI90_uTsjvEQ5V9UY3Fxv-4JUtLFBSRc,714
403
+ ert/shared/version.py,sha256=SxCVKe11yQFCplIrFx2YioWUSroggGgknWm6FI-tMh8,714
404
404
  ert/shared/_doc_utils/__init__.py,sha256=zSl-NUpWLF167PVTvfjn0T50gExjvyWPw5OGq5Bt2Dc,983
405
405
  ert/shared/_doc_utils/ert_jobs.py,sha256=uHP8ozhKwCHG6BkyhAgCGoy59JEFb102pHKot-5ZEys,8054
406
406
  ert/shared/_doc_utils/everest_jobs.py,sha256=uBDN7tIwlBJIZVZ6ZFL1tkewEJJGDLoeVrFIIrJznvM,2081
@@ -453,7 +453,7 @@ ert/validation/validation_status.py,sha256=f47_B7aS-9DEh6uaVzKxD97pXienkyTVVCqTy
453
453
  ert/warnings/__init__.py,sha256=IBwQVkdD7Njaad9PAB-9K-kr15wnA4EBKboxyqgu9NA,214
454
454
  ert/warnings/_warnings.py,sha256=7qhNZ0W4nnljzoOx6AXX7VlMv5pa34Ek5M5n1Ep0Kak,189
455
455
  ert/warnings/specific_warning_handler.py,sha256=5dVXtOhzcMmtPBGx4AOddXNPfzTFOPA7RVtdH8hLv68,932
456
- ert-18.0.3.dist-info/licenses/COPYING,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
456
+ ert-18.0.5.dist-info/licenses/COPYING,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
457
457
  everest/__init__.py,sha256=8_f50f6H3-onqaiuNCwC0Eiotdl9JuTxhwyF_54MVvU,306
458
458
  everest/config_file_loader.py,sha256=q_rmxk778uDrNxdQQW0tBs9R3hU4az6yGCJwuY_5xww,5698
459
459
  everest/everest_storage.py,sha256=Xg2CuRdhZOqljm0i6H5o-pejcMeCwncSGw7Q6beZRgY,42173
@@ -517,8 +517,8 @@ everest/templates/well_drill.tmpl,sha256=9iLexmBHMsMQNXyyRK4GlmVuVpVIxRcCHpy1av5
517
517
  everest/templates/well_order.tmpl,sha256=XJ1eVRkeyTdLu5sLsltJSSK6BDLN7rFOAqLdM3ZZy3w,75
518
518
  everest/util/__init__.py,sha256=xEYLz6pUtgkH8VHer1RfoCwKiO70dBnuhHonsOPaOx0,1359
519
519
  everest/util/forward_models.py,sha256=JPxHhLI6TrmQJwW50wwGBmw57TfRd8SG2svYhXFHrc8,1617
520
- ert-18.0.3.dist-info/METADATA,sha256=6VtOgk7bU0tXesTYDU64W3uB5doNHepwgh2Zsc31cMQ,10013
521
- ert-18.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
522
- ert-18.0.3.dist-info/entry_points.txt,sha256=ChZ7vn8Qy9v9rT8GM2JtAvWDN3NVoy4BIcvVRtU73CM,189
523
- ert-18.0.3.dist-info/top_level.txt,sha256=LRh9GfdfyDWfAGmrQgp_XdoMHA4v6aotw8xgsy5YyHE,17
524
- ert-18.0.3.dist-info/RECORD,,
520
+ ert-18.0.5.dist-info/METADATA,sha256=T_gVI7Ry5O9wPk6isM0I_qVDzXT7Bngn8SNBMhva95o,10013
521
+ ert-18.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
522
+ ert-18.0.5.dist-info/entry_points.txt,sha256=ChZ7vn8Qy9v9rT8GM2JtAvWDN3NVoy4BIcvVRtU73CM,189
523
+ ert-18.0.5.dist-info/top_level.txt,sha256=LRh9GfdfyDWfAGmrQgp_XdoMHA4v6aotw8xgsy5YyHE,17
524
+ ert-18.0.5.dist-info/RECORD,,
File without changes