completor 1.1.2__tar.gz → 1.2.0__tar.gz

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.
Files changed (26) hide show
  1. {completor-1.1.2 → completor-1.2.0}/PKG-INFO +15 -13
  2. {completor-1.1.2 → completor-1.2.0}/completor/completion.py +14 -3
  3. {completor-1.1.2 → completor-1.2.0}/completor/constants.py +25 -6
  4. {completor-1.1.2 → completor-1.2.0}/completor/create_output.py +51 -27
  5. {completor-1.1.2 → completor-1.2.0}/completor/input_validation.py +58 -9
  6. {completor-1.1.2 → completor-1.2.0}/completor/prepare_outputs.py +325 -104
  7. {completor-1.1.2 → completor-1.2.0}/completor/read_casefile.py +125 -53
  8. {completor-1.1.2 → completor-1.2.0}/completor/utils.py +3 -2
  9. {completor-1.1.2 → completor-1.2.0}/completor/visualize_well.py +4 -2
  10. {completor-1.1.2 → completor-1.2.0}/completor/wells.py +6 -4
  11. {completor-1.1.2 → completor-1.2.0}/pyproject.toml +22 -19
  12. {completor-1.1.2 → completor-1.2.0}/LICENSE +0 -0
  13. {completor-1.1.2 → completor-1.2.0}/README.md +0 -0
  14. {completor-1.1.2 → completor-1.2.0}/completor/__init__.py +0 -0
  15. {completor-1.1.2 → completor-1.2.0}/completor/config_jobs/run_completor +0 -0
  16. {completor-1.1.2 → completor-1.2.0}/completor/exceptions/__init__.py +0 -0
  17. {completor-1.1.2 → completor-1.2.0}/completor/exceptions/clean_exceptions.py +0 -0
  18. {completor-1.1.2 → completor-1.2.0}/completor/exceptions/exceptions.py +0 -0
  19. {completor-1.1.2 → completor-1.2.0}/completor/get_version.py +0 -0
  20. {completor-1.1.2 → completor-1.2.0}/completor/hook_implementations/jobs.py +0 -0
  21. {completor-1.1.2 → completor-1.2.0}/completor/launch_args_parser.py +0 -0
  22. {completor-1.1.2 → completor-1.2.0}/completor/logger.py +0 -0
  23. {completor-1.1.2 → completor-1.2.0}/completor/main.py +0 -0
  24. {completor-1.1.2 → completor-1.2.0}/completor/parse.py +0 -0
  25. {completor-1.1.2 → completor-1.2.0}/completor/read_schedule.py +0 -0
  26. {completor-1.1.2 → completor-1.2.0}/completor/visualization.py +0 -0
@@ -1,28 +1,30 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: completor
3
- Version: 1.1.2
4
- Summary: Advanced mulit-segmented well completion tool.
3
+ Version: 1.2.0
4
+ Summary: Advanced multi-segmented well completion tool.
5
5
  Home-page: https://github.com/equinor/completor
6
6
  License: LGPL-3.0-only
7
7
  Author: Equinor ASA
8
8
  Author-email: opensource@equinor.com
9
- Requires-Python: >=3.11,<3.12
9
+ Requires-Python: >=3.11,<4.0
10
10
  Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
11
11
  Classifier: Natural Language :: English
12
12
  Classifier: Operating System :: OS Independent
13
13
  Classifier: Programming Language :: Python :: 3
14
14
  Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
15
16
  Provides-Extra: ert
