corva-worker-python 2.3.1__tar.gz → 2.3.3__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 (81) hide show
  1. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/PKG-INFO +2 -2
  2. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/corva_worker_python.egg-info/PKG-INFO +2 -2
  3. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/corva_worker_python.egg-info/requires.txt +1 -1
  4. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/setup.py +2 -2
  5. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/wellbore/factory.py +23 -17
  6. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/wellbore/model/drillstring_components.py +12 -7
  7. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/README.md +0 -0
  8. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/corva_worker_python.egg-info/SOURCES.txt +0 -0
  9. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/corva_worker_python.egg-info/dependency_links.txt +0 -0
  10. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/corva_worker_python.egg-info/top_level.txt +0 -0
  11. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/pyproject.toml +0 -0
  12. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/setup.cfg +0 -0
  13. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/testcase/app/__init__.py +0 -0
  14. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/testcase/app/app_constants.py +0 -0
  15. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/testcase/app/app_lambda.py +0 -0
  16. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/testcase/app/app_partial_rerun_merger.py +0 -0
  17. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/testcase/app/disable_module.py +0 -0
  18. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/testcase/app/drilling_efficiency_app.py +0 -0
  19. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/testcase/app/surface_mse_module.py +0 -0
  20. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/testcase/state_testing_app/__init__.py +0 -0
  21. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/testcase/state_testing_app/app_constants.py +0 -0
  22. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/testcase/state_testing_app/app_lambda.py +0 -0
  23. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/testcase/state_testing_app/state_modules.py +0 -0
  24. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/testcase/state_testing_app/state_testing_app.py +0 -0
  25. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/__init__.py +0 -0
  26. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/app/__init__.py +0 -0
  27. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/app/modules/__init__.py +0 -0
  28. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/app/modules/activity_module.py +0 -0
  29. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/app/modules/connection_module.py +0 -0
  30. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/app/modules/depth_activity_module.py +0 -0
  31. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/app/modules/scheduler.py +0 -0
  32. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/app/modules/time_activity_module.py +0 -0
  33. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/app/modules/trigger.py +0 -0
  34. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/constants.py +0 -0
  35. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/data/__init__.py +0 -0
  36. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/data/activity/__init__.py +0 -0
  37. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/data/activity/activity_grouping.py +0 -0
  38. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/data/alert.py +0 -0
  39. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/data/api.py +0 -0
  40. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/data/enums.py +0 -0
  41. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/data/json_encoder.py +0 -0
  42. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/data/math.py +0 -0
  43. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/data/operations.py +0 -0
  44. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/data/serialization.py +0 -0
  45. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/data/task_handler.py +0 -0
  46. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/data/two_way_dict.py +0 -0
  47. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/data/unit_conversions.py +0 -0
  48. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/data/wits.py +0 -0
  49. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/event/__init__.py +0 -0
  50. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/event/event_handler.py +0 -0
  51. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/event/scheduled.py +0 -0
  52. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/event/stream.py +0 -0
  53. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/exceptions.py +0 -0
  54. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/mixins/__init__.py +0 -0
  55. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/mixins/logging.py +0 -0
  56. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/mixins/rollbar.py +0 -0
  57. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/partial_rerun_merge/__init__.py +0 -0
  58. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/partial_rerun_merge/merge.py +0 -0
  59. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/partial_rerun_merge/models.py +0 -0
  60. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/partial_rerun_merge/progress.py +0 -0
  61. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/state/__init__.py +0 -0
  62. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/state/mixins.py +0 -0
  63. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/state/state.py +0 -0
  64. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/test/__init__.py +0 -0
  65. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/test/lambda_function_test_run.py +0 -0
  66. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/test/local_testing/__init__.py +0 -0
  67. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/test/local_testing/to_local_transfer.py +0 -0
  68. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/test/utils.py +0 -0
  69. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/wellbore/__init__.py +0 -0
  70. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/wellbore/measured_depth_finder.py +0 -0
  71. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/wellbore/model/__init__.py +0 -0
  72. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/wellbore/model/ann.py +0 -0
  73. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/wellbore/model/annulus.py +0 -0
  74. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/wellbore/model/drillstring.py +0 -0
  75. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/wellbore/model/element.py +0 -0
  76. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/wellbore/model/enums.py +0 -0
  77. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/wellbore/model/hole.py +0 -0
  78. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/wellbore/model/hole_section.py +0 -0
  79. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/wellbore/model/riser.py +0 -0
  80. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/wellbore/sections_mixin.py +0 -0
  81. {corva_worker_python-2.3.1 → corva_worker_python-2.3.3}/worker/wellbore/wellbore.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: corva-worker-python
3
- Version: 2.3.1
3
+ Version: 2.3.3
4
4
  Summary: SDK for interacting with Corva
5
5
  Home-page: https://github.com/corva-ai/corva-worker-python
