corva-worker-python 1.2.3__tar.gz → 2.0.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 (82) hide show
  1. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/PKG-INFO +18 -9
  2. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/corva_worker_python.egg-info/PKG-INFO +18 -9
  3. corva_worker_python-2.0.0/corva_worker_python.egg-info/requires.txt +5 -0
  4. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/setup.py +11 -7
  5. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/testcase/app/__init__.py +1 -0
  6. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/testcase/state_testing_app/__init__.py +1 -0
  7. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/partial_rerun_merge/merge.py +24 -5
  8. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/partial_rerun_merge/models.py +1 -0
  9. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/partial_rerun_merge/progress.py +1 -0
  10. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/test/lambda_function_test_run.py +16 -1
  11. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/test/local_testing/to_local_transfer.py +1 -1
  12. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/wellbore/wellbore.py +1 -1
  13. corva-worker-python-1.2.3/corva_worker_python.egg-info/requires.txt +0 -4
  14. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/README.md +0 -0
  15. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/corva_worker_python.egg-info/SOURCES.txt +0 -0
  16. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/corva_worker_python.egg-info/dependency_links.txt +0 -0
  17. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/corva_worker_python.egg-info/top_level.txt +0 -0
  18. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/pyproject.toml +0 -0
  19. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/setup.cfg +0 -0
  20. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/testcase/app/app_constants.py +0 -0
  21. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/testcase/app/app_lambda.py +0 -0
  22. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/testcase/app/app_partial_rerun_merger.py +0 -0
  23. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/testcase/app/disable_module.py +0 -0
  24. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/testcase/app/drilling_efficiency_app.py +0 -0
  25. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/testcase/app/surface_mse_module.py +0 -0
  26. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/testcase/state_testing_app/app_constants.py +0 -0
  27. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/testcase/state_testing_app/app_lambda.py +0 -0
  28. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/testcase/state_testing_app/state_modules.py +0 -0
  29. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/testcase/state_testing_app/state_testing_app.py +0 -0
  30. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/__init__.py +0 -0
  31. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/app/__init__.py +0 -0
  32. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/app/modules/__init__.py +0 -0
  33. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/app/modules/activity_module.py +0 -0
  34. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/app/modules/connection_module.py +0 -0
  35. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/app/modules/depth_activity_module.py +0 -0
  36. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/app/modules/scheduler.py +0 -0
  37. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/app/modules/time_activity_module.py +0 -0
  38. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/app/modules/trigger.py +0 -0
  39. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/constants.py +0 -0
  40. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/data/__init__.py +0 -0
  41. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/data/activity/__init__.py +0 -0
  42. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/data/activity/activity_grouping.py +0 -0
  43. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/data/alert.py +0 -0
  44. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/data/api.py +0 -0
  45. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/data/enums.py +0 -0
  46. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/data/json_encoder.py +0 -0
  47. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/data/math.py +0 -0
  48. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/data/operations.py +0 -0
  49. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/data/serialization.py +0 -0
  50. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/data/task_handler.py +0 -0
  51. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/data/two_way_dict.py +0 -0
  52. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/data/unit_conversions.py +0 -0
  53. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/data/wits.py +0 -0
  54. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/event/__init__.py +0 -0
  55. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/event/event_handler.py +0 -0
  56. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/event/scheduled.py +0 -0
  57. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/event/stream.py +0 -0
  58. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/exceptions.py +0 -0
  59. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/mixins/__init__.py +0 -0
  60. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/mixins/logging.py +0 -0
  61. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/mixins/rollbar.py +0 -0
  62. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/partial_rerun_merge/__init__.py +0 -0
  63. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/state/__init__.py +0 -0
  64. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/state/mixins.py +0 -0
  65. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/state/state.py +0 -0
  66. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/test/__init__.py +0 -0
  67. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/test/local_testing/__init__.py +0 -0
  68. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/test/utils.py +0 -0
  69. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/wellbore/__init__.py +0 -0
  70. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/wellbore/factory.py +0 -0
  71. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/wellbore/measured_depth_finder.py +0 -0
  72. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/wellbore/model/__init__.py +0 -0
  73. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/wellbore/model/ann.py +0 -0
  74. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/wellbore/model/annulus.py +0 -0
  75. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/wellbore/model/drillstring.py +0 -0
  76. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/wellbore/model/drillstring_components.py +0 -0
  77. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/wellbore/model/element.py +0 -0
  78. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/wellbore/model/enums.py +0 -0
  79. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/wellbore/model/hole.py +0 -0
  80. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/wellbore/model/hole_section.py +0 -0
  81. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/wellbore/model/riser.py +0 -0
  82. {corva-worker-python-1.2.3 → corva_worker_python-2.0.0}/worker/wellbore/sections_mixin.py +0 -0
