orchid-python-api 5.25.2__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.
- orchid_python_api/examples/search_data_frames.py +1 -1
- {orchid_python_api-5.25.2.dist-info → orchid_python_api-5.25.4.dist-info}/METADATA +4 -3
- orchid_python_api-5.25.4.dist-info/RECORD +38 -0
- {orchid_python_api-5.25.2.dist-info → orchid_python_api-5.25.4.dist-info}/WHEEL +1 -1
- ReleaseNotes.md +0 -708
- copy_orchid_examples.py +0 -88
- copy_orchid_low_level_examples.py +0 -93
- copy_orchid_manual_examples.py +0 -93
- copy_orchid_tutorials.py +0 -88
- orchid/VERSION +0 -1
- orchid/__init__.py +0 -42
- orchid/__version__.py +0 -18
- orchid/base.py +0 -31
- orchid/base_time_series_adapter.py +0 -91
- orchid/configuration.py +0 -162
- orchid/convert.py +0 -44
- orchid/core.py +0 -149
- orchid/dom_project_object.py +0 -28
- orchid/dot_net.py +0 -68
- orchid/dot_net_disposable.py +0 -64
- orchid/dot_net_dom_access.py +0 -241
- orchid/measurement.py +0 -35
- orchid/native_data_frame_adapter.py +0 -247
- orchid/native_fiber_data.py +0 -73
- orchid/native_fiber_data_set_info.py +0 -28
- orchid/native_monitor_adapter.py +0 -67
- orchid/native_project_user_data_adapter.py +0 -137
- orchid/native_stage_adapter.py +0 -631
- orchid/native_stage_part_adapter.py +0 -50
- orchid/native_subsurface_point.py +0 -70
- orchid/native_time_series_adapter.py +0 -54
- orchid/native_trajectory_adapter.py +0 -246
- orchid/native_treatment_calculations.py +0 -158
- orchid/native_treatment_curve_adapter.py +0 -60
- orchid/native_well_adapter.py +0 -134
- orchid/net_date_time.py +0 -328
- orchid/net_enumerable.py +0 -72
- orchid/net_fracture_diagnostics_factory.py +0 -55
- orchid/net_quantity.py +0 -620
- orchid/net_stage_qc.py +0 -62
- orchid/physical_quantity.py +0 -37
- orchid/project.py +0 -182
- orchid/project_store.py +0 -269
- orchid/reference_origins.py +0 -34
- orchid/script_adapter_context.py +0 -81
- orchid/searchable_data_frames.py +0 -44
- orchid/searchable_project_objects.py +0 -190
- orchid/searchable_stage_parts.py +0 -73
- orchid/searchable_stages.py +0 -29
- orchid/unit_system.py +0 -173
- orchid/utils.py +0 -14
- orchid/validation.py +0 -52
- orchid/version.py +0 -37
- orchid_python_api-5.25.2.dist-info/LICENSE +0 -176
- orchid_python_api-5.25.2.dist-info/RECORD +0 -88
- {orchid_python_api-5.25.2.dist-info → orchid_python_api-5.25.4.dist-info}/entry_points.txt +0 -0
- /LICENSE → /orchid_python_api-5.25.4.dist-info/licenses/LICENSE +0 -0
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
# This file is part of Orchid and related technologies.
|
|
3
|
-
#
|
|
4
|
-
# Copyright (c) 2017-2025 KAPPA. All Rights Reserved.
|
|
5
|
-
#
|
|
6
|
-
# LEGAL NOTICE:
|
|
7
|
-
# Orchid contains trade secrets and otherwise confidential information
|
|
8
|
-
# owned by KAPPA. Access to and use of this information is
|
|
9
|
-
# strictly limited and controlled by the Company. This file may not be copied,
|
|
10
|
-
# distributed, or otherwise disclosed outside of the Company's facilities
|
|
11
|
-
# except under appropriate precautions to maintain the confidentiality hereof,
|
|
12
|
-
# and may not be used in any way not expressly authorized by the Company.
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import abc
|
|
17
|
-
from typing import Union
|
|
18
|
-
|
|
19
|
-
import toolz.curried as toolz
|
|
20
|
-
import option
|
|
21
|
-
|
|
22
|
-
from orchid import (
|
|
23
|
-
dot_net_dom_access as dna,
|
|
24
|
-
net_quantity as onq,
|
|
25
|
-
unit_system as units,
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
# noinspection PyUnresolvedReferences,PyPackageRequirements
|
|
29
|
-
from Orchid.FractureDiagnostics import ISubsurfacePoint
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
class SubsurfacePoint(dna.IdentifiedDotNetAdapter):
|
|
33
|
-
"""An abstract base class for subsurface points."""
|
|
34
|
-
|
|
35
|
-
def __init__(self, adaptee: ISubsurfacePoint, target_length_unit: Union[units.UsOilfield, units.Metric]):
|
|
36
|
-
"""
|
|
37
|
-
Construct an instance adapting `adaptee` so that all lengths are expressed in `target_length_unit`.
|
|
38
|
-
|
|
39
|
-
Args:
|
|
40
|
-
adaptee: The .NET `ISubsurfacePoint` being adapted.
|
|
41
|
-
target_length_unit: The target unit for all lengths.
|
|
42
|
-
"""
|
|
43
|
-
super().__init__(adaptee)
|
|
44
|
-
self._as_length_measurement_func = onq.as_measurement(target_length_unit)
|
|
45
|
-
|
|
46
|
-
depth_origin = dna.dom_property('depth_datum',
|
|
47
|
-
'The datum or origin for the z-coordinate of this point.')
|
|
48
|
-
xy_origin = dna.dom_property('well_reference_frame_xy',
|
|
49
|
-
'The reference frame or origin for the x-y coordinates of this point.')
|
|
50
|
-
|
|
51
|
-
@property
|
|
52
|
-
def x(self):
|
|
53
|
-
"""The x-coordinate of this point."""
|
|
54
|
-
return self._as_length_measurement_func(option.maybe(self.dom_object.X))
|
|
55
|
-
|
|
56
|
-
@property
|
|
57
|
-
def y(self):
|
|
58
|
-
"""The y-coordinate of this point."""
|
|
59
|
-
return self._as_length_measurement_func(option.maybe(self.dom_object.Y))
|
|
60
|
-
|
|
61
|
-
@property
|
|
62
|
-
def depth(self):
|
|
63
|
-
"""The depth of this point."""
|
|
64
|
-
return self._as_length_measurement_func(option.maybe(self.dom_object.Depth))
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
@toolz.curry
|
|
68
|
-
def make_subsurface_point(target_unit: Union[units.UsOilfield, units.Metric],
|
|
69
|
-
net_subsurface_point: ISubsurfacePoint) -> SubsurfacePoint:
|
|
70
|
-
return SubsurfacePoint(net_subsurface_point, target_unit)
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 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 enum
|
|
19
|
-
|
|
20
|
-
import orchid.base
|
|
21
|
-
from orchid import (
|
|
22
|
-
base_time_series_adapter as bca,
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
# noinspection PyUnresolvedReferences
|
|
26
|
-
from Orchid.FractureDiagnostics.TimeSeries import IQuantityTimeSeries
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
# TODO: Replace with dataclass and constant class variables.
|
|
30
|
-
class TimeSeriesCurveTypes(enum.Enum):
|
|
31
|
-
MONITOR_PRESSURE = 'Pressure'
|
|
32
|
-
MONITOR_TEMPERATURE = 'Temperature'
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class NativeTimeSeriesAdapter(bca.BaseTimeSeriesAdapter):
|
|
36
|
-
def __init__(self, net_time_series: IQuantityTimeSeries):
|
|
37
|
-
super().__init__(net_time_series, orchid.base.constantly(net_time_series.Well.Project))
|
|
38
|
-
|
|
39
|
-
def quantity_name_unit_map(self, project_units):
|
|
40
|
-
"""
|
|
41
|
-
Return a map (dictionary) between quantity names and units (from `unit_system`) of the data_points.
|
|
42
|
-
|
|
43
|
-
This method plays the role of "Primitive Operation" in the *Template Method* design pattern. In this
|
|
44
|
-
role, the "Template Method" defines an algorithm and delegates some steps of the algorithm to derived
|
|
45
|
-
classes through invocation of "Primitive Operations".
|
|
46
|
-
|
|
47
|
-
Args:
|
|
48
|
-
project_units: The unit system of the project.
|
|
49
|
-
"""
|
|
50
|
-
result = {
|
|
51
|
-
TimeSeriesCurveTypes.MONITOR_PRESSURE.value: project_units.PRESSURE,
|
|
52
|
-
TimeSeriesCurveTypes.MONITOR_TEMPERATURE.value: project_units.TEMPERATURE,
|
|
53
|
-
}
|
|
54
|
-
return result
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 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 deal
|
|
19
|
-
|
|
20
|
-
import numpy as np
|
|
21
|
-
import option
|
|
22
|
-
import toolz.curried as toolz
|
|
23
|
-
|
|
24
|
-
import orchid.base
|
|
25
|
-
from orchid import (
|
|
26
|
-
dot_net_dom_access as dna,
|
|
27
|
-
net_quantity as onq,
|
|
28
|
-
reference_origins as origins,
|
|
29
|
-
unit_system as units,
|
|
30
|
-
validation,
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
# noinspection PyUnresolvedReferences
|
|
34
|
-
from Orchid.FractureDiagnostics import IWellTrajectory
|
|
35
|
-
|
|
36
|
-
# noinspection PyUnresolvedReferences
|
|
37
|
-
import UnitsNet
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def _trajectory_array_in_unit(tgt_unit, raw_array):
|
|
41
|
-
result = toolz.pipe(raw_array,
|
|
42
|
-
toolz.map(option.maybe),
|
|
43
|
-
toolz.map(onq.as_measurement(tgt_unit)),
|
|
44
|
-
toolz.map(lambda m: m.magnitude),
|
|
45
|
-
lambda magnitudes: np.fromiter(magnitudes, dtype='float'))
|
|
46
|
-
return result
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
class NativeTrajectoryAdapterIdentified(dna.IdentifiedDotNetAdapter):
|
|
50
|
-
def __init__(self, net_trajectory: IWellTrajectory):
|
|
51
|
-
"""
|
|
52
|
-
Construct an instance adapting a .NET `IWellTrajectory`.
|
|
53
|
-
|
|
54
|
-
One need not construct an instance directly; instead, one constructs an instance by accessing the
|
|
55
|
-
Orchid domain object model (DOM) of a project. For example,
|
|
56
|
-
|
|
57
|
-
>>> project_path = orchid.training_data_path().joinpath('frankNstein_Bakken_UTM13_FEET.ifrac')
|
|
58
|
-
>>> project = orchid.load_project(str(project_path))
|
|
59
|
-
>>> well = list(project.wells().find_by_name('Demo_1H'))[0]
|
|
60
|
-
>>> # noinspection PyUnresolvedReferences
|
|
61
|
-
>>> trajectory = well.trajectory
|
|
62
|
-
|
|
63
|
-
Args:
|
|
64
|
-
net_trajectory: The .NET trajectory to be adapted.
|
|
65
|
-
"""
|
|
66
|
-
super().__init__(net_trajectory, orchid.base.constantly(net_trajectory.Well.Project))
|
|
67
|
-
|
|
68
|
-
# TODO: Consider alternative interface, get_eastings()
|
|
69
|
-
# See [pint Numpy support](https://pint.readthedocs.io/en/stable/numpy.html) or the
|
|
70
|
-
# [pint pandas extension](https://github.com/hgrecco/pint-pandas)
|
|
71
|
-
@deal.pre(validation.arg_not_none)
|
|
72
|
-
def get_easting_array(self, reference_frame: origins.WellReferenceFrameXy) -> np.array:
|
|
73
|
-
"""
|
|
74
|
-
Calculate the magnitudes of eastings of this trajectory relative to the specified `reference_frame`
|
|
75
|
-
in project length units.
|
|
76
|
-
|
|
77
|
-
Once one has a trajectory (from a well of a project), one can access the (Numpy) array of easting
|
|
78
|
-
values relative to a reference. For example,
|
|
79
|
-
|
|
80
|
-
>>> project_path = orchid.training_data_path().joinpath('frankNstein_Bakken_UTM13_FEET.ifrac')
|
|
81
|
-
>>> project = orchid.load_project(str(project_path))
|
|
82
|
-
>>> well = list(project.wells().find_by_name('Demo_3H'))[0]
|
|
83
|
-
>>> # noinspection PyUnresolvedReferences
|
|
84
|
-
>>> trajectory = well.trajectory
|
|
85
|
-
>>> eastings = trajectory.get_easting_array(origins.WellReferenceFrameXy.PROJECT)
|
|
86
|
-
>>> eastings[213]
|
|
87
|
-
-21007.733000000007
|
|
88
|
-
|
|
89
|
-
Args
|
|
90
|
-
reference_frame: The reference frame for the easting coordinates.
|
|
91
|
-
|
|
92
|
-
Returns:
|
|
93
|
-
The array of eastings of this trajectory.
|
|
94
|
-
"""
|
|
95
|
-
return self._trajectory_length_array(self.dom_object.GetEastingArray(reference_frame.value))
|
|
96
|
-
|
|
97
|
-
# TODO: Consider alternative interface, get_northings()
|
|
98
|
-
# See [pint Numpy support](https://pint.readthedocs.io/en/stable/numpy.html) or the
|
|
99
|
-
# [pint pandas extension](https://github.com/hgrecco/pint-pandas)
|
|
100
|
-
@deal.pre(validation.arg_not_none)
|
|
101
|
-
def get_northing_array(self, reference_frame: origins.WellReferenceFrameXy) -> np.array:
|
|
102
|
-
"""
|
|
103
|
-
Calculate the magnitudes of northings of this trajectory relative to the specified `reference_frame`
|
|
104
|
-
in project length units.
|
|
105
|
-
|
|
106
|
-
Once one has a trajectory (from a well of a project), one can access the (Numpy) array of northing
|
|
107
|
-
values relative to a reference. For example,
|
|
108
|
-
|
|
109
|
-
>>> project_path = orchid.training_data_path().joinpath('frankNstein_Bakken_UTM13_FEET.ifrac')
|
|
110
|
-
>>> project = orchid.load_project(str(project_path))
|
|
111
|
-
>>> well = list(project.wells().find_by_name('Demo_2H'))[0]
|
|
112
|
-
>>> # noinspection PyUnresolvedReferences
|
|
113
|
-
>>> trajectory = well.trajectory
|
|
114
|
-
>>> northings = trajectory.get_northing_array(origins.WellReferenceFrameXy.PROJECT)
|
|
115
|
-
>>> northings[203]
|
|
116
|
-
36105.4299999997
|
|
117
|
-
|
|
118
|
-
Args:
|
|
119
|
-
reference_frame: The reference frame for the northing coordinates.
|
|
120
|
-
|
|
121
|
-
Returns:
|
|
122
|
-
The array of northings of this trajectory.
|
|
123
|
-
|
|
124
|
-
"""
|
|
125
|
-
return self._trajectory_length_array(self.dom_object.GetNorthingArray(reference_frame.value))
|
|
126
|
-
|
|
127
|
-
# TODO: Consider alternative interface, get_tvd_sss()
|
|
128
|
-
# See [pint Numpy support](https://pint.readthedocs.io/en/stable/numpy.html) or the
|
|
129
|
-
# [pint pandas extension](https://github.com/hgrecco/pint-pandas)
|
|
130
|
-
def get_tvd_ss_array(self) -> np.array:
|
|
131
|
-
"""
|
|
132
|
-
Calculate the array of total vertical sub-sea depth values in project length units.
|
|
133
|
-
|
|
134
|
-
Once one has a trajectory (from a well of a project), one can access the (Numpy) array of TVDSS
|
|
135
|
-
values. For example,
|
|
136
|
-
|
|
137
|
-
>>> project_path = orchid.training_data_path().joinpath('frankNstein_Bakken_UTM13_FEET.ifrac')
|
|
138
|
-
>>> project = orchid.load_project(str(project_path))
|
|
139
|
-
>>> well = list(project.wells().find_by_name('Demo_4H'))[0]
|
|
140
|
-
>>> # noinspection PyUnresolvedReferences
|
|
141
|
-
>>> trajectory = well.trajectory
|
|
142
|
-
>>> tvd_sss = trajectory.get_tvd_ss_array()
|
|
143
|
-
>>> tvd_sss[144]
|
|
144
|
-
10763.48512
|
|
145
|
-
|
|
146
|
-
Returns:
|
|
147
|
-
The array of total vertical depths of this trajectory.
|
|
148
|
-
"""
|
|
149
|
-
return self._get_tvd_array(origins.DepthDatum.SEA_LEVEL)
|
|
150
|
-
|
|
151
|
-
# TODO: Consider alternative interface, get_inclinations()
|
|
152
|
-
# See [pint Numpy support](https://pint.readthedocs.io/en/stable/numpy.html) or the
|
|
153
|
-
# [pint pandas extension](https://github.com/hgrecco/pint-pandas)
|
|
154
|
-
def get_inclination_array(self) -> np.array:
|
|
155
|
-
"""
|
|
156
|
-
Calculate the array of inclination values.
|
|
157
|
-
|
|
158
|
-
Once one has a trajectory (from a well of a project), one can access the (Numpy) array of inclination
|
|
159
|
-
values. For example,
|
|
160
|
-
|
|
161
|
-
>>> project_path = orchid.training_data_path().joinpath('Project-frankNstein_Montney_UTM13_METERS.ifrac')
|
|
162
|
-
>>> project = orchid.load_project(str(project_path))
|
|
163
|
-
>>> well = list(project.wells().find_by_name('Hori_03'))[0]
|
|
164
|
-
>>> # noinspection PyUnresolvedReferences
|
|
165
|
-
>>> trajectory = well.trajectory
|
|
166
|
-
>>> inclinations = trajectory.get_inclination_array()
|
|
167
|
-
>>> inclinations[10]
|
|
168
|
-
4.2
|
|
169
|
-
|
|
170
|
-
Returns:
|
|
171
|
-
The array of inclinations of this trajectory.
|
|
172
|
-
"""
|
|
173
|
-
return self._trajectory_angle_array(self.dom_object.GetInclinationArray())
|
|
174
|
-
|
|
175
|
-
# TODO: Consider alternative interface, get_azimuths_east_of_north()
|
|
176
|
-
# See [pint Numpy support](https://pint.readthedocs.io/en/stable/numpy.html) or the
|
|
177
|
-
# [pint pandas extension](https://github.com/hgrecco/pint-pandas)
|
|
178
|
-
def get_azimuth_east_of_north_array(self) -> np.array:
|
|
179
|
-
"""
|
|
180
|
-
Calculate the array of azimuth values.
|
|
181
|
-
|
|
182
|
-
Once one has a trajectory (from a well of a project), one can access the (Numpy) array of azimuth east
|
|
183
|
-
of north values. For example,
|
|
184
|
-
|
|
185
|
-
>>> project_path = orchid.training_data_path().joinpath('Project-frankNstein_Montney_UTM13_METERS.ifrac')
|
|
186
|
-
>>> project = orchid.load_project(str(project_path))
|
|
187
|
-
>>> well = list(project.wells().find_by_name('Hori_03'))[0]
|
|
188
|
-
>>> # noinspection PyUnresolvedReferences
|
|
189
|
-
>>> trajectory = well.trajectory
|
|
190
|
-
>>> azimuths_east_of_north = trajectory.get_azimuth_east_of_north_array()
|
|
191
|
-
>>> azimuths_east_of_north[173]
|
|
192
|
-
128.6
|
|
193
|
-
|
|
194
|
-
Returns:
|
|
195
|
-
The array of azimuths of this trajectory.
|
|
196
|
-
"""
|
|
197
|
-
return self._trajectory_angle_array(self.dom_object.GetAzimuthEastOfNorthArray())
|
|
198
|
-
|
|
199
|
-
# TODO: Consider alternative interface, get_md_kbs()
|
|
200
|
-
# See [pint Numpy support](https://pint.readthedocs.io/en/stable/numpy.html) or the
|
|
201
|
-
# [pint pandas extension](https://github.com/hgrecco/pint-pandas)
|
|
202
|
-
def get_md_kb_array(self) -> np.array:
|
|
203
|
-
"""
|
|
204
|
-
Calculate the array of MD KB values.
|
|
205
|
-
|
|
206
|
-
Once one has a trajectory (from a well of a project), one can access the (Numpy) array of MDKB
|
|
207
|
-
values. For example,
|
|
208
|
-
|
|
209
|
-
>>> project_path = orchid.training_data_path().joinpath('Project-frankNstein_Montney_UTM13_METERS.ifrac')
|
|
210
|
-
>>> project = orchid.load_project(str(project_path))
|
|
211
|
-
>>> well = list(project.wells().find_by_name('Hori_01'))[0]
|
|
212
|
-
>>> # noinspection PyUnresolvedReferences
|
|
213
|
-
>>> trajectory = well.trajectory
|
|
214
|
-
>>> md_kbs = trajectory.get_md_kb_array()
|
|
215
|
-
>>> md_kbs[84]
|
|
216
|
-
2246.04
|
|
217
|
-
|
|
218
|
-
Returns:
|
|
219
|
-
The array of MD KB values of this trajectory.
|
|
220
|
-
"""
|
|
221
|
-
return self._trajectory_length_array(self.dom_object.GetMdKbArray())
|
|
222
|
-
|
|
223
|
-
@deal.pre(validation.arg_not_none)
|
|
224
|
-
def _get_tvd_array(self, depth_datum: origins.DepthDatum) -> np.array:
|
|
225
|
-
"""
|
|
226
|
-
Calculate the array of total vertical depth values relative to `depth_datum` in project length units.
|
|
227
|
-
|
|
228
|
-
Args:
|
|
229
|
-
depth_datum: The depth datum for the vertical depth values.
|
|
230
|
-
|
|
231
|
-
Returns:
|
|
232
|
-
The array of total vertical depths of this trajectory.
|
|
233
|
-
"""
|
|
234
|
-
return self._trajectory_length_array(self.dom_object.GetTvdArray(depth_datum.value))
|
|
235
|
-
|
|
236
|
-
@staticmethod
|
|
237
|
-
def _trajectory_angle_array(raw_array):
|
|
238
|
-
return _trajectory_array_in_unit(units.Common.ANGLE, raw_array)
|
|
239
|
-
|
|
240
|
-
def _trajectory_length_array(self, raw_array):
|
|
241
|
-
return _trajectory_array_in_unit(self.expect_project_units.LENGTH, raw_array)
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
if __name__ == '__main__':
|
|
245
|
-
import doctest
|
|
246
|
-
doctest.testmod()
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
# This file is part of Orchid and related technologies.
|
|
3
|
-
#
|
|
4
|
-
# Copyright (c) 2017-2025 KAPPA. All Rights Reserved.
|
|
5
|
-
#
|
|
6
|
-
# LEGAL NOTICE:
|
|
7
|
-
# Orchid contains trade secrets and otherwise confidential information
|
|
8
|
-
# owned by KAPPA. Access to and use of this information is
|
|
9
|
-
# strictly limited and controlled by the Company. This file may not be copied,
|
|
10
|
-
# distributed, or otherwise disclosed outside of the Company's facilities
|
|
11
|
-
# except under appropriate precautions to maintain the confidentiality hereof,
|
|
12
|
-
# and may not be used in any way not expressly authorized by the Company.
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
from collections import namedtuple
|
|
17
|
-
import datetime as dt
|
|
18
|
-
from typing import Callable, Union
|
|
19
|
-
|
|
20
|
-
import deal
|
|
21
|
-
import option
|
|
22
|
-
import pendulum
|
|
23
|
-
|
|
24
|
-
from orchid import (
|
|
25
|
-
project_store as loader,
|
|
26
|
-
native_stage_adapter as nsa,
|
|
27
|
-
net_date_time as net_dt,
|
|
28
|
-
net_quantity as net_qty,
|
|
29
|
-
unit_system as units,
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
#
|
|
33
|
-
# noinspection PyUnresolvedReferences,PyPackageRequirements
|
|
34
|
-
from Orchid.FractureDiagnostics import IStage
|
|
35
|
-
# noinspection PyUnresolvedReferences,PyPackageRequirements
|
|
36
|
-
from Orchid.FractureDiagnostics.Calculations import (ICalculationResult,
|
|
37
|
-
ITreatmentCalculations)
|
|
38
|
-
# noinspection PyUnresolvedReferences,PyPackageRequirements
|
|
39
|
-
from System import DateTime
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
CalculationResult = namedtuple('CalculationResult', ['measurement', 'warnings'])
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def perform_calculation(native_calculation_func: Callable[[ITreatmentCalculations, IStage, DateTime, DateTime],
|
|
46
|
-
ICalculationResult],
|
|
47
|
-
stage: IStage,
|
|
48
|
-
start: DateTime,
|
|
49
|
-
stop: DateTime,
|
|
50
|
-
target_unit: Union[units.UsOilfield, units.Metric]):
|
|
51
|
-
"""
|
|
52
|
-
Perform the specific native calculation function for stage from start through (and including) stop.
|
|
53
|
-
|
|
54
|
-
Args:
|
|
55
|
-
native_calculation_func: The specific native treatment calculation function.
|
|
56
|
-
stage: The stage on which the calculation is being made.
|
|
57
|
-
start: The (inclusive) start time of the calculation.
|
|
58
|
-
stop: The (inclusive) stop time of the calculation.
|
|
59
|
-
target_unit: The target unit of the measurement to be returned as the result.
|
|
60
|
-
|
|
61
|
-
Returns:
|
|
62
|
-
The calculation result (measurement and warnings) for the calculation.
|
|
63
|
-
"""
|
|
64
|
-
native_treatment_calculations = loader.native_treatment_calculations()
|
|
65
|
-
native_calculation_result = native_calculation_func(native_treatment_calculations, stage, start, stop)
|
|
66
|
-
calculation_measurement = net_qty.as_measurement(target_unit,
|
|
67
|
-
option.maybe(native_calculation_result.Result))
|
|
68
|
-
warnings = native_calculation_result.Warnings
|
|
69
|
-
return CalculationResult(calculation_measurement, warnings)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
@deal.pre(lambda _stage, start, _stop: net_dt.is_utc(start), message='Expected UTC for start time zone.')
|
|
73
|
-
@deal.pre(lambda _stage, _start, stop: net_dt.is_utc(stop), message='Expected UTC for stop time zone.')
|
|
74
|
-
def median_treating_pressure(stage: nsa.NativeStageAdapter,
|
|
75
|
-
start: Union[pendulum.DateTime, dt.datetime],
|
|
76
|
-
stop: Union[pendulum.DateTime, dt.datetime]):
|
|
77
|
-
"""
|
|
78
|
-
Return the median treating pressure for stage from start to (and including) stop.
|
|
79
|
-
|
|
80
|
-
Args:
|
|
81
|
-
stage: The stage on which the calculation is being made.
|
|
82
|
-
start: The (inclusive) start time of the calculation.
|
|
83
|
-
stop: The (inclusive) stop time of the calculation.
|
|
84
|
-
|
|
85
|
-
Returns:
|
|
86
|
-
The median treating pressure result (measurement and warnings).
|
|
87
|
-
"""
|
|
88
|
-
def median_treatment_pressure_calculation(calculations, for_stage, start_time, stop_time):
|
|
89
|
-
calculation_result = calculations.GetMedianTreatmentPressure(for_stage.dom_object,
|
|
90
|
-
net_dt.as_net_date_time(start_time),
|
|
91
|
-
net_dt.as_net_date_time(stop_time))
|
|
92
|
-
return calculation_result
|
|
93
|
-
|
|
94
|
-
result = perform_calculation(median_treatment_pressure_calculation, stage,
|
|
95
|
-
_datetime_to_pendulum(start), _datetime_to_pendulum(stop),
|
|
96
|
-
stage.expect_project_units.PRESSURE)
|
|
97
|
-
return result
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
@deal.pre(lambda _stage, start, _stop: net_dt.is_utc(start), message='Expected UTC for start time zone.')
|
|
101
|
-
@deal.pre(lambda _stage, _start, stop: net_dt.is_utc(stop), message='Expected UTC for stop time zone.')
|
|
102
|
-
def pumped_fluid_volume(stage: IStage,
|
|
103
|
-
start: Union[pendulum.DateTime, dt.datetime],
|
|
104
|
-
stop: Union[pendulum.DateTime, dt.datetime]):
|
|
105
|
-
"""
|
|
106
|
-
Return the pumped (fluid) volume for stage from start to (and including) stop.
|
|
107
|
-
|
|
108
|
-
Args:
|
|
109
|
-
stage: The stage on which the calculation is being made.
|
|
110
|
-
start: The (inclusive) start time of the calculation.
|
|
111
|
-
stop: The (inclusive) stop time of the calculation.
|
|
112
|
-
|
|
113
|
-
Returns:
|
|
114
|
-
The pumped (fluid) volume result (measurement and warnings).
|
|
115
|
-
"""
|
|
116
|
-
|
|
117
|
-
def pumped_fluid_volume_calculation(calculations, for_stage, start_time, stop_time):
|
|
118
|
-
calculation_result = calculations.GetPumpedVolume(for_stage.dom_object,
|
|
119
|
-
net_dt.as_net_date_time(start_time),
|
|
120
|
-
net_dt.as_net_date_time(stop_time))
|
|
121
|
-
return calculation_result
|
|
122
|
-
|
|
123
|
-
result = perform_calculation(pumped_fluid_volume_calculation, stage,
|
|
124
|
-
_datetime_to_pendulum(start), _datetime_to_pendulum(stop),
|
|
125
|
-
stage.expect_project_units.VOLUME)
|
|
126
|
-
return result
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
@deal.pre(lambda _stage, start, _stop: net_dt.is_utc(start), message='Expected UTC for start time zone.')
|
|
130
|
-
@deal.pre(lambda _stage, _start, stop: net_dt.is_utc(stop), message='Expected UTC for stop time zone.')
|
|
131
|
-
def total_proppant_mass(stage: IStage,
|
|
132
|
-
start: Union[pendulum.DateTime, dt.datetime],
|
|
133
|
-
stop: Union[pendulum.DateTime, dt.datetime]):
|
|
134
|
-
"""
|
|
135
|
-
Return the pumped (fluid) volume for stage from start to (and including) stop.
|
|
136
|
-
|
|
137
|
-
Args:
|
|
138
|
-
stage: The stage on which the calculation is being made.
|
|
139
|
-
start: The (inclusive) start time of the calculation.
|
|
140
|
-
stop: The (inclusive) stop time of the calculation.
|
|
141
|
-
|
|
142
|
-
Returns:
|
|
143
|
-
The pumped (fluid) volume result (measurement and warnings).
|
|
144
|
-
"""
|
|
145
|
-
def total_proppant_mass_calculation(calculations, for_stage, start_time, stop_time):
|
|
146
|
-
calculation_result = calculations.GetTotalProppantMass(for_stage.dom_object,
|
|
147
|
-
net_dt.as_net_date_time(start_time),
|
|
148
|
-
net_dt.as_net_date_time(stop_time))
|
|
149
|
-
return calculation_result
|
|
150
|
-
|
|
151
|
-
result = perform_calculation(total_proppant_mass_calculation, stage,
|
|
152
|
-
_datetime_to_pendulum(start), _datetime_to_pendulum(stop),
|
|
153
|
-
stage.expect_project_units.MASS)
|
|
154
|
-
return result
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
def _datetime_to_pendulum(source: dt.datetime) -> pendulum.DateTime:
|
|
158
|
-
return pendulum.instance(source).set(tz=pendulum.UTC)
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 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 enum
|
|
19
|
-
|
|
20
|
-
import orchid.base
|
|
21
|
-
from orchid import (
|
|
22
|
-
base_time_series_adapter as bca,
|
|
23
|
-
dot_net_dom_access as dna,
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
# noinspection PyUnresolvedReferences
|
|
27
|
-
from Orchid.FractureDiagnostics.TimeSeries import IQuantityTimeSeries
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class TreatmentCurveTypes(enum.Enum):
|
|
31
|
-
DOWNHOLE_PROPPANT_CONCENTRATION = 'Downhole Proppant Concentration'
|
|
32
|
-
SURFACE_PROPPANT_CONCENTRATION = 'Surface Proppant Concentration'
|
|
33
|
-
SLURRY_RATE = 'Slurry Rate'
|
|
34
|
-
TREATING_PRESSURE = 'Pressure'
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class NativeTreatmentCurveAdapter(bca.BaseTimeSeriesAdapter):
|
|
38
|
-
suffix = dna.dom_property('suffix', 'Return the suffix for this treatment curve.')
|
|
39
|
-
|
|
40
|
-
def __init__(self, net_treatment_curve: IQuantityTimeSeries):
|
|
41
|
-
super().__init__(net_treatment_curve, orchid.base.constantly(net_treatment_curve.Stage.Well.Project))
|
|
42
|
-
|
|
43
|
-
def quantity_name_unit_map(self, project_units):
|
|
44
|
-
"""
|
|
45
|
-
Return a map (dictionary) between quantity names and units (from `unit_system`) of the data_points.
|
|
46
|
-
|
|
47
|
-
This method plays the role of "Primitive Operation" in the *Template Method* design pattern. In this
|
|
48
|
-
role, the "Template Method" defines an algorithm and delegates some steps of the algorithm to derived
|
|
49
|
-
classes through invocation of "Primitive Operations".
|
|
50
|
-
|
|
51
|
-
Args:
|
|
52
|
-
project_units: The unit system of the project.
|
|
53
|
-
"""
|
|
54
|
-
result = {
|
|
55
|
-
TreatmentCurveTypes.TREATING_PRESSURE.value: project_units.PRESSURE,
|
|
56
|
-
TreatmentCurveTypes.DOWNHOLE_PROPPANT_CONCENTRATION.value: project_units.PROPPANT_CONCENTRATION,
|
|
57
|
-
TreatmentCurveTypes.SURFACE_PROPPANT_CONCENTRATION.value: project_units.PROPPANT_CONCENTRATION,
|
|
58
|
-
TreatmentCurveTypes.SLURRY_RATE.value: project_units.SLURRY_RATE,
|
|
59
|
-
}
|
|
60
|
-
return result
|