6
6
  Author: Jordan Ambra <jordan.ambra@corva.ai>, Mohammadreza Kamyab <m.kamyab@corva.ai>
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.14
16
16
  Classifier: Topic :: Software Development :: Libraries
17
17
  Requires-Python: >=3.13
18
18
  Requires-Dist: numpy>=2.3.5
19
- Requires-Dist: redis>=5.2.1
19
+ Requires-Dist: redis<8,>=5.2.1
20
20
  Requires-Dist: requests>=2.32.5
21
21
  Requires-Dist: simplejson>=3.20.2
22
22
  Requires-Dist: urllib3>=2.5.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: corva-worker-python
3
- Version: 2.3.1
3
+ Version: 2.3.3
4
4
  Summary: SDK for interacting with Corva
5
5
  Home-page: https://github.com/corva-ai/corva-worker-python
6
6
  Author: Jordan Ambra <jordan.ambra@corva.ai>, Mohammadreza Kamyab <m.kamyab@corva.ai>
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.14
16
16
  Classifier: Topic :: Software Development :: Libraries
17
17
  Requires-Python: >=3.13
18
18
  Requires-Dist: numpy>=2.3.5
19
- Requires-Dist: redis>=5.2.1
19
+ Requires-Dist: redis<8,>=5.2.1
20
20
  Requires-Dist: requests>=2.32.5
21
21
  Requires-Dist: simplejson>=3.20.2
22
22
  Requires-Dist: urllib3>=2.5.0
@@ -1,5 +1,5 @@
1
1
  numpy>=2.3.5
2
- redis>=5.2.1
2
+ redis<8,>=5.2.1
3
3
  requests>=2.32.5
4
4
  simplejson>=3.20.2
5
5
  urllib3>=2.5.0