@@ -1,21 +1,30 @@
1
- Metadata-Version: 1.2
1
+ Metadata-Version: 2.4
2
2
  Name: corva-worker-python
3
- Version: 1.2.3
3
+ Version: 2.0.0
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>
7
7
  License: Unlicensed
8
- Description: UNKNOWN
9
8
  Keywords: corva,worker
10
- Platform: UNKNOWN
11
9
  Classifier: Development Status :: 5 - Production/Stable
12
10
  Classifier: Intended Audience :: Developers
13
11
  Classifier: Operating System :: OS Independent
14
12
  Classifier: Programming Language :: Python
15
13
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.8
17
- Classifier: Programming Language :: Python :: 3.9
18
- Classifier: Programming Language :: Python :: 3.10
19
- Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
20
16
  Classifier: Topic :: Software Development :: Libraries
21
- Requires-Python: >=3.8
17
+ Requires-Python: >=3.13
18
+ Requires-Dist: numpy>=2.3.5
19
+ Requires-Dist: redis>=7.1.0
20
+ Requires-Dist: requests>=2.32.5
21
+ Requires-Dist: simplejson>=3.20.2
22
+ Requires-Dist: urllib3>=2.5.0
23
+ Dynamic: author
24
+ Dynamic: classifier
25
+ Dynamic: home-page
26
+ Dynamic: keywords
27
+ Dynamic: license
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
@@ -1,21 +1,30 @@
1
- Metadata-Version: 1.2
1
+ Metadata-Version: 2.4
2
2
  Name: corva-worker-python
3
- Version: 1.2.3
3
+ Version: 2.0.0
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>
7
7
  License: Unlicensed
8
- Description: UNKNOWN
9
8
  Keywords: corva,worker
10
- Platform: UNKNOWN
11
9
  Classifier: Development Status :: 5 - Production/Stable
12
10
  Classifier: Intended Audience :: Developers
13
11
  Classifier: Operating System :: OS Independent
14
12
  Classifier: Programming Language :: Python
15
13
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.8
17
- Classifier: Programming Language :: Python :: 3.9
18
- Classifier: Programming Language :: Python :: 3.10
19
- Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
20
16
  Classifier: Topic :: Software Development :: Libraries
21
- Requires-Python: >=3.8
17
+ Requires-Python: >=3.13
18
+ Requires-Dist: numpy>=2.3.5
19
+ Requires-Dist: redis>=7.1.0
20
+ Requires-Dist: requests>=2.32.5
21
+ Requires-Dist: simplejson>=3.20.2
22
+ Requires-Dist: urllib3>=2.5.0
23
+ Dynamic: author
24
+ Dynamic: classifier
25
+ Dynamic: home-page
26
+ Dynamic: keywords
27
+ Dynamic: license
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
@@ -0,0 +1,5 @@
1
+ numpy>=2.3.5
2
+ redis>=7.1.0
3
+ requests>=2.32.5
4
+ simplejson>=3.20.2
5
+ urllib3>=2.5.0
@@ -6,10 +6,8 @@ classifiers = [
6
6
  "Operating System :: OS Independent",
7
7
  "Programming Language :: Python",
8
8
  "Programming Language :: Python :: 3",
9
- "Programming Language :: Python :: 3.8",
10
- "Programming Language :: Python :: 3.9",
11
- "Programming Language :: Python :: 3.10",
12
- "Programming Language :: Python :: 3.11",
9
+ "Programming Language :: Python :: 3.13",
10
+ "Programming Language :: Python :: 3.14",
13
11
  "Topic :: Software Development :: Libraries",
14
12
  ]
