Skip to content

Commit c132a84

Browse files
Merge branch 'SC-1720' into 'develop'
SC-1720: Update log points list after replacing See merge request SOLO-band/python-sdk!90
2 parents e4e9cd0 + d8d9072 commit c132a84

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

src/rogii_solo/log.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ def replace_points(self, points: DataList):
4646
prepared_log_points = [
4747
{key: self._papi_client.prepare_papi_var(value) for key, value in point.items()} for point in points
4848
]
49-
5049
units = ELogMeasureUnits.convert_from_measure_units(self.well.project.measure_unit)
50+
5151
self._papi_client.replace_log(log_id=self.uuid, index_unit=units, log_points=prepared_log_points)
52+
self._points = None
5253

5354
def update_meta(self, name: Optional[str] = None):
5455
func_data = {

src/rogii_solo/well.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ def replace_trajectory(self, md_uom: str, incl_uom: str, azi_uom: str, trajector
125125
azi_uom=azi_uom,
126126
trajectory_stations=prepared_trajectory_stations,
127127
)
128-
129128
self._trajectory = None
130129

131130
@property

tests/test_solo_client_papi.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from rogii_solo.calculations.trajectory import calculate_trajectory
88
from tests.papi_data import (
99
EI_LAST_SEGMENT_EXTENDED_NAME,
10+
LOG_NAME,
1011
NESTED_WELL_NAME,
1112
STARRED_NESTED_WELL_NAME,
1213
STARRED_TOPSET_NAME,
@@ -439,3 +440,20 @@ def test_get_calc_trace(project_papi):
439440
trace_points_data = trace_points.to_dict(time_from=start_datetime)
440441
assert trace_points_data
441442
assert len(trace_points_data) == 3
443+
444+
445+
def test_replace_log_points(project_papi):
446+
well = project_papi.wells.find_by_name(WELL_NAME)
447+
assert well is not None
448+
449+
log = well.logs.find_by_name(LOG_NAME)
450+
assert log is not None
451+
452+
log_data = log.points.to_dict()
453+
assert log_data
454+
455+
new_log_data = [{'index': 1, 'value': 100}, {'index': 2, 'value': 200}]
456+
457+
log.replace_points(new_log_data)
458+
log_data = [{'index': point['md'], 'value': point['value']} for point in log.points.to_dict()]
459+
assert log_data == new_log_data

0 commit comments

Comments
 (0)