@@ -15,7 +15,7 @@ setup(
15
15
  name="corva-worker-python",
16
16
  author="Jordan Ambra <jordan.ambra@corva.ai>, Mohammadreza Kamyab <m.kamyab@corva.ai>",
17
17
  url="https://github.com/corva-ai/corva-worker-python",
18
- version="2.3.1",
18
+ version="2.3.3",
19
19
  classifiers=classifiers,
20
20
  python_requires=">=3.13",
21
21
  description="SDK for interacting with Corva",
@@ -23,7 +23,7 @@ setup(
23
23
  packages=find_packages(exclude=["testcase"]),
24
24
  install_requires=[
25
25
  "numpy>=2.3.5",
26
- "redis>=5.2.1",
26
+ "redis>=5.2.1,<8",
27
27
  "requests>=2.32.5",
28
28
  "simplejson>=3.20.2",
29
29
  "urllib3>=2.5.0",
@@ -191,7 +191,6 @@ def get_detailed_hole_from_elements(
191
191
  elements: List[dict],
192
192
  previous_element_top_depth: float,
193
193
  possible_top_depth: float,
194
- extend_casing_to_top: bool,
195
194
  is_riser: bool,
196
195
  ) -> Hole:
197
196
  """
@@ -200,18 +199,12 @@ def get_detailed_hole_from_elements(
200
199
  :param previous_element_top_depth: will be used as the bottom depth of current component
201
200
  :param possible_top_depth: possible top depth to which a casing/riser can extend.
202
201
  In case of a casing, it will extend to the btm of riser (if available)
203
- :param extend_casing_to_top: if the casing/riser should extend to the top
204
202
  :param is_riser: If its a riser or a cased hole
205
203
  :return: Hole with all the components as HoleSections
206
204
  """
207
205
  casing_hole: Hole = Hole()
208
206
 
209
- elements = [
210
- element
211
- for index, element in enumerate(elements)
212
- if check_casing_element_validity(element, index, extend_casing_to_top)
213
- ]
214
-
207
+ # Elements are expected to have been filtered with get_valid_casing_elements before this function is called.
215
208
  for element in reversed(elements):
216
209
  element_id = element.get("inner_diameter", 0.0)
217
210
  element_length = element.get("length", 0.0)
@@ -270,6 +263,14 @@ def check_casing_element_validity(casing_element: dict, idx: int, extend_casing_
270
263
  return True if element_family in ["casing_joints", "riser"] else False
271
264
 
272
265
 
266
+ def get_valid_casing_elements(elements: List[dict], extend_casing_to_top: bool) -> List[dict]:
267
+ return [
268
+ element
269
+ for element_index, element in enumerate(elements)
270
+ if check_casing_element_validity(element, element_index, extend_casing_to_top)
271
+ ]
272
+
273
+
273
274
  def set_casings(casings: List[dict]) -> Hole:
274
275
  """
275
276
  Set the casing by providing the list of the jsons
@@ -319,29 +320,34 @@ def set_casings(casings: List[dict]) -> Hole:
319
320
  casing_top = current_casing_top_depth
320
321
 
321
322
  casing_elements: List[dict] = casing_object.get("components", [])
322
- if not casing_elements:
323
+ extend_casing_to_top = index == 0
324
+ valid_casing_elements = get_valid_casing_elements(casing_elements, extend_casing_to_top)
325
+ if not valid_casing_elements:
323
326
  hole_section = HoleSection(**casing_object, hole_type=HoleType.CASED_HOLE)
324
327
  casing_hole.sections.append(hole_section)
325
328
  else:
326
329
  previous_casing_element_top_depth = casing_bottom
327
330
  # Individual casing elements have to be looped in reverse order to correctly account
328
331
  # for the topmost element going to surface is not liner
329
- extend_casing_to_top: bool = False
330
- if index == 0:
331
- extend_casing_to_top = True
332
332
  casing_hole = get_detailed_hole_from_elements(
333
- casing_elements, previous_casing_element_top_depth, casing_top, extend_casing_to_top, False
333
+ valid_casing_elements, previous_casing_element_top_depth, casing_top, False
334
334
  )
335
335
 
336
336
  casing_holes.append(casing_hole)
337
337
 
338
338
  # Now adding the components of the riser to casingHoles
339
339
  if riser:
340
- riser_elements: List[dict] = riser.get("data", {}).get("components", [])
340
+ riser_object = riser.get("data", {})
341
+ riser_elements: List[dict] = riser_object.get("components", [])
342
+ valid_riser_elements = get_valid_casing_elements(riser_elements, True)
341
343
  previous_riser_element_top_depth = possible_casing_top_depth
342
- riser_hole: Hole = get_detailed_hole_from_elements(
343
- riser_elements, previous_riser_element_top_depth, 0.0, True, True
344
- )
344
+ if valid_riser_elements:
345
+ riser_hole: Hole = get_detailed_hole_from_elements(
346
+ valid_riser_elements, previous_riser_element_top_depth, 0.0, True
347
+ )
348
+ else:
349
+ riser_hole = Hole()
350
+ riser_hole.sections.append(Riser(**riser_object, hole_type=HoleType.CASED_HOLE))
345
351
  casing_holes.insert(0, riser_hole)
346
352
 
347
353
  return Hole.merge_holes(casing_holes)
@@ -5,7 +5,7 @@ from enum import Enum
5
5
  import numpy as np
6
6
 
7
7
  from worker.data.alert import Alerter
8
- from worker.data.operations import equal, is_stream_app, nanround
8
+ from worker.data.operations import equal, is_stream_app, nanround, to_number
9
9
  from worker.data.serialization import serialization
10
10
  from worker.data.unit_conversions import US_LIQUID_GAL_to_INCH3
11
11
  from worker.mixins.logging import Logger
@@ -338,10 +338,10 @@ class UnderReamer(Pipe):
338
338
  self.alerted_at_timestamp: float = 0.0
339
339
  self.ALERT_BACKOFF_TIME = 3600
340
340
 
341
- self.tfa = float(kwargs["tfa"]) if kwargs.get("tfa") is not None else None
342
- self.ur_opened_depth = kwargs.get("ur_opened_depth")
343
- self.ur_opened_od = float(kwargs["ur_opened_od"])
344
- self.flow_rate = float(kwargs.get("flow_rate"))
341
+ self.tfa = to_number(kwargs.get("tfa"))
342
+ self.ur_opened_depth = to_number(kwargs.get("ur_opened_depth"))
343
+ self.ur_opened_od = to_number(kwargs.get("ur_opened_od"))
344
+ self.flow_rate = to_number(kwargs.get("flow_rate"))
345
345
  self.activation_logic = self.ActivationLogic(kwargs["activation_logic"])
346
346
  self.pipe_type = PipeType.UNDERREAMER
347
347
 
@@ -368,11 +368,16 @@ class UnderReamer(Pipe):
368
368
  return self.UnderReamerActivationType.ALREADY_ACTIVATED
369
369
 
370
370
  # if it was never activated and logic is open hole
371
- if self.activation_logic == self.ActivationLogic.OPEN_HOLE_ACTIVATED and not self.ur_opened_depth:
371
+ if self.activation_logic == self.ActivationLogic.OPEN_HOLE_ACTIVATED and self.ur_opened_depth is None:
372
372
  return self.UnderReamerActivationType.OPEN_HOLE
373
373
 
374
374
  # if it was never activated and logic is flow activated
375
- if mud_flow_rate > self.flow_rate and not self.ur_opened_depth:
375
+ if (
376
+ mud_flow_rate is not None
377
+ and self.flow_rate is not None
378
+ and mud_flow_rate > self.flow_rate
379
+ and self.ur_opened_depth is None
380
+ ):
376
381
  return self.UnderReamerActivationType.MUD_FLOW_RATE
377
382
 
378
383
  # Otherwise unactivated