15
13
 
@@ -17,13 +15,19 @@ setup(
17
15
  name="corva-worker-python",
18
16
  author="Jordan Ambra <jordan.ambra@corva.ai>, Mohammadreza Kamyab <m.kamyab@corva.ai>",
19
17
  url="https://github.com/corva-ai/corva-worker-python",
20
- version="1.2.3",
18
+ version="2.0.0",
21
19
  classifiers=classifiers,
22
- python_requires=">=3.8",
20
+ python_requires=">=3.13",
23
21
  description="SDK for interacting with Corva",
24
22
  keywords="corva, worker",
25
23
  packages=find_packages(exclude=["testcase"]),
26
- install_requires=["numpy", "redis", "requests", "simplejson"],
24
+ install_requires=[
25
+ "numpy>=2.3.5",
26
+ "redis>=7.1.0",
27
+ "requests>=2.32.5",
28
+ "simplejson>=3.20.2",
29
+ "urllib3>=2.5.0",
30
+ ],
27
31
  include_package_data=True,
28
32
  license="Unlicensed",
29
33
  )
@@ -3,4 +3,5 @@ The purpose of this simple test app is to compute Surface MSE
3
3
  every 30 seconds of wits stream records. Note that this parameter
4
4
  is only generated when the state is Drilling (either Rotary or Slide).
5
5
  """
6
+
6
7
  from testcase.app.app_constants import constants # noqa: F401
@@ -2,4 +2,5 @@
2
2
  The purpose of this App is to test the RedisMixin functionality
3
3
  This app tests saving/loading, deleting of states on Redis:
4
4
  """
5
+
5
6
  from testcase.app.app_constants import constants # noqa: F401
@@ -181,6 +181,7 @@ class PartialRerunMerge:
181
181
  self,
182
182
  collection_name: str,
183
183
  downsample_count: Optional[int] = None,
184
+ downsample_ratio: Optional[float] = None,
184
185
  skip_progress: Optional[bool] = False,
185
186
  ) -> bool:
186
187
  """
@@ -191,6 +192,7 @@ class PartialRerunMerge:
191
192
  Args:
192
193
  collection_name (str): the collection name
193
194
  downsample_count (Optional[int]): the downsample count. Defaults to None.
195
+ downsample_ratio (Optional[float]): the downsample ratio. Defaults to None.
194
196
  skip_progress (Optional[bool]): whether to skip the progress. Defaults to False.
195
197
  """
196
198
  dataset_progress = self.merging_progress.get_dataset_progress(collection_name)
@@ -216,6 +218,7 @@ class PartialRerunMerge:
216
218
  break
217
219
 
218
220
  updated_data = self._get_data(collection_name, self.rerun_asset_id, start_time, self.end_timestamp, "once")
221
+ original_records_count = len(updated_data)
219
222
  if not updated_data:
220
223
  dataset_progress.mark_completed_at(self.end_timestamp)
221
224
  is_completed = True
@@ -223,14 +226,14 @@ class PartialRerunMerge:
223
226
 
224
227
  last_timestamp = updated_data[-1]["timestamp"]
225
228
 
226
- if downsample_count:
227
- updated_data = choose_items(updated_data, self.MAX_RECORDS_COUNT)
229
+ if downsample_count is not None or downsample_ratio is not None:
230
+ updated_data = choose_items(updated_data, downsample_count, downsample_ratio)
228
231
 
229
232
  self._move_records(collection_name, updated_data)
230
233
 
231
234
  dataset_progress.processed_timestamp = last_timestamp
232
235
 
233
- if len(updated_data) < self.MAX_API_GET_LIMIT:
236
+ if original_records_count < self.MAX_API_GET_LIMIT:
234
237
  dataset_progress.mark_completed_at(self.end_timestamp)
235
238
  is_completed = True
236
239
  break
@@ -454,7 +457,11 @@ class PartialRerunMerge:
454
457
  time.sleep(seconds)
455
458
 
456
459
 
