Files
ResInsight/ApplicationLibCode/ProjectDataModelCommands/RimcWellPath.h
T
Kristian Bendiksen 8089739add Python: Add API for importing well log data
Implement comprehensive Python API for importing well log data into ResInsight
well paths using lists of float values.

Core implementation:
- RigImportedWellLogData: Data storage class inheriting from RigWellLogData
- RimImportedWellLog: Scriptable model class for Python GRPC interface
- RimcWellPath_addWellLogInternal: GRPC method using key-value store for data transfer
- well_path.add_well_log(): Python API with validation and error handling

Features:
- Simple API: well_path.add_well_log(name='LogName', values=[1.0, 2.0, 3.0])
- Comprehensive input validation and type checking
- Efficient data transfer via key-value store mechanism
- Proper error handling with cleanup on failure
- Integration with existing well path functionality

Testing:
- 10 comprehensive unit tests covering all functionality
- Validation of input types, error conditions, and edge cases
- Integration testing with well path creation

Usage example included in PythonExamples directory demonstrating
import of gamma ray, porosity, and permeability log data.
2025-09-04 09:04:56 +02:00

165 lines
5.9 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimFishbonesDefines.h"
#include "cafPdmField.h"
#include "cafPdmObjectHandle.h"
#include "cafPdmObjectMethod.h"
#include "cafPdmPtrField.h"
#include <QString>
class RimStimPlanFractureTemplate;
class RimThermalFractureTemplate;
class RimEclipseCase;
//==================================================================================================
///
//==================================================================================================
class RimcWellPath_addFracture : public caf::PdmObjectCreationMethod
{
CAF_PDM_HEADER_INIT;
public:
RimcWellPath_addFracture( caf::PdmObjectHandle* self );
std::expected<caf::PdmObjectHandle*, QString> execute() override;
QString classKeywordReturnedType() const override;
private:
caf::PdmField<double> m_md;
caf::PdmPtrField<RimStimPlanFractureTemplate*> m_stimPlanFractureTemplate;
caf::PdmField<bool> m_alignDip;
caf::PdmPtrField<RimEclipseCase*> m_eclipseCase;
};
//==================================================================================================
///
//==================================================================================================
class RimcWellPath_addThermalFracture : public caf::PdmObjectCreationMethod
{
CAF_PDM_HEADER_INIT;
public:
RimcWellPath_addThermalFracture( caf::PdmObjectHandle* self );
std::expected<caf::PdmObjectHandle*, QString> execute() override;
QString classKeywordReturnedType() const override;
private:
caf::PdmPtrField<RimThermalFractureTemplate*> m_fractureTemplate;
caf::PdmField<double> m_md;
caf::PdmField<bool> m_placeUsingTemplateData;
};
//==================================================================================================
///
//==================================================================================================
class RimcWellPath_appendPerforationInterval : public caf::PdmObjectCreationMethod
{
CAF_PDM_HEADER_INIT;
public:
RimcWellPath_appendPerforationInterval( caf::PdmObjectHandle* self );
std::expected<caf::PdmObjectHandle*, QString> execute() override;
QString classKeywordReturnedType() const override;
private:
caf::PdmField<double> m_startMD;
caf::PdmField<double> m_endMD;
caf::PdmField<double> m_diameter;
caf::PdmField<double> m_skinFactor;
};
//==================================================================================================
///
//==================================================================================================
class RimcWellPath_multiSegmentWellSettings : public caf::PdmObjectMethod
{
CAF_PDM_HEADER_INIT;
public:
RimcWellPath_multiSegmentWellSettings( caf::PdmObjectHandle* self );
std::expected<caf::PdmObjectHandle*, QString> execute() override;
QString classKeywordReturnedType() const override;
};
//==================================================================================================
///
//==================================================================================================
class RimcWellPath_appendFishbones : public caf::PdmObjectMethod
{
CAF_PDM_HEADER_INIT;
public:
RimcWellPath_appendFishbones( caf::PdmObjectHandle* self );
std::expected<caf::PdmObjectHandle*, QString> execute() override;
QString classKeywordReturnedType() const override;
private:
caf::PdmField<std::vector<double>> m_subLocations;
caf::PdmField<caf::AppEnum<RimFishbonesDefines::DrillingType>> m_drillingType;
};
//==================================================================================================
///
//==================================================================================================
class RimcWellPath_extractWellPathPropertiesInternal : public caf::PdmVoidObjectMethod
{
CAF_PDM_HEADER_INIT;
public:
RimcWellPath_extractWellPathPropertiesInternal( caf::PdmObjectHandle* self );
std::expected<caf::PdmObjectHandle*, QString> execute() override;
private:
caf::PdmField<double> m_resamplingInterval;
caf::PdmField<QString> m_coordinateX;
caf::PdmField<QString> m_coordinateY;
caf::PdmField<QString> m_coordinateZ;
caf::PdmField<QString> m_measuredDepth;
caf::PdmField<QString> m_inclination;
caf::PdmField<QString> m_azimuth;
caf::PdmField<QString> m_dogleg;
};
//==================================================================================================
///
//==================================================================================================
class RimcWellPath_addWellLogInternal : public caf::PdmObjectCreationMethod
{
CAF_PDM_HEADER_INIT;
public:
RimcWellPath_addWellLogInternal( caf::PdmObjectHandle* self );
std::expected<caf::PdmObjectHandle*, QString> execute() override;
QString classKeywordReturnedType() const override;
private:
caf::PdmField<QString> m_name;
caf::PdmField<QString> m_valuesKey;
};