16
- Requires-Dist: docutils (==0.20.1) ; extra == "ert"
17
- Requires-Dist: ert (>11.1.0) ; extra == "ert"
18
- Requires-Dist: matplotlib (>=3.6,<4.0)
19
- Requires-Dist: numpy (<2)
20
- Requires-Dist: pandas (>=2.1.4,<3.0.0)
21
- Requires-Dist: pyqt5-qt5 (==5.15.2) ; extra == "ert"
22
- Requires-Dist: pytest-env (>=1,<2)
23
- Requires-Dist: rstcheck-core (>=1.2.1,<2.0.0) ; extra == "ert"
24
- Requires-Dist: scipy (>=1.10,<2.0)
25
- Requires-Dist: tqdm (>=4.50,<5.0)
17
+ Provides-Extra: test
18
+ Requires-Dist: ert (>=12,<13) ; extra == "ert"
19
+ Requires-Dist: matplotlib (>=3.9,<4.0)
20
+ Requires-Dist: numpy (>=1.26,<3.0)
21
+ Requires-Dist: pandas (>=2.2,<3.0)
22
+ Requires-Dist: pytest (>=8.3,<9.0) ; extra == "test"
23
+ Requires-Dist: pytest-env (>=1,<2) ; extra == "test"
24
+ Requires-Dist: pytest-xdist (>=3.6,<4.0) ; extra == "test"
25
+ Requires-Dist: rstcheck-core (>=1.2,<2.0) ; extra == "test"
26
+ Requires-Dist: scipy (>=1.14,<2.0)
27
+ Requires-Dist: tqdm (>=4.66,<5.0)
26
28
  Project-URL: Bug Tracker, https://github.com/equinor/completor/issues
27
29
  Project-URL: Documentation, https://equinor.github.io/completor
28
30
  Project-URL: Repository, https://github.com/equinor/completor
@@ -551,7 +551,7 @@ def get_device(df_well: pd.DataFrame, df_device: pd.DataFrame, device_type: str)
551
551
  Args:
552
552
  df_well: Must contain device type, device number, and the scaling factor.
553
553
  df_device: Device table.
554
- device_type: Device type. `AICD`, `ICD`, `DAR`, `VALVE`, `AICV`, `ICV`.
554
+ device_type: Device type. `AICD`, `ICD`, `DENSITY`, `VALVE`, `DUALRCP`, `ICV`, `INJV`.
555
555
 
556
556
  Returns:
557
557
  Updated well information with device characteristics.