457
- def choose_items(records: List, max_records_count: Optional[int] = None) -> List:
460
+ def choose_items(
461
+ records: List,
462
+ max_records_count: Optional[int] = None,
463
+ max_records_ratio: Optional[float] = None,
464
+ ) -> List:
458
465
  """
459
466
  Choose a subset of records from a list of records; the first and last
460
467
  records an inclusive.
@@ -463,11 +470,23 @@ def choose_items(records: List, max_records_count: Optional[int] = None) -> List
463
470
  records (List): A list of records.
464
471
  max_records_count (Optional[int]): The maximum number of records
465
472
  to choose. If None, all records are chosen.
473
+ max_records_ratio (Optional[float]): The maximum ratio of records
474
+ to choose. If None, all records are chosen.
466
475
 
467
476
  Returns:
468
477
  List: A list of chosen records.
469
478
  """
470
- if max_records_count is None or max_records_count <= 0 or len(records) <= max_records_count or len(records) < 3:
479
+ if max_records_count is None and max_records_ratio is None:
480
+ return records
481
+
482
+ # only one of max_records_count and max_records_ratio can be provided
483
+ if max_records_count is not None and max_records_ratio is not None:
484
+ raise ValueError("Only one of max_records_count and max_records_ratio can be provided.")
485
+
486
+ if max_records_ratio is not None:
487
+ max_records_count = int(len(records) * max_records_ratio)
488
+
489
+ if max_records_count <= 0 or len(records) <= max_records_count or len(records) < 3:
471
490
  return records
472
491
 
473
492
  step = pymath.ceil((len(records) - 2) / max_records_count)
@@ -2,6 +2,7 @@
2
2
  This file contains the models for the configurations for
3
3
  the collections and cache updates.
4
4
  """
5
+
5
6
  from dataclasses import dataclass, field
6
7
  from typing import List, Optional
7
8
 
@@ -1,6 +1,7 @@
1
1
  """
2
2
  This module defines the progress of the partial reruns.
3
3
  """
4
+
4
5
  from dataclasses import asdict, dataclass
5
6
  from typing import List, Optional
6
7
 
@@ -22,7 +22,6 @@ if __name__ == '__main__':
22
22
  """
23
23
 
24
24
  import argparse
25
- from distutils.util import strtobool
26
25
  from typing import List
27
26
 
28
27
  from dotenv import load_dotenv
@@ -41,6 +40,22 @@ from worker.test.utils import create_scheduler_events, get_last_processed_timest
41
40
  load_dotenv(override=True)
42
41
 
43
42
 
43
+ def strtobool(val):
44
+ """Convert a string representation of truth to true (1) or false (0).
45
+
46
+ True values are 'y', 'yes', 't', 'true', 'on', and '1'.
47
+ False values are 'n', 'no', 'f', 'false', 'off', and '0'.
48
+ Raises ValueError if 'val' is anything else.
49
+ """
50
+ val = val.lower()
51
+ if val in ("y", "yes", "t", "true", "on", "1"):
52
+ return 1
53
+ elif val in ("n", "no", "f", "false", "off", "0"):
54
+ return 0
55
+ else:
56
+ raise ValueError("invalid truth value %r" % (val,))
57
+
58
+
44
59
  def generate_runner_parser():
45
60
  """
46
61
  Creating the supporting arguments
@@ -77,7 +77,7 @@ class ToLocalTransfer(LoggingMixin):
77
77
  # but for the purpose of this test analysis is not important.
78
78
  "data.casing",
79
79
  "data.drillstring",
80
- "data.mud"
80
+ "data.mud",
81
81
  # not required for most of the cases
82
82
  # "data.formations",
83
83
  # "data.pressure-gradient",
@@ -150,7 +150,7 @@ class Wellbore:
150
150
  Logger.debug(f"Updated API with under-reamer activation at depth {self.under_reamer.ur_opened_depth}")
151
151
  else:
152
152
  Logger.info(
153
- f"Under-reamer was opened at {self.under_reamer.ur_opened_depth }. "
153
+ f"Under-reamer was opened at {self.under_reamer.ur_opened_depth}. "
154
154
  f"However, not updating the ur_opened_depth on drillstring on api "
155
155
  f"because it was not triggered from Stream app"
156
156
  )
@@ -1,4 +0,0 @@
1
- numpy
2
- redis
3
- requests
4
- simplejson