orchid-python-api 5.25.3__py3-none-any.whl → 5.25.4__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.
Files changed (57) hide show
  1. orchid_python_api/examples/search_data_frames.py +1 -1
  2. {orchid_python_api-5.25.3.dist-info → orchid_python_api-5.25.4.dist-info}/METADATA +4 -3
  3. orchid_python_api-5.25.4.dist-info/RECORD +38 -0
  4. {orchid_python_api-5.25.3.dist-info → orchid_python_api-5.25.4.dist-info}/WHEEL +1 -1
  5. ReleaseNotes.md +0 -730
  6. copy_orchid_examples.py +0 -88
  7. copy_orchid_low_level_examples.py +0 -93
  8. copy_orchid_manual_examples.py +0 -93
  9. copy_orchid_tutorials.py +0 -88
  10. orchid/VERSION +0 -1
  11. orchid/__init__.py +0 -42
  12. orchid/__version__.py +0 -18
  13. orchid/base.py +0 -31
  14. orchid/base_time_series_adapter.py +0 -91
  15. orchid/configuration.py +0 -162
  16. orchid/convert.py +0 -44
  17. orchid/core.py +0 -149
  18. orchid/dom_project_object.py +0 -28
  19. orchid/dot_net.py +0 -68
  20. orchid/dot_net_disposable.py +0 -64
  21. orchid/dot_net_dom_access.py +0 -241
  22. orchid/measurement.py +0 -35
  23. orchid/native_data_frame_adapter.py +0 -247
  24. orchid/native_fiber_data.py +0 -73
  25. orchid/native_fiber_data_set_info.py +0 -28
  26. orchid/native_monitor_adapter.py +0 -67
  27. orchid/native_project_user_data_adapter.py +0 -137
  28. orchid/native_stage_adapter.py +0 -631
  29. orchid/native_stage_part_adapter.py +0 -50
  30. orchid/native_subsurface_point.py +0 -70
  31. orchid/native_time_series_adapter.py +0 -54
  32. orchid/native_trajectory_adapter.py +0 -246
  33. orchid/native_treatment_calculations.py +0 -158
  34. orchid/native_treatment_curve_adapter.py +0 -60
  35. orchid/native_well_adapter.py +0 -134
  36. orchid/net_date_time.py +0 -328
  37. orchid/net_enumerable.py +0 -72
  38. orchid/net_fracture_diagnostics_factory.py +0 -55
  39. orchid/net_quantity.py +0 -620
  40. orchid/net_stage_qc.py +0 -62
  41. orchid/physical_quantity.py +0 -37
  42. orchid/project.py +0 -182
  43. orchid/project_store.py +0 -269
  44. orchid/reference_origins.py +0 -34
  45. orchid/script_adapter_context.py +0 -81
  46. orchid/searchable_data_frames.py +0 -44
  47. orchid/searchable_project_objects.py +0 -190
  48. orchid/searchable_stage_parts.py +0 -73
  49. orchid/searchable_stages.py +0 -29
  50. orchid/unit_system.py +0 -173
  51. orchid/utils.py +0 -14
  52. orchid/validation.py +0 -52
  53. orchid/version.py +0 -37
  54. orchid_python_api-5.25.3.dist-info/LICENSE +0 -176
  55. orchid_python_api-5.25.3.dist-info/RECORD +0 -88
  56. {orchid_python_api-5.25.3.dist-info → orchid_python_api-5.25.4.dist-info}/entry_points.txt +0 -0
  57. /LICENSE → /orchid_python_api-5.25.4.dist-info/licenses/LICENSE +0 -0