@@ -561,7 +561,14 @@ def get_device(df_well: pd.DataFrame, df_device: pd.DataFrame, device_type: str)
561
561
  """
562
562
  columns = [Headers.DEVICE_TYPE, Headers.DEVICE_NUMBER]
563
563
  try:
564
- df_well = pd.merge(df_well, df_device, how="left", on=columns)
564
+ df_well = pd.merge(df_well, df_device, how="left", on=columns, suffixes=("", "_drop"))
565
+ # check for duplicates if merging two WSEGVALV-es
566
+ for col in df_well.columns:
567
+ if col.endswith("_drop"):
568
+ base_col = col.replace("_drop", "")
569
+ if base_col in df_well.columns:
570
+ df_well[base_col] = df_well[base_col].fillna(df_well[col]) # Fill NaN values
571
+ df_well = df_well.drop(columns=[col for col in df_well.columns if col.endswith("_drop")])
565
572
  except KeyError as err:
566
573
  if f"'{Headers.DEVICE_TYPE}'" in str(err):
567
574
  raise ValueError(f"Missing keyword 'DEVICETYPE {device_type}' in input files.") from err
@@ -570,7 +577,11 @@ def get_device(df_well: pd.DataFrame, df_device: pd.DataFrame, device_type: str)
570
577
  # rescale the Cv
571
578
  # because no scaling factor in WELL_SEGMENTS_VALVE
572
579
  df_well[Headers.FLOW_COEFFICIENT] = -df_well[Headers.FLOW_COEFFICIENT] / df_well[Headers.SCALE_FACTOR]
573
- elif device_type == Content.DENSITY_ACTIVATED_RECOVERY:
580
+ elif device_type == Content.DENSITY:
581
+ # rescale the Cv
582
+ # because no scaling factor in WELL_SEGMENTS_VALVE
583
+ df_well[Headers.FLOW_COEFFICIENT] = -df_well[Headers.FLOW_COEFFICIENT] / df_well[Headers.SCALE_FACTOR]
584
+ elif device_type == Content.INJECTION_VALVE:
574
585
  # rescale the Cv
575
586
  # because no scaling factor in WELL_SEGMENTS_VALVE
576
587
  df_well[Headers.FLOW_COEFFICIENT] = -df_well[Headers.FLOW_COEFFICIENT] / df_well[Headers.SCALE_FACTOR]
@@ -78,7 +78,7 @@ class _Headers:
78
78
  DR = "DR"
79
79
  FLAG = "FLAG" # This is actually a header, but OPEN, SHUT, and AUTO are its possible values, see manual on COMPLETION_DATA.
80
80
  SHUT = "SHUT"
81
- # CROSS = "CROSS"
81
+ CROSS = "CROSS"
82
82
  PRESSURE_TABLE = "PRESSURETABLE"
83
83
  DENSITY_CALCULATION_TYPE = "DENSCAL" # Type of density calculation for the wellbore hydrostatic head.
84
84
  REGION = "REGION"
@@ -126,6 +126,7 @@ class _Headers:
126
126
  # This stops making sense from here on out?
127
127
  X = "X"
128
128
  Y = "Y"
129
+ Z = "Z"
129
130
  # FLAG
130
131
  A = "A"
131
132
  B = "B"
@@ -153,7 +154,7 @@ class _Headers:
153
154
  # 11. The length of the valve, lVAL (Scale factor).
154
155
  # 12. An integer which determines how the flow scaling factor is calculated.
155
156
 
156
- # Density Activated Recovery Well Segments (WSEGDAR)
157
+ # Density Driven Well Segments (WSEGDENSITY)
157
158
  # DEVICE_NUMBER
158
159
  # FLOW_COEFFICIENT / Cv
159
160
  # FLOW_CROSS_SECTIONAL_AREA
@@ -165,6 +166,15 @@ class _Headers:
165
166
  GAS_HOLDUP_FRACTION_LOW_CUTOFF = "GAS_HOLDUP_FRACTION_LOW_CUTOFF"
166
167
  GAS_HOLDUP_FRACTION_HIGH_CUTOFF = "GAS_HOLDUP_FRACTION_HIGH_CUTOFF"
167
168
 
169
+ # Injection Valve Well Segments (WSEGINJV)
170
+ # DEVICE_NUMBER
171
+ TRIGGER_PARAMETER = "TRIGGER_PARAMETER"
172
+ TRIGGER_VALUE = "TRIGGER_VALUE"
173
+ # FLOW_COEFFICIENT / Cv
174
+ # FLOW_CROSS_SECTIONAL_AREA
175
+ PRIMARY_FLOW_CROSS_SECTIONAL_AREA = "PRIMARY_FLOW_CROSS_SECTIONAL_AREA"
176
+ SECONDARY_FLOW_CROSS_SECTIONAL_AREA = "SECONDARY_FLOW_CROSS_SECTIONAL_AREA"
177
+
168
178
  # Miscellaneous
169
179
  DEFAULTS = "DEFAULTS"
170
180
  MEASURED_DEPTH = "MEASURED_DEPTH"
@@ -186,10 +196,10 @@ class _Headers:
186
196
  LATERAL = "LATERAL"
187
197
  NUMBER_OF_DEVICES = "NUMBER_OF_DEVICES"
188
198
  SEGMENT_DESC = "SEGMENT_DESC"
189
- AICV_WATER_CUT = "AICV_WATER_CUT"
190
- AICV_GAS_HOLDUP_FRACTION = "AICV_GAS_HOLDUP_FRACTION"
191
- AICV_CALIBRATION_FLUID_DENSITY = "AICV_CALIBRATION_FLUID_DENSITY"
192
- AICV_FLUID_VISCOSITY = "AICV_FLUID_VISCOSITY"
199
+ DUALRCP_WATER_CUT = "DUALRCP_WATER_CUT"
200
+ DUALRCP_GAS_HOLDUP_FRACTION = "DUALRCP_GAS_HOLDUP_FRACTION"
201
+ DUALRCP_CALIBRATION_FLUID_DENSITY = "DUALRCP_CALIBRATION_FLUID_DENSITY"
202
+ DUALRCP_FLUID_VISCOSITY = "DUALRCP_FLUID_VISCOSITY"
193
203
  AICD_CALIBRATION_FLUID_DENSITY = "AICD_CALIBRATION_FLUID_DENSITY"
194
204
  AICD_FLUID_VISCOSITY = "AICD_FLUID_VISCOSITY"
195
205
  ALPHA_MAIN = "ALPHA_MAIN"
@@ -239,10 +249,13 @@ class _Keywords:
239
249
  WELL_SEGMENTS_LINK = "WSEGLINK"
240
250
  WELL_SEGMENTS_VALVE = "WSEGVALV"
241
251
  AUTONOMOUS_INFLOW_CONTROL_DEVICE = "WSEGAICD"
252
+ DUAL_RATE_CONTROLLED_PRODUCTION = "WSEGDUALRCP"
242
253
  AUTONOMOUS_INFLOW_CONTROL_VALVE = "WSEGAICV"
243
254
  INFLOW_CONTROL_VALVE = "WSEGICV"
244
255
  INFLOW_CONTROL_DEVICE = "WSEGSICD"
256
+ DENSITY = "WSEGDENSITY"
245
257
  DENSITY_ACTIVATED_RECOVERY = "WSEGDAR"
258
+ INJECTION_VALVE = "WSEGINJV"
246
259
  LATERAL_TO_DEVICE = "LATERAL_TO_DEVICE"
247
260
  JOINT_LENGTH = "JOINTLENGTH"
248
261
  SEGMENT_LENGTH = "SEGMENTLENGTH"
@@ -282,15 +295,21 @@ class _Content:
282
295
 
283
296
  PERFORATED = "PERF"
284
297
  INFLOW_CONTROL_VALVE = "ICV"
298
+ DUAL_RATE_CONTROLLED_PRODUCTION = "DUALRCP"
285
299
  AUTONOMOUS_INFLOW_CONTROL_VALVE = "AICV"
286
300
  INFLOW_CONTROL_DEVICE = "ICD"
287
301
  AUTONOMOUS_INFLOW_CONTROL_DEVICE = "AICD"
302
+ DENSITY = "DENSITY"
288
303
  DENSITY_ACTIVATED_RECOVERY = "DAR"
304
+ INJECTION_VALVE = "INJV"
289
305
  VALVE = "VALVE"
290
306
  DEVICE_TYPES = [
291
307
  AUTONOMOUS_INFLOW_CONTROL_DEVICE,
308
+ DUAL_RATE_CONTROLLED_PRODUCTION,
292
309
  AUTONOMOUS_INFLOW_CONTROL_VALVE,
310
+ DENSITY,
293
311
  DENSITY_ACTIVATED_RECOVERY,
312
+ INJECTION_VALVE,
294
313
  INFLOW_CONTROL_DEVICE,
295
314
  VALVE,
296
315
  INFLOW_CONTROL_VALVE,
@@ -40,8 +40,9 @@ def format_output(well: Well, case: ReadCasefile, figure_name: str | None = None
40
40
  print_inflow_control_valve = ""
41
41
  print_autonomous_inflow_control_device = ""
42
42
  print_inflow_control_device = ""
43
- print_density_activated_recovery = ""
44
- print_autonomous_inflow_control_valve = ""
43
+ print_density_driven = ""
44
+ print_injection_valve = ""
45
+ print_dual_rate_controlled_production = ""
45
46
 
46
47
  start_segment = 2
47
48
  start_branch = 1
@@ -110,10 +111,9 @@ def format_output(well: Well, case: ReadCasefile, figure_name: str | None = None
110
111
  df_autonomous_inflow_control_device = prepare_outputs.prepare_autonomous_inflow_control_device(
111
112
  well.well_name, lateral.df_well, lateral.df_device
112
113
  )
113
- df_density_activated_recovery = prepare_outputs.prepare_density_activated_recovery(
114
- well.well_name, lateral.df_well, lateral.df_device
115
- )
116
- df_autonomous_inflow_control_valve = prepare_outputs.prepare_autonomous_inflow_control_valve(
114
+ df_density_driven = prepare_outputs.prepare_density_driven(well.well_name, lateral.df_well, lateral.df_device)
115
+ df_injection_valve = prepare_outputs.prepare_injection_valve(well.well_name, lateral.df_well, lateral.df_device)
116
+ df_dual_rate_controlled_production = prepare_outputs.prepare_dual_rate_controlled_production(
117
117
  well.well_name, lateral.df_well, lateral.df_device
118
118
  )
119
119
  df_inflow_control_valve = prepare_outputs.prepare_inflow_control_valve(
@@ -147,11 +147,10 @@ def format_output(well: Well, case: ReadCasefile, figure_name: str | None = None
147
147
  print_inflow_control_valve += _format_inflow_control_valve(
148
148
  well.well_name, lateral.lateral_number, df_inflow_control_valve, first
149
149
  )
150
- print_density_activated_recovery += _format_density_activated_recovery(
151
- well.well_number, df_density_activated_recovery
152
- )
153
- print_autonomous_inflow_control_valve += _format_autonomous_inflow_control_valve(
154
- well.well_number, df_autonomous_inflow_control_valve
150
+ print_density_driven += _format_density_driven(well.well_number, df_density_driven)
151
+ print_injection_valve += _format_injection_valve(well.well_number, df_injection_valve)
152
+ print_dual_rate_controlled_production += _format_dual_rate_controlled_production(
153
+ well.well_number, df_dual_rate_controlled_production
155
154
  )
156
155
 
157
156
  if figure_name is not None:
@@ -183,10 +182,10 @@ def format_output(well: Well, case: ReadCasefile, figure_name: str | None = None
183
182
  bonus.append(f"{Keywords.AUTONOMOUS_INFLOW_CONTROL_DEVICE}{print_autonomous_inflow_control_device}\n/\n\n\n")
184
183
  if print_inflow_control_valve:
185
184
  bonus.append(f"{Keywords.WELL_SEGMENTS_VALVE}{print_inflow_control_valve}\n/\n\n\n")
186
- if print_density_activated_recovery:
185
+ if print_density_driven:
187
186
  metadata = (
188
187
  f"{'-' * 100}\n"
189
- "-- This is how we model DAR technology using sets of ACTIONX keywords.\n"
188
+ "-- This is how we model DENSITY technology using sets of ACTIONX keywords.\n"
190
189
  "-- The segment dP curves changes according to the segment water-\n"
191
190
  "-- and gas volume fractions at downhole condition.\n"
192
191
  "-- The value of Cv is adjusted according to the segment length and the number of\n"
@@ -194,16 +193,26 @@ def format_output(well: Well, case: ReadCasefile, figure_name: str | None = None
194
193
  "-- volume fractions.\n"
195
194
  f"{'-' * 100}\n\n\n"
196
195
  )
197
- bonus.append(metadata + print_density_activated_recovery + "\n\n\n\n")
198
- if print_autonomous_inflow_control_valve:
196
+ bonus.append(metadata + print_density_driven + "\n\n\n\n")
197
+ if print_injection_valve:
199
198
  metadata = (
200
199
  f"{'-' * 100}\n"
201
- "-- This is how we model AICV technology using sets of ACTIONX keyword\n"
200
+ "-- This is how we model INJV technology using sets of ACTIONX keywords.\n"
201
+ "-- The DP paramaters changes according to the trigger parameter.-\n"
202
+ "-- The value of Cv is adjusted according to the segment length and the number of\n"
203
+ "-- devices per joint. The constriction area will change if the parameter is triggered.\n"
204
+ f"{'-' * 100}\n\n\n"
205
+ )
206
+ bonus.append(metadata + print_injection_valve + "\n\n\n\n")
207
+ if print_dual_rate_controlled_production:
208
+ metadata = (
209
+ f"{'-' * 100}\n"
210
+ "-- This is how we model DUALRCP technology using sets of ACTIONX keyword\n"
202
211
  "-- the DP parameters change according to the segment water cut (at downhole condition )\n"
203
212
  "-- and gas volume fraction (at downhole condition)\n"
204
213
  f"{'-' * 100}\n\n\n"
205
214
  )
206
- bonus.append(metadata + print_autonomous_inflow_control_valve + "\n\n\n\n")
215
+ bonus.append(metadata + print_dual_rate_controlled_production + "\n\n\n\n")
207
216
 
208
217
  return print_completion_data, print_well_segments, print_completion_segments, "".join(bonus)
209
218
 
@@ -439,34 +448,49 @@ def _format_inflow_control_valve(well_name: str, lateral_number: int, df_wsegicv
439
448
  )
440
449
 
441
450
 
442
- def _format_density_activated_recovery(well_number: int, df_wsegdar: pd.DataFrame) -> str:
443
- """Formats well-segments for density activated recovery valve.
451
+ def _format_density_driven(well_number: int, df_wsegdensity: pd.DataFrame) -> str:
452
+ """Formats well-segments for density driven valve.
453
+
454
+ Args:
455
+ well_number: The well's number
456
+ df_wsegdensity: Data to print.
457
+
458
+ Returns:
459
+ Formatted string.
460
+ """
461
+ if df_wsegdensity.empty:
462
+ return ""
463
+ return prepare_outputs.print_wsegdensity(df_wsegdensity, well_number + 1)
464
+
465
+
466
+ def _format_injection_valve(well_number: int, df_wseginjv: pd.DataFrame) -> str:
467
+ """Formats well-segments for injection valve.
444
468
 
445
469
  Args:
446
470
  well_number: The well's number
447
- df_wsegdar: Data to print.
471
+ df_wsegdinjv: Data to print.
448
472
 
449
473
  Returns:
450
474
  Formatted string.
451
475
  """