@@ -1,137 +0,0 @@
1
- # Copyright 2017-2025 KAPPA
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- #
15
- # This file is part of Orchid and related technologies.
16
- #
17
-
18
- import json
19
- from typing import Callable, Union
20
- import uuid
21
-
22
- import toolz.curried as toolz
23
-
24
- from orchid import (
25
- dot_net_dom_access as dna,
26
- dot_net_disposable as dnd,
27
- net_stage_qc as nqc,
28
- )
29
-
30
-
31
- # noinspection PyUnresolvedReferences,PyPackageRequirements
32
- from Orchid.FractureDiagnostics.Settings import IProjectUserData, Variant
33
-
34
-
35
- class NativeProjectUserDataAdapter(dna.DotNetAdapter):
36
- """Adapts a .NET `IProjectUserData` instance to Python."""
37
-
38
- # TODO: Add code to `SdkAdapter` to allow handling `GetValue` and .NET `CorrectionStatus`
39
- # Python.NET has a [known issue](https://github.com/pythonnet/pythonnet/issues/1220) with its
40
- # handling of .NET Enum types. The Python.NET team has repaired this issue; however, the repair
41
- # is targeted for Python.NET 3. The team has specifically stated that they will *not* backport
42
- # this fix to the 2.5 version. Because .NET `CorrectionStatus` is a .NET `Enum` type, we
43
- # *cannot* construct a .NET `Variant` of type .NET `CorrectionStatus`.
44
- #
45
- # Our work-around for this issue is to implement this class in terms of the the JSON available
46
- # from the `IProjectUserData.ToJson`. This choice further requires hard-coding the logic used
47
- # by `StartStopTimeEditorViewModel` default `Variant` logic for QC notes and for start stop
48
- # confirmation.
49
-
50
- def __init__(self, adaptee: IProjectUserData):
51
- super().__init__(adaptee)
52
-
53
- def stage_qc_notes(self, stage_id: uuid.UUID) -> str:
54
- """
55
- Calculate the QC notes for the specified stage.
56
-
57
- Args:
58
- stage_id: The object ID of the stage of interest.
59
-
60
- Returns:
61
- The requested QC notes.
62
- """
63
- key_func = nqc.make_qc_notes_key
64
- transform_func = toolz.identity
65
- default_result = ''
66
-
67
- return self._extract_value_for_stage_id(stage_id, key_func, default_result, transform_func)
68
-
69
- def stage_start_stop_confirmation(self, stage_id: uuid.UUID) -> nqc.CorrectionStatus:
70
- """
71
- Calculate the start stop confirmation for the specified stage.
72
-
73
- Args:
74
- stage_id: The object ID of the stage of interest.
75
-
76
- Returns:
77
- The requested start stop confirmation.
78
- """
79
- key_func = nqc.make_start_stop_confirmation_key
80
- transform_func = nqc.CorrectionStatus
81
- default_result = nqc.CorrectionStatus.NEW
82
-
83
- return self._extract_value_for_stage_id(stage_id, key_func, default_result, transform_func)
84
-
85
- def _extract_value_for_stage_id(self,
86
- stage_id: uuid.UUID,
87
- key_func: Callable[[uuid.UUID], str],
88
- default_result: Union[str, nqc.CorrectionStatus],
89
- transform_func: Callable[[str], Union[str, nqc.CorrectionStatus]]):
90
- project_user_data_json = json.loads(self.dom_object.ToJson())
91
- confirmation_key = key_func(stage_id)
92
- # TODO: Replace hard-coded "copy" of logic
93
- # Hard-coded logic for QC notes default value from `StartStopTimeEditorViewModel`:
94
- # return .NET `CorrectionStatus.New` if either of stage ID or of start stop
95
- # confirmation is unavailable.
96
- result = default_result
97
- if confirmation_key in project_user_data_json:
98
- actual_value_type = toolz.get_in([confirmation_key, 'Type'], project_user_data_json)
99
- assert actual_value_type == 'System.String', (f'Expected, "System.String",'
100
- f' but found "{actual_value_type}".')
101
- text_status = toolz.get_in([confirmation_key, 'Value'], project_user_data_json)
102
- result = transform_func(text_status)
103
- return result
104
-
105
- def set_stage_qc_notes(self, stage_id: uuid.UUID, to_notes: str) -> None:
106
- """
107
- Set the stage QC notes `to_notes` for the specified stage.
108
- Args:
109
- stage_id: The object ID that identifies the stage of interest.
110
- to_notes: The value to which to set the stage QC notes.
111
- """
112
- self._set_value(stage_id, nqc.make_qc_notes_key, to_notes, toolz.identity)
113
-
114
- def set_stage_start_stop_confirmation(self, stage_id: uuid.UUID,
115
- to_confirmation: nqc.CorrectionStatus) -> None:
116
- """
117
- Set the stage start stop confirmation `to_confirmation` for the specified stage.
118
-
119
- Args:
120
- stage_id: The object ID that identifies the stage of interest.
121
- to_confirmation: The value to which to set the stage start stop confirmation.
122
- """
123
- self._set_value(stage_id, nqc.make_start_stop_confirmation_key, to_confirmation, lambda v: v.value)
124
-
125
- def _set_value(self, stage_id, key_func, to_value, value_func):
126
- """
127
- Invoke `SetValue` on the mutable DOM object.
128
-
129
- Args:
130
- stage_id: The object ID identifying the stage whose value is to be set.
131
- key_func: A callable that generates the key identifying the value.
132
- to_value: The value to set.
133
- value_func: A function transforming the value to the appropriate .NET value.
134
- """
135
- with dnd.disposable(self.dom_object.ToMutable()) as mutable_pud:
136
- mutable_pud.SetValue(key_func(stage_id),
137
- Variant.Create.Overloads[str](value_func(to_value)))