452
- if df_wsegdar.empty:
476
+ if df_wseginjv.empty:
453
477
  return ""
454
- return prepare_outputs.print_wsegdar(df_wsegdar, well_number + 1)
478
+ return prepare_outputs.print_wseginjv(df_wseginjv, well_number + 1)
455
479
 
456
480
 
457
- def _format_autonomous_inflow_control_valve(well_number: int, df_wsegaicv: pd.DataFrame) -> str:
458
- """Formats the AICV section.
481
+ def _format_dual_rate_controlled_production(well_number: int, df_wsegdualrcp: pd.DataFrame) -> str:
482
+ """Formats the DUALRCP section.
459
483
 
460
484
  Args:
461
485
  well_number: The well's number
462
- df_wsegaicv: Data to print.
486
+ df_wsegdualrcp: Data to print.
463
487
 
464
488
  Returns:
465
489
  Formatted string.
466
490
  """
467
- if df_wsegaicv.empty:
491
+ if df_wsegdualrcp.empty:
468
492
  return ""
469
- return prepare_outputs.print_wsegaicv(df_wsegaicv, well_number + 1)
493
+ return prepare_outputs.print_wsegdualrcp(df_wsegdualrcp, well_number + 1)
470
494
 
471
495
 
472
496
  def _branch_revision(
@@ -173,7 +173,7 @@ def _check_for_errors(df_comp: pd.DataFrame, well_name: str, idx: int) -> None:
173
173
  if df_comp[Headers.DEVICE_TYPE].iloc[idx] not in Content.DEVICE_TYPES:
174
174
  raise CompletorError(
175
175
  f"{df_comp[Headers.DEVICE_TYPE].iloc[idx]} is not a valid device type. "
176
- "Valid types are PERF, AICD, ICD, VALVE, DAR, AICV, and ICV."
176
+ "Valid types are PERF, AICD, ICD, VALVE, DENSITY, INJV, DUALRCP, and ICV."
177
177
  )
178
178
  if df_comp[Headers.ANNULUS].iloc[idx] not in Content.ANNULUS_TYPES:
179
179
  raise CompletorError(
@@ -181,6 +181,36 @@ def _check_for_errors(df_comp: pd.DataFrame, well_name: str, idx: int) -> None:
181
181
  )
182
182
 
183
183
 
184
+ def set_density_based(df_comp: pd.DataFrame) -> pd.DataFrame:
185
+ """Set the column data format.
186
+ Args:
187
+ df_comp: Completion data.
188
+ Returns:
189
+ Updated device type to all density based.
190
+ """
191
+ df_comp[Headers.DEVICE_TYPE] = np.where(
192
+ df_comp[Headers.DEVICE_TYPE] == Content.DENSITY_ACTIVATED_RECOVERY,
193
+ Content.DENSITY,
194
+ df_comp[Headers.DEVICE_TYPE],
195
+ )
196
+ return df_comp
197
+
198
+
199
+ def set_dualrcp(df_comp: pd.DataFrame) -> pd.DataFrame:
200
+ """Set the column data format.
201
+ Args:
202
+ df_comp: Completion data.
203
+ Returns:
204
+ Updated device type to all dual RCP based.
205
+ """
206
+ df_comp[Headers.DEVICE_TYPE] = np.where(
207
+ df_comp[Headers.DEVICE_TYPE] == Content.AUTONOMOUS_INFLOW_CONTROL_VALVE,
208
+ Content.DUAL_RATE_CONTROLLED_PRODUCTION,
209
+ df_comp[Headers.DEVICE_TYPE],
210
+ )
211
+ return df_comp
212
+
213
+
184
214
  def set_format_wsegvalv(df_temp: pd.DataFrame) -> pd.DataFrame:
185
215
  """Format the Well Segments Valve (WELSEGS) table.
186
216
 
@@ -242,11 +272,11 @@ def set_format_wsegaicd(df_temp: pd.DataFrame) -> pd.DataFrame:
242
272
  return df_temp
243
273
 
244
274
 
245
- def set_format_wsegdar(df_temp: pd.DataFrame) -> pd.DataFrame:
246
- """Format the well segments Density Activated Recovery (DAR) data.
275
+ def set_format_wsegdensity(df_temp: pd.DataFrame) -> pd.DataFrame:
276
+ """Format the well segments Density Driven (DENSITY) data.
247
277
 
248
278
  Args:
249
- df_temp: Well segments DAR device data.
279
+ df_temp: Well segments DENSITY device data.
250
280
 
251
281
  Returns:
252
282
  Updated data.
@@ -256,15 +286,34 @@ def set_format_wsegdar(df_temp: pd.DataFrame) -> pd.DataFrame:
256
286
  columns = df_temp.columns.to_numpy()[1:]
257
287
  df_temp[columns] = df_temp[columns].astype(np.float64)
258
288
  # Create ID device column
259
- df_temp.insert(0, Headers.DEVICE_TYPE, np.full(df_temp.shape[0], Content.DENSITY_ACTIVATED_RECOVERY))
289
+ df_temp.insert(0, Headers.DEVICE_TYPE, np.full(df_temp.shape[0], Content.DENSITY))
290
+ return df_temp
291
+
292
+
293
+ def set_format_wseginjv(df_temp: pd.DataFrame) -> pd.DataFrame:
294
+ """Format the well segments Injection Valve (INJV) data.
295
+
296
+ Args:
297
+ df_temp: Well segments INJV device data.
298
+
299
+ Returns:
300
+ Updated data.
301
+ """
302
+ df_temp[Headers.DEVICE_NUMBER] = df_temp[Headers.DEVICE_NUMBER].astype(np.int64)
303
+ # left out devicenumber and trigger parameter because devicenumber has been formatted as integer
304
+ # trigger parameter is a string
305
+ columns = df_temp.columns.to_numpy()[2:]
306
+ df_temp[columns] = df_temp[columns].astype(np.float64)
307
+ # Create ID device column
308
+ df_temp.insert(0, Headers.DEVICE_TYPE, np.full(df_temp.shape[0], Content.INJECTION_VALVE))
260
309
  return df_temp
261
310
 
262
311
 
263
- def set_format_wsegaicv(df_temp: pd.DataFrame) -> pd.DataFrame:
264
- """Format the well segments Automatic Inflow Control Valve (AICV) table.
312
+ def set_format_wsegdualrcp(df_temp: pd.DataFrame) -> pd.DataFrame:
313
+ """Format the well segments Dual RCP (DUALRCP) table.
265
314
 
266
315
  Args:
267
- df_temp: Well segments automatic inflow control valve table.
316
+ df_temp: Well segments dual RCP table.
268
317
 
269
318
  Returns:
270
319
  Updated data.
@@ -274,7 +323,7 @@ def set_format_wsegaicv(df_temp: pd.DataFrame) -> pd.DataFrame:
274
323
  columns = df_temp.columns.to_numpy()[1:]
275
324
  df_temp[columns] = df_temp[columns].astype(np.float64)
276
325
  # Create ID device column
277
- df_temp.insert(0, Headers.DEVICE_TYPE, np.full(df_temp.shape[0], Content.AUTONOMOUS_INFLOW_CONTROL_VALVE))
326
+ df_temp.insert(0, Headers.DEVICE_TYPE, np.full(df_temp.shape[0], Content.DUAL_RATE_CONTROLLED_PRODUCTION))
278
327
  return df_temp
279
328
 
280
329