Merge branch 'dev' into feature-analysis-plots-initial

This commit is contained in:
Gaute Lindkvist 2020-04-22 16:17:09 +02:00
commit 9fcfe4fa84
91 changed files with 13342 additions and 8494 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,334 @@
// ResInsight version string : 2020.04.0
// Report generated : Fri Apr 17 13:45:38 2020
//
//
Annotations
AsciiDataCurve
CalcScript
CalculatedSummaryCase
CellEdgeResultSlot
CellFilter
CellPropertyFilter
CellPropertyFilters
CellRangeFilter
CellRangeFilterCollection
ChangeDataSourceFeatureUi
CmdAddItemExecData
CmdDeleteItemExecData
CmdFieldChangeExecData
CmdSelectionChangeExecData
CompletionTemplateCollection
CrossSection
CrossSectionCollection
DataContainerFloat
DataContainerString
DataContainerTime
Eclipse2dViewCollection
EclipseCase
EclipseGeometrySelectionItem
Fault
Faults
FileSummaryCase
FishbonesCollection
FishbonesMultipleSubs
FishbonesPipeProperties
FlowCharacteristicsPlot
FlowDiagSolution
FlowPlotCollection
FormationNames
FormationNamesCollectionObject
FractureContainment
FractureDefinitionCollection
GeoMech2dViewCollection
GeoMechGeometrySelectionItem
GeoMechPropertyFilter
GeoMechPropertyFilters
GeoMechResultDefinition
GeoMechResultSlot
GeoMechView
GridCollection
GridCrossPlotCurve
GridCrossPlotCurveSet
GridInfo
GridInfoCollection
GridSummaryCase
GridTimeHistoryCurve
Intersection2dView
Intersection2dViewCollection
IntersectionBox
IntersectionResultDefinition
Legend
MainPlotCollection
MdiWindowController
MockModelSettings
ModeledWellPath
MultiPlot
MultiSnapshotDefinition
NoCommonAreaNNC
ObservedDataCollection
ObservedFmuRftData
PdmDocument
PdmObjectCollection
PdmObjectGroup
Perforation
PerforationCollection
PlotTemplateCollection
PlotTemplateFileItem
PolylineTarget
PolylinesFromFileAnnotation
PropertyFilter
ResInsightAnalysisModels
ResInsightGeoMechCase
ResInsightGeoMechModels
ResInsightOilField
ResInsightProject
ResampleData
ReservoirCellResultStorage
ReservoirView
ResultDefinition
ResultSlot
ResultStorageEntryInfo
RftAddress
RiaMemoryCleanup
RiaPreferences
RiaRegressionTest
RicCaseAndFileExportSettingsUi
RicCellRangeUi
RicDeleteItemExecData
RicExportCarfinUi
RicExportCompletionDataSettingsUi
RicExportContourMapToTextUi
RicExportEclipseInputGridUi
RicExportLgrUi
RicExportToLasFileObj
RicExportToLasFileResampleUi
RicExportWellPathsUi
RicHoloLensCreateSessionUi
RicHoloLensExportToFolderUi
RicHoloLensServerSettings
RicLinkVisibleViewsFeatureUi
RicPasteAsciiDataToSummaryPlotFeatureUi
RicSaturationPressureUi
RicSaveEclipseInputVisibleCellsUi
RicSelectPlotTemplateUi
RicSelectSummaryPlotUI
RicSelectViewUI
RicSummaryAddressSelection
RicSummaryCurveCalculator
RicSummaryCurveCreator
RicWellPathsUnitSystemSettingsUi
RifReaderSettings
Rim3dWellLogCurveCollection
Rim3dWellLogExtractionCurve
Rim3dWellLogFileCurve
Rim3dWellLogRftCurve
RimAnnotationCollection
RimAnnotationCollectionBase
RimAnnotationGroupCollection
RimAnnotationLineAppearance
RimAnnotationTextAppearance
RimBinaryExportSettings
RimCaseCollection
RimCommandExecuteScript
RimCommandIssueFieldChanged
RimCommandObject
RimContourMapView
RimCsvUserData
RimDerivedEnsembleCase
RimDerivedEnsembleCaseCollection
RimDialogData
RimEclipseContourMapProjection
RimEllipseFractureTemplate
RimEnsembleCurveFilter
RimEnsembleCurveFilterCollection
RimEnsembleCurveSet
RimEnsembleCurveSetCollection
RimEnsembleStatistics
RimExportInputSettings
RimFaultResultSlot
RimFractureExportSettings
RimGeoMechContourMapProjection
RimGeoMechContourMapView
RimGridCrossPlot
RimGridCrossPlotCollection
RimGridCrossPlotCurveSetNameConfig
RimGridCrossPlotNameConfig
RimIdenticalGridCaseGroup
RimInputProperty
RimInputPropertyCollection
RimInputReservoir
RimIntersectionResultsDefinitionCollection
RimMeasurement
RimMswCompletionParameters
RimMultiPlotCollection
RimMultipleValveLocations
RimNoCommonAreaNncCollection
RimNonDarcyPerforationParameters
RimObservedEclipseUserData
RimOilFieldEntry
RimOilRegionEntry
RimPlotAxisAnnotation
RimPlotCellFilterCollection
RimPlotCellPropertyFilter
RimPolylineAppearance
RimPolylinesAnnotationInView
RimPolylinesFromFileAnnotationInView
RimReachCircleAnnotation
RimReachCircleAnnotationInView
RimSaturationPressurePlot
RimSaturationPressurePlotCollection
RimStatisticalCalculation
RimStatisticalCollection
RimStimPlanColors
RimStimPlanFractureTemplate
RimStimPlanLegendConfig
RimSummaryCalculation
RimSummaryCalculationCollection
RimSummaryCalculationVariable
RimSummaryCurveCollection
RimSummaryCurveCollectionModifier
RimTensorResults
RimTernaryLegendConfig
RimTextAnnotation
RimTextAnnotationInView
RimTimeStepFilter
RimUserDefinedPolylinesAnnotationInView
RimViewLinkerCollection
RimViewNameConfig
RimVirtualPerforationResults
RimWellLogExtractionCurve
RimWellLogExtractionCurveNameConfig
RimWellLogFileCurveNameConfig
RimWellLogPlotNameConfig
RimWellLogRftCurveNameConfig
RimWellLogWbsCurve
RimWellPathEntry
RimWellPathImport
RiuCreateMultipleFractionsUi
RiuMultipleFractionsOptions
ScaleLegend
ScriptLocation
SimWellFracture
SimWellFractureCollection
SummaryAddress
SummaryCaseCollection
SummaryCaseSubCollection
SummaryCrossPlot
SummaryCrossPlotCollection
SummaryCurve
SummaryCurveAutoName
SummaryCurveFilter
SummaryFilterSettings
SummaryObservedDataFile
SummaryPageDownloadEntity
SummaryPlot
SummaryPlotCollection
SummaryPlotFilterTextCurveSetEditor
SummaryTimeAxisProperties
SummaryYAxisProperties
Surface
SurfaceCollection
SurfaceInView
SurfaceInViewCollection
TC2
TestCommand1
TofAccumulatedPhaseFractionsPlot
TotalWellAllocationPlot
UserDefinedPolylinesAnnotation
ValveTemplate
ValveTemplateCollection
View3dOverlayInfoConfig
ViewController
ViewLinker
WbsParameters
Well
WellAllocationPlot
WellAllocationPlotLegend
WellBoreStabilityPlot
WellDistributionPlot
WellDistributionPlotCollection
WellFlowRateCurve
WellLogFile
WellLogFileChannel
WellLogFileCurve
WellLogPlot
WellLogPlotCollection
WellLogPlotTrack
WellLogRftCurve
WellMeasurement
WellMeasurementCurve
WellMeasurementFilePath
WellMeasurementInView
WellMeasurements
WellMeasurementsInView
WellPath
WellPathAicdParameters
WellPathAttribute
WellPathAttributes
WellPathBase
WellPathCompletion
WellPathCompletionCollection
WellPathCompletions
WellPathFracture
WellPathFractureCollection
WellPathGeometryDef
WellPathTarget
WellPathValve
WellPaths
WellPltPlot
WellPltPlotCollection
WellRftEnsembleCurveSet
WellRftPlot
WellRftPlotCollection
Wells
cloneView
closeProject
computeCaseGroupStatistics
createGridCaseGroup
createGridCaseGroupResult
createLgrForCompletions
createMultiPlot
createMultipleFractures
createSaturationPressurePlots
createStatisticsCase
createStatisticsCaseResult
createView
createViewResult
createWbsPlotResult
createWellBoreStabilityPlot
exportContourMapToText
exportFlowCharacteristics
exportLgrForCompletions
exportMsw
exportMultiCaseSnapshots
exportProperty
exportPropertyInViews
exportSimWellFractureCompletions
exportSnapshots
exportVisibleCells
exportWellLogPlotData
exportWellLogPlotDataResult
exportWellPathCompletions
exportWellPaths
importFormationNames
importWellLogFiles
importWellLogFilesResult
importWellPaths
importWellPathsResult
loadCase
loadCaseResult
openProject
replaceCase
replaceMultipleCases
replaceSourceCases
runOctaveScript
saveProject
saveProjectAs
scaleFractureTemplate
setExportFolder
setFractureContainment
setMainWindowSize
setPlotWindowSize
setStartDir
setTimeStep

View File

@ -24,6 +24,7 @@
#include "cafClassTypeName.h"
#include "cafPdmDefaultObjectFactory.h"
#include "cafPdmXmlFieldHandle.h"
#include <QAction>
#include <QApplication>
@ -122,7 +123,14 @@ void RicExportObjectAndFieldKeywordsFeature::exportObjectAndFieldKeywords( const
for ( auto f : fields )
{
if ( !f->xmlCapability()->isIOReadable() ) continue;
stream << " " << f->keyword() << "\n";
for ( auto alias : f->keywordAliases() )
{
stream << " (A)" << alias << "\n";
}
}
stream << "\n";

View File

@ -43,6 +43,14 @@ bool RicImportElementPropertyFeature::isCommandEnabled()
///
//--------------------------------------------------------------------------------------------------
void RicImportElementPropertyFeature::onActionTriggered( bool isChecked )
{
importElementProperties();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicImportElementPropertyFeature::importElementProperties()
{
RiaApplication* app = RiaApplication::instance();

View File

@ -27,6 +27,8 @@ class RicImportElementPropertyFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
static void importElementProperties();
protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;

View File

@ -19,6 +19,8 @@
#include "RigFemPartResultsCollection.h"
#include "RiaLogging.h"
#include "RifElementPropertyReader.h"
#include "RifGeoMechReaderInterface.h"
@ -104,6 +106,9 @@ RigFemPartResultsCollection::RigFemPartResultsCollection( RifGeoMechReaderInterf
m_cohesion = 10.0;
m_frictionAngleRad = cvf::Math::toRadians( 30.0 );
m_normalizationAirGap = 0.0;
m_biotFixedFactor = 1.0;
m_biotResultAddress = "";
}
//--------------------------------------------------------------------------------------------------
@ -213,6 +218,25 @@ std::vector<RigFemResultAddress>
return addressesToRemove;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<std::string, QString>
RigFemPartResultsCollection::addressesInElementPropertyFiles( const std::vector<QString>& filenames )
{
std::map<std::string, QString> fieldsInFile;
for ( const QString& filename : filenames )
{
std::vector<std::string> fields = m_elementPropertyReader->fieldsInFile( filename.toStdString() );
for ( const std::string& field : fields )
{
fieldsInFile[field] = filename;
}
}
return fieldsInFile;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -233,6 +257,72 @@ void RigFemPartResultsCollection::setCalculationParameters( double cohesion, dou
RigFemResultAddress( RIG_INTEGRATION_POINT, "SE", "FOS", RigFemResultAddress::allTimeLapsesValue() ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigFemPartResultsCollection::setBiotCoefficientParameters( double biotFixedFactor, const QString& biotResultAddress )
{
m_biotFixedFactor = biotFixedFactor;
m_biotResultAddress = biotResultAddress;
// Invalidate all results which depends on biot coefficient (directly or indirectly)
// Shear results are independent of pore pressure and biot coefficient.
bool includeShear = false;
std::vector<std::string> componentNames = getStressComponentNames( includeShear );
componentNames.push_back( "S1inc" );
componentNames.push_back( "S1azi" );
componentNames.push_back( "S2inc" );
componentNames.push_back( "S2azi" );
componentNames.push_back( "S3inc" );
componentNames.push_back( "S3azi" );
for ( auto elementType : {RIG_ELEMENT_NODAL, RIG_INTEGRATION_POINT} )
{
for ( auto fieldName : {"SE", "ST"} )
{
for ( auto componentName : componentNames )
{
deleteResult(
RigFemResultAddress( elementType, fieldName, componentName, RigFemResultAddress::allTimeLapsesValue() ) );
}
}
// SE only: depends on SE.S1 and SE.S3
deleteResult( RigFemResultAddress( elementType, "SE", "SFI", RigFemResultAddress::allTimeLapsesValue() ) );
deleteResult( RigFemResultAddress( elementType, "SE", "DSM", RigFemResultAddress::allTimeLapsesValue() ) );
deleteResult( RigFemResultAddress( elementType, "SE", "SEM", RigFemResultAddress::allTimeLapsesValue() ) );
// SE only: depends on SE.DSM
deleteResult( RigFemResultAddress( elementType, "SE", "FOS", RigFemResultAddress::allTimeLapsesValue() ) );
// ST only: depends on ST.S1 and ST.S3
deleteResult( RigFemResultAddress( elementType, "ST", "Q", RigFemResultAddress::allTimeLapsesValue() ) );
deleteResult( RigFemResultAddress( elementType, "ST", "STM", RigFemResultAddress::allTimeLapsesValue() ) );
}
for ( auto fieldName : {"SE", "ST"} )
{
// Surface aligned stress
for ( auto componentName : {"SN", "TP", "TPinc", "TPH", "TPQV", "FAULTMOB", "PCRIT"} )
{
deleteResult( RigFemResultAddress( RIG_ELEMENT_NODAL_FACE,
fieldName,
componentName,
RigFemResultAddress::allTimeLapsesValue() ) );
}
// Stress gradient components
const std::vector<std::string> stressGradientComponentNames = getStressGradientComponentNames( includeShear );
for ( auto componentName : stressGradientComponentNames )
{
deleteResult( RigFemResultAddress( RIG_DIFFERENTIALS,
fieldName,
componentName,
RigFemResultAddress::allTimeLapsesValue() ) );
}
}
}
//--------------------------------------------------------------------------------------------------
/// Will always return a valid object, but it can be empty
//--------------------------------------------------------------------------------------------------
@ -338,8 +428,9 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::findOrLoadScalarResult( i
if ( !frames )
{
frames = m_femPartResults[partIndex]->createScalarResult( resVarAddr ); // Create a dummy empty result, if the
// request did not specify the component.
frames = m_femPartResults[partIndex]->createScalarResult( resVarAddr ); // Create a dummy empty result, if
// the request did not specify the
// component.
}
return frames;
@ -710,7 +801,8 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateTimeLapseResult(
}
else
{
// Gamma time lapse needs to be calculated as ST_dt / POR_dt and not Gamma - Gamma_baseFrame see github issue #937
// Gamma time lapse needs to be calculated as ST_dt / POR_dt and not Gamma - Gamma_baseFrame see github
// issue #937
caf::ProgressInfo frameCountProgress( this->frameCount() * 3, "" );
frameCountProgress.setProgressDescription(
@ -2131,7 +2223,8 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateNE( int partInde
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigFemScalarResultFrames* RigFemPartResultsCollection::calculateSE( int partIndex, const RigFemResultAddress& resVarAddr )
RigFemScalarResultFrames* RigFemPartResultsCollection::calculateSE_12_13_23( int partIndex,
const RigFemResultAddress& resVarAddr )
{
caf::ProgressInfo frameCountProgress( this->frameCount() * 3, "" );
frameCountProgress.setProgressDescription(
@ -2143,8 +2236,6 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateSE( int partInde
RigFemResultAddress( resVarAddr.resultPosType, "S-Bar", resVarAddr.componentName ) );
frameCountProgress.incrementProgress();
frameCountProgress.setNextProgressIncrement( this->frameCount() );
RigFemScalarResultFrames* srcPORDataFrames =
this->findOrLoadScalarResult( partIndex, RigFemResultAddress( RIG_NODAL, "POR-Bar", "" ) );
RigFemScalarResultFrames* dstDataFrames = m_femPartResults[partIndex]->createScalarResult( resVarAddr );
frameCountProgress.incrementProgress();
@ -2153,6 +2244,7 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateSE( int partInde
float inf = std::numeric_limits<float>::infinity();
int frameCount = srcDataFrames->frameCount();
for ( int fIdx = 0; fIdx < frameCount; ++fIdx )
{
const std::vector<float>& srcSFrameData = srcDataFrames->frameData( fIdx );
@ -2160,8 +2252,6 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateSE( int partInde
size_t valCount = srcSFrameData.size();
dstFrameData.resize( valCount );
const std::vector<float>& srcPORFrameData = srcPORDataFrames->frameData( fIdx );
int elementCount = femPart->elementCount();
#pragma omp parallel for
@ -2201,6 +2291,131 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateSE( int partInde
return dstDataFrames;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigFemScalarResultFrames* RigFemPartResultsCollection::calculateSE_11_22_33( int partIndex,
const RigFemResultAddress& resVarAddr )
{
caf::ProgressInfo frameCountProgress( this->frameCount() * 3, "" );
frameCountProgress.setProgressDescription(
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
frameCountProgress.setNextProgressIncrement( this->frameCount() );
RigFemScalarResultFrames* srcDataFrames =
this->findOrLoadScalarResult( partIndex,
RigFemResultAddress( resVarAddr.resultPosType, "S-Bar", resVarAddr.componentName ) );
frameCountProgress.incrementProgress();
frameCountProgress.setNextProgressIncrement( this->frameCount() );
RigFemScalarResultFrames* srcPORDataFrames =
this->findOrLoadScalarResult( partIndex, RigFemResultAddress( RIG_NODAL, "POR-Bar", "" ) );
RigFemScalarResultFrames* dstDataFrames = m_femPartResults[partIndex]->createScalarResult( resVarAddr );
frameCountProgress.incrementProgress();
// Biot porelastic coeffisient (alpha)
RigFemScalarResultFrames* biotCoefficient = nullptr;
if ( !m_biotResultAddress.isEmpty() )
{
biotCoefficient =
this->findOrLoadScalarResult( partIndex,
RigFemResultAddress( RIG_ELEMENT, m_biotResultAddress.toStdString(), "" ) );
}
const RigFemPart* femPart = m_femParts->part( partIndex );
float inf = std::numeric_limits<float>::infinity();
int frameCount = srcDataFrames->frameCount();
for ( int fIdx = 0; fIdx < frameCount; ++fIdx )
{
const std::vector<float>& srcSFrameData = srcDataFrames->frameData( fIdx );
std::vector<float>& dstFrameData = dstDataFrames->frameData( fIdx );
size_t valCount = srcSFrameData.size();
dstFrameData.resize( valCount );
const std::vector<float>& initialPORFrameData = srcPORDataFrames->frameData( 0 );
int elementCount = femPart->elementCount();
std::vector<float> biotData;
if ( biotCoefficient )
{
biotData = biotCoefficient->frameData( fIdx );
if ( !isValidBiotData( biotData, elementCount ) )
{
deleteResult( resVarAddr );
return nullptr;
}
}
#pragma omp parallel for
for ( int elmIdx = 0; elmIdx < elementCount; ++elmIdx )
{
RigElementType elmType = femPart->elementType( elmIdx );
int elmNodeCount = RigFemTypes::elmentNodeCount( femPart->elementType( elmIdx ) );
if ( elmType == HEX8P )
{
for ( int elmNodIdx = 0; elmNodIdx < elmNodeCount; ++elmNodIdx )
{
size_t elmNodResIdx = femPart->elementNodeResultIdx( elmIdx, elmNodIdx );
if ( elmNodResIdx < srcSFrameData.size() )
{
double SE_abacus = -srcSFrameData[elmNodResIdx];
if ( fIdx == 0 )
{
// Geostatic step: biot coefficient == 1.0
dstFrameData[elmNodResIdx] = SE_abacus;
}
else
{
// Use biot coefficient for all other (not Geostatic) timesteps
double biotCoefficient = 1.0;
if ( biotData.empty() )
{
biotCoefficient = m_biotFixedFactor;
}
else
{
// Use coefficient from element property table
biotCoefficient = biotData[elmIdx];
}
// SE = St - alpha * porePressure - (1 - alpha) * initialPorePressure
// ST = SE_abaqus + alpha * porePressure
// Can be simplified:
// SE = SE_abaqus - (1-alpha) * initialPorePressure
// SE_abaqus is called S-Bar
int nodeIdx = femPart->nodeIdxFromElementNodeResultIdx( elmNodResIdx );
double initialPorePressure = initialPORFrameData[nodeIdx];
if ( initialPorePressure == inf ) initialPorePressure = 0.0f;
dstFrameData[elmNodResIdx] = SE_abacus - ( 1.0 - biotCoefficient ) * initialPorePressure;
}
}
}
}
else
{
for ( int elmNodIdx = 0; elmNodIdx < elmNodeCount; ++elmNodIdx )
{
size_t elmNodResIdx = femPart->elementNodeResultIdx( elmIdx, elmNodIdx );
if ( elmNodResIdx < dstFrameData.size() )
{
dstFrameData[elmNodResIdx] = inf;
}
}
}
}
frameCountProgress.incrementProgress();
}
return dstDataFrames;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -2221,6 +2436,15 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateST_11_22_33( int
RigFemScalarResultFrames* srcPORDataFrames =
this->findOrLoadScalarResult( partIndex, RigFemResultAddress( RIG_NODAL, "POR-Bar", "" ) );
// Biot porelastic coeffisient (alpha)
RigFemScalarResultFrames* biotCoefficient = nullptr;
if ( !m_biotResultAddress.isEmpty() )
{
biotCoefficient =
this->findOrLoadScalarResult( partIndex,
RigFemResultAddress( RIG_ELEMENT, m_biotResultAddress.toStdString(), "" ) );
}
RigFemScalarResultFrames* dstDataFrames = m_femPartResults[partIndex]->createScalarResult( resVarAddr );
const RigFemPart* femPart = m_femParts->part( partIndex );
int frameCount = srcSDataFrames->frameCount();
@ -2234,13 +2458,24 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateST_11_22_33( int
const std::vector<float>& srcSFrameData = srcSDataFrames->frameData( fIdx );
const std::vector<float>& srcPORFrameData = srcPORDataFrames->frameData( fIdx );
int elementCount = femPart->elementCount();
std::vector<float> biotData;
if ( biotCoefficient )
{
biotData = biotCoefficient->frameData( fIdx );
if ( !isValidBiotData( biotData, elementCount ) )
{
deleteResult( resVarAddr );
return nullptr;
}
}
std::vector<float>& dstFrameData = dstDataFrames->frameData( fIdx );
size_t valCount = srcSFrameData.size();
dstFrameData.resize( valCount );
int elementCount = femPart->elementCount();
#pragma omp parallel for
for ( int elmIdx = 0; elmIdx < elementCount; ++elmIdx )
{
@ -2260,7 +2495,31 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateST_11_22_33( int
float por = srcPORFrameData[nodeIdx];
if ( por == inf ) por = 0.0f;
dstFrameData[elmNodResIdx] = -srcSFrameData[elmNodResIdx] + por;
// ST = SE_abacus + alpha * porePressure
// where alpha is biot coefficient, and porePressure is POR-Bar.
double SE_abacus = -srcSFrameData[elmNodResIdx];
if ( fIdx == 0 )
{
// Geostatic step: biot coefficient == 1.0
dstFrameData[elmNodResIdx] = SE_abacus + por;
}
else
{
// Use biot coefficient for all other (not Geostatic) timesteps
double biotCoefficient = 1.0;
if ( biotData.empty() )
{
biotCoefficient = m_biotFixedFactor;
}
else
{
// Use coefficient from element property table
biotCoefficient = biotData[elmIdx];
}
dstFrameData[elmNodResIdx] = SE_abacus + biotCoefficient * por;
}
}
}
}
@ -2555,11 +2814,16 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult( i
return calculatePrincipalStrainValues( partIndex, resVarAddr );
}
if ( ( resVarAddr.fieldName == "SE" ) && ( resVarAddr.componentName == "S11" || resVarAddr.componentName == "S22" ||
resVarAddr.componentName == "S33" || resVarAddr.componentName == "S12" ||
resVarAddr.componentName == "S13" || resVarAddr.componentName == "S23" ) )
if ( ( resVarAddr.fieldName == "SE" ) &&
( resVarAddr.componentName == "S11" || resVarAddr.componentName == "S22" || resVarAddr.componentName == "S33" ) )
{
return calculateSE( partIndex, resVarAddr );
return calculateSE_11_22_33( partIndex, resVarAddr );
}
if ( ( resVarAddr.fieldName == "SE" ) &&
( resVarAddr.componentName == "S12" || resVarAddr.componentName == "S13" || resVarAddr.componentName == "S23" ) )
{
return calculateSE_12_13_23( partIndex, resVarAddr );
}
if ( ( resVarAddr.fieldName == "SE" || resVarAddr.fieldName == "ST" ) &&
@ -3488,18 +3752,26 @@ void findReferenceElementForNode( const RigFemPart& part, size_t nodeIdx, size_t
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::string> RigFemPartResultsCollection::getStressComponentNames()
std::vector<std::string> RigFemPartResultsCollection::getStressComponentNames( bool includeShear )
{
return {"S11", "S22", "S33", "S12", "S13", "S23", "S1", "S2", "S3"};
std::vector<std::string> componentNames = {"S11", "S22", "S33", "S1", "S2", "S3"};
if ( includeShear )
{
componentNames.push_back( "S12" );
componentNames.push_back( "S13" );
componentNames.push_back( "S23" );
}
return componentNames;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::string> RigFemPartResultsCollection::getStressGradientComponentNames()
std::vector<std::string> RigFemPartResultsCollection::getStressGradientComponentNames( bool includeShear )
{
std::vector<std::string> directions = {"X", "Y", "Z"};
std::vector<std::string> stressComponentNames = getStressComponentNames();
std::vector<std::string> stressComponentNames = getStressComponentNames( includeShear );
std::vector<std::string> stressGradientComponentNames;
for ( auto& s : stressComponentNames )
@ -3512,3 +3784,29 @@ std::vector<std::string> RigFemPartResultsCollection::getStressGradientComponent
return stressGradientComponentNames;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigFemPartResultsCollection::isValidBiotData( const std::vector<float>& biotData, size_t elementCount ) const
{
if ( biotData.size() != elementCount )
{
RiaLogging::error( QString( "Unexpected size of biot coefficient element properties: %1 (expected: %2)" )
.arg( biotData.size() )
.arg( elementCount ) );
return false;
}
for ( float b : biotData )
{
if ( !std::isinf( b ) && ( b < 0.0 || b > 1.0 ) )
{
RiaLogging::error(
QString( "Found unexpected biot coefficient. The value must be in the [0, 1] interval." ) );
return false;
}
}
return true;
}

View File

@ -61,11 +61,14 @@ public:
void addElementPropertyFiles( const std::vector<QString>& filenames );
std::vector<RigFemResultAddress> removeElementPropertyFiles( const std::vector<QString>& filenames );
std::map<std::string, QString> addressesInElementPropertyFiles( const std::vector<QString>& filenames );
void setCalculationParameters( double cohesion, double frictionAngleRad );
double parameterCohesion() const { return m_cohesion; }
double parameterFrictionAngleRad() const { return m_frictionAngleRad; }
void setBiotCoefficientParameters( double fixedFactor, const QString& biotResultAddress );
std::map<std::string, std::vector<std::string>> scalarFieldAndComponentNames( RigFemResultPosEnum resPos );
std::vector<std::string> filteredStepNames() const;
bool assertResultsLoaded( const RigFemResultAddress& resVarAddr );
@ -150,7 +153,8 @@ private:
RigFemScalarResultFrames* calculatePrincipalStrainValues( int partIndex, const RigFemResultAddress& resVarAddr );
RigFemScalarResultFrames* calculateCompactionValues( int partIndex, const RigFemResultAddress& resVarAddr );
RigFemScalarResultFrames* calculateNE( int partIndex, const RigFemResultAddress& resVarAddr );
RigFemScalarResultFrames* calculateSE( int partIndex, const RigFemResultAddress& resVarAddr );
RigFemScalarResultFrames* calculateSE_11_22_33( int partIndex, const RigFemResultAddress& resVarAddr );
RigFemScalarResultFrames* calculateSE_12_13_23( int partIndex, const RigFemResultAddress& resVarAddr );
RigFemScalarResultFrames* calculateST_11_22_33( int partIndex, const RigFemResultAddress& resVarAddr );
RigFemScalarResultFrames* calculateST_12_13_23( int partIndex, const RigFemResultAddress& resVarAddr );
RigFemScalarResultFrames* calculateGamma( int partIndex, const RigFemResultAddress& resVarAddr );
@ -161,6 +165,8 @@ private:
const RigFormationNames* activeFormationNames() const;
bool isValidBiotData( const std::vector<float>& biotData, size_t elementCount ) const;
private:
cvf::Collection<RigFemPartResults> m_femPartResults;
cvf::ref<RifGeoMechReaderInterface> m_readerInterface;
@ -172,12 +178,15 @@ private:
double m_frictionAngleRad;
double m_normalizationAirGap;
double m_biotFixedFactor;
QString m_biotResultAddress;
RigStatisticsDataCache* statistics( const RigFemResultAddress& resVarAddr );
std::vector<RigFemResultAddress> getResAddrToComponentsToRead( const RigFemResultAddress& resVarAddr );
std::map<RigFemResultAddress, cvf::ref<RigStatisticsDataCache>> m_resultStatistics;
static std::vector<std::string> getStressComponentNames();
static std::vector<std::string> getStressGradientComponentNames();
static std::vector<std::string> getStressComponentNames( bool includeShear = true );
static std::vector<std::string> getStressGradientComponentNames( bool includeShear = true );
};
class RigFemPart;

View File

@ -33,10 +33,10 @@ release = '2019.04.01'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx_markdown_builder'
'sphinx_markdown_builder'
]
master_doc = 'PythonRips'
master_doc = 'PythonRips'
napoleon_google_docstring = True
@ -56,7 +56,7 @@ exclude_patterns = ['build/*', 'rips.rst']
#
html_theme = 'alabaster'
smartquotes=False
smartquotes = False
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,

View File

@ -12,6 +12,29 @@ Operate on a ResInsight case specified by a Case Id integer.
Not meant to be constructed separately but created by one of the following
methods in Project: loadCase, case, allCases, selectedCases
.. _result-definition-label:
Result Definition
-----------------
When working with grid case results, the following two argumenst are used in many functions to identify a
result
**Result Definition enums**::
property_type | | porosity_model
(str enum) | | (str enum)
----------------------- | ----- | --------------
DYNAMIC_NATIVE | | MATRIX_MODEL
STATIC_NATIVE | | FRACTURE_MODEL
SOURSIMRL | |
GENERATED | |
INPUT_PROPERTY | |
FORMATION_NAMES | |
FLOW_DIAGNOSTICS | |
INJECTION_FLOODING | |
Attributes:
id (int): Case Id corresponding to case Id in ResInsight project.
name (str): Case name
@ -55,6 +78,7 @@ def __custom_init__(self, pb2_object, channel):
# Public properties
self.chunk_size = 8160
@add_method(Case)
def __grid_count(self):
"""Get number of grids in the case"""
@ -65,10 +89,12 @@ def __grid_count(self):
return 0
return 0
@add_method(Case)
def __request(self):
return Case_pb2.CaseRequest(id=self.id)
@add_method(Case)
def __generate_property_input_iterator(self, values_iterator, parameters):
chunk = Properties_pb2.PropertyInputChunk()
@ -80,6 +106,7 @@ def __generate_property_input_iterator(self, values_iterator, parameters):
chunk.values.CopyFrom(valmsg)
yield chunk
@add_method(Case)
def __generate_property_input_chunks(self, array, parameters):
index = -1
@ -92,7 +119,7 @@ def __generate_property_input_chunks(self, array, parameters):
actual_chunk_size = min(len(array) - index + 1, self.chunk_size)
chunk.values.CopyFrom(
Properties_pb2.PropertyChunk(values=array[index:index +
actual_chunk_size]))
actual_chunk_size]))
index += actual_chunk_size
yield chunk
@ -100,6 +127,7 @@ def __generate_property_input_chunks(self, array, parameters):
chunk = Properties_pb2.PropertyInputChunk()
yield chunk
@add_method(Case)
def grid(self, index):
"""Get Grid of a given index
@ -107,27 +135,31 @@ def grid(self, index):
Arguments:
index (int): The grid index
Returns: :class:`rips.grid.Grid`
Returns:
:class:`rips.grid.Grid`
"""
return Grid(index, self, self.channel())
@add_method(Case)
def grids(self):
"""Get a list of all rips Grid objects in the case
Returns: List of :class:`rips.grid.Grid`
Returns:
List of :class:`rips.grid.Grid`
"""
grid_list = []
for i in range(0, self.__grid_count()):
grid_list.append(Grid(i, self, self.channel()))
return grid_list
@add_method(Case)
def replace(self, new_grid_file):
"""Replace the current case grid with a new grid loaded from file
Arguments:
new_egrid_file (str): path to EGRID file
new_egrid_file (str): Path to EGRID file
"""
project = self.ancestor(rips.project.Project)
self._execute_command(replaceCase=Cmd.ReplaceCaseRequest(
@ -135,10 +167,10 @@ def replace(self, new_grid_file):
new_case = project.case(self.id)
self.copy_from(new_case)
@add_method(Case)
def cell_count(self, porosity_model="MATRIX_MODEL"):
"""Get a cell count object containing number of active cells and
total number of cells
"""Get a cell count object containing number of active cells and total number of cells
Arguments:
porosity_model (str): String representing an enum.
@ -147,12 +179,21 @@ def cell_count(self, porosity_model="MATRIX_MODEL"):
Cell Count object with the following integer attributes:
active_cell_count: number of active cells
reservoir_cell_count: total number of reservoir cells
**CellCount class description**::
Parameter | Description | Type
----------------------- | ------------------------- | -----
active_cell_count | Number of active cells | Integer
reservoir_cell_count | Total number of cells | Integer
"""
porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model)
request = Case_pb2.CellInfoRequest(case_request=self.__request(),
porosity_model=porosity_model_enum)
porosity_model=porosity_model_enum)
return self.__case_stub.GetCellCount(request)
@add_method(Case)
def cell_info_for_active_cells_async(self, porosity_model="MATRIX_MODEL"):
"""Get Stream of cell info objects for current case
@ -164,13 +205,14 @@ def cell_info_for_active_cells_async(self, porosity_model="MATRIX_MODEL"):
Returns:
Stream of **CellInfo** objects
See cell_info_for_active_cells() for detalis on the **CellInfo** class.
See :meth:`rips.case.cell_info_for_active_cells()` for detalis on the **CellInfo** class.
"""
porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model)
request = Case_pb2.CellInfoRequest(case_request=self.__request(),
porosity_model=porosity_model_enum)
porosity_model=porosity_model_enum)
return self.__case_stub.GetCellInfoForActiveCells(request)
@add_method(Case)
def cell_info_for_active_cells(self, porosity_model="MATRIX_MODEL"):
"""Get list of cell info objects for current case
@ -209,6 +251,7 @@ def cell_info_for_active_cells(self, porosity_model="MATRIX_MODEL"):
received_active_cells.append(active_cell)
return received_active_cells
@add_method(Case)
def time_steps(self):
"""Get a list containing all time steps
@ -230,36 +273,56 @@ def time_steps(self):
"""
return self.__case_stub.GetTimeSteps(self.__request()).dates
@add_method(Case)
def reservoir_boundingbox(self):
"""Get the reservoir bounding box
Returns: A class with six double members: min_x, max_x, min_y, max_y, min_z, max_z
Returns:
BoundingBox
**BoundingBox class description**::
Type | Name
--------- | ----------
int | min_x
int | max_x
int | min_y
int | max_y
int | min_z
int | max_z
"""
return self.__case_stub.GetReservoirBoundingBox(self.__request())
@add_method(Case)
def reservoir_depth_range(self):
"""Get the reservoir depth range
Returns: A tuple with two members. The first is the minimum depth, the second is the maximum depth
Returns:
A tuple with two members. The first is the minimum depth, the second is the maximum depth
"""
bbox = self.reservoir_boundingbox()
return -bbox.max_z, -bbox.min_z
@add_method(Case)
def days_since_start(self):
"""Get a list of decimal values representing days since the start of the simulation"""
return self.__case_stub.GetDaysSinceStart(self.__request()).day_decimals
@add_method(Case)
def view(self, view_id):
"""Get a particular view belonging to a case by providing view id
Arguments:
view_id(int): view id
Returns: a view object
Returns:
:class:`rips.generated.pdm_objects.View`
"""
views = self.views()
for view_object in views:
@ -267,13 +330,19 @@ def view(self, view_id):
return view_object
return None
@add_method(Case)
def create_view(self):
"""Create a new view in the current case"""
"""Create a new view in the current case
Returns:
:class:`rips.generated.pdm_objects.View`
"""
return self.view(
self._execute_command(createView=Cmd.CreateViewRequest(
caseId=self.id)).createViewResult.viewId)
@add_method(Case)
def export_snapshots_of_all_views(self, prefix="", export_folder=""):
""" Export snapshots for all views in the case
@ -287,6 +356,7 @@ def export_snapshots_of_all_views(self, prefix="", export_folder=""):
exportSnapshots=Cmd.ExportSnapshotsRequest(
type="VIEWS", prefix=prefix, caseId=self.id, viewId=-1, exportFolder=export_folder))
@add_method(Case)
def export_well_path_completions(
self,
@ -353,6 +423,7 @@ def export_well_path_completions(
combinationMode=combination_mode,
))
@add_method(Case)
def export_msw(self, well_path):
"""
@ -364,6 +435,7 @@ def export_msw(self, well_path):
return self._execute_command(exportMsw=Cmd.ExportMswRequest(
caseId=self.id, wellPath=well_path))
@add_method(Case)
def create_multiple_fractures(
self,
@ -408,6 +480,7 @@ def create_multiple_fractures(
action=action,
))
@add_method(Case)
def create_lgr_for_completion(
self,
@ -454,6 +527,7 @@ def create_lgr_for_completion(
splitType=split_type,
))
@add_method(Case)
def create_saturation_pressure_plots(self):
"""
@ -464,6 +538,7 @@ def create_saturation_pressure_plots(self):
createSaturationPressurePlots=Cmd.CreateSatPressPlotRequest(
caseIds=case_ids))
@add_method(Case)
def export_flow_characteristics(
self,
@ -505,23 +580,17 @@ def export_flow_characteristics(
aquiferCellThreshold=aquifer_cell_threshold,
))
@add_method(Case)
def available_properties(self,
property_type,
porosity_model="MATRIX_MODEL"):
property_type,
porosity_model="MATRIX_MODEL"):
"""Get a list of available properties
Arguments:
property_type (str): string corresponding to property_type enum. Choices::
- DYNAMIC_NATIVE
- STATIC_NATIVE
- SOURSIMRL
- GENERATED
- INPUT_PROPERTY
- FORMATION_NAMES
- FLOW_DIAGNOSTICS
- INJECTION_FLOODING
For argument details, see :ref:`result-definition-label`
Arguments:
property_type (str): string corresponding to property_type enum.
porosity_model(str): 'MATRIX_MODEL' or 'FRACTURE_MODEL'.
"""
@ -535,19 +604,20 @@ def available_properties(self,
return self.__properties_stub.GetAvailableProperties(
request).property_names
@add_method(Case)
def active_cell_property_async(self,
property_type,
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all active cells. Async, so returns an iterator
property_type,
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all active cells. Async, so returns an iterator. For argument details, see :ref:`result-definition-label`
Arguments:
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
Returns:
An iterator to a chunk object containing an array of double values
@ -565,19 +635,20 @@ def active_cell_property_async(self,
for chunk in self.__properties_stub.GetActiveCellProperty(request):
yield chunk
@add_method(Case)
def active_cell_property(self,
property_type,
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all active cells. Sync, so returns a list
property_type,
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all active cells. Sync, so returns a list. For argument details, see :ref:`result-definition-label`
Arguments:
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
Returns:
A list containing double values
@ -592,19 +663,20 @@ def active_cell_property(self,
all_values.append(value)
return all_values
@add_method(Case)
def selected_cell_property_async(self,
property_type,
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all selected cells. Async, so returns an iterator
property_type,
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all selected cells. Async, so returns an iterator. For argument details, see :ref:`result-definition-label`
Arguments:
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
Returns:
An iterator to a chunk object containing an array of double values
@ -622,19 +694,20 @@ def selected_cell_property_async(self,
for chunk in self.__properties_stub.GetSelectedCellProperty(request):
yield chunk
@add_method(Case)
def selected_cell_property(self,
property_type,
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all selected cells. Sync, so returns a list
property_type,
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all selected cells. Sync, so returns a list. For argument details, see :ref:`result-definition-label`
Arguments:
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
Returns:
A list containing double values
@ -642,13 +715,14 @@ def selected_cell_property(self,
"""
all_values = []
generator = self.selected_cell_property_async(property_type,
property_name, time_step,
porosity_model)
property_name, time_step,
porosity_model)
for chunk in generator:
for value in chunk.values:
all_values.append(value)
return all_values
@add_method(Case)
def grid_property_async(
self,
@ -657,14 +731,14 @@ def grid_property_async(
time_step,
grid_index=0,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all grid cells. Async, so returns an iterator
"""Get a cell property for all grid cells. Async, so returns an iterator. For argument details, see :ref:`result-definition-label`
Arguments:
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
gridIndex(int): index to the grid we're getting values for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
Returns:
An iterator to a chunk object containing an array of double values
@ -683,6 +757,7 @@ def grid_property_async(
for chunk in self.__properties_stub.GetGridProperty(request):
yield chunk
@add_method(Case)
def grid_property(
self,
@ -691,27 +766,28 @@ def grid_property(
time_step,
grid_index=0,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all grid cells. Synchronous, so returns a list
"""Get a cell property for all grid cells. Synchronous, so returns a list. For argument details, see :ref:`result-definition-label`
Arguments:
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
grid_index(int): index to the grid we're getting values for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
Returns:
A list of double values
"""
all_values = []
generator = self.grid_property_async(property_type, property_name,
time_step, grid_index,
porosity_model)
time_step, grid_index,
porosity_model)
for chunk in generator:
for value in chunk.values:
all_values.append(value)
return all_values
@add_method(Case)
def set_active_cell_property_async(
self,
@ -720,14 +796,14 @@ def set_active_cell_property_async(
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Set cell property for all active cells Async. Takes an iterator to the input values
"""Set cell property for all active cells Async. Takes an iterator to the input values. For argument details, see :ref:`result-definition-label`
Arguments:
values_iterator(iterator): an iterator to the properties to be set
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
"""
property_type_enum = Properties_pb2.PropertyType.Value(property_type)
porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model)
@ -743,6 +819,7 @@ def set_active_cell_property_async(
values_iterator, request)
self.__properties_stub.SetActiveCellProperty(request_iterator)
@add_method(Case)
def set_active_cell_property(
self,
@ -751,14 +828,14 @@ def set_active_cell_property(
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Set a cell property for all active cells.
"""Set a cell property for all active cells. For argument details, see :ref:`result-definition-label`
Arguments:
values(list): a list of double precision floating point numbers
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
"""
property_type_enum = Properties_pb2.PropertyType.Value(property_type)
porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model)
@ -775,6 +852,7 @@ def set_active_cell_property(
if reply.accepted_value_count < len(values):
raise IndexError
@add_method(Case)
def set_grid_property(
self,
@ -784,15 +862,15 @@ def set_grid_property(
time_step,
grid_index=0,
porosity_model="MATRIX_MODEL"):
"""Set a cell property for all grid cells.
"""Set a cell property for all grid cells. For argument details, see :ref:`result-definition-label`
Arguments:
values(list): a list of double precision floating point numbers
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
grid_index(int): index to the grid we're setting values for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
"""
property_type_enum = Properties_pb2.PropertyType.Value(property_type)
porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model)
@ -810,6 +888,7 @@ def set_grid_property(
if reply.accepted_value_count < len(values):
raise IndexError
@add_method(Case)
def export_property(
self,
@ -836,6 +915,7 @@ def export_property(
exportFile=export_file,
))
@add_method(Case)
def create_well_bore_stability_plot(self, well_path, time_step, parameters=None):
""" Create a new well bore stability plot
@ -845,7 +925,7 @@ def create_well_bore_stability_plot(self, well_path, time_step, parameters=None)
time_step(int): time step
Returns:
A new plot object
:class:`rips.generated.pdm_objects.WellBoreStabilityPlot`
"""
pb2_parameters = None
if parameters is not None:
@ -853,13 +933,14 @@ def create_well_bore_stability_plot(self, well_path, time_step, parameters=None)
pb2_parameters = parameters.pb2_object()
plot_result = self._execute_command(createWellBoreStabilityPlot=Cmd.CreateWbsPlotRequest(caseId=self.id,
wellPath=well_path,
timeStep=time_step,
wbsParameters=pb2_parameters))
wellPath=well_path,
timeStep=time_step,
wbsParameters=pb2_parameters))
project = self.ancestor(rips.project.Project)
plot = project.plot(view_id=plot_result.createWbsPlotResult.viewId)
return plot
@add_method(Case)
def import_formation_names(self, formation_files=None):
""" Import formation names into project and apply it to the current case
@ -876,16 +957,19 @@ def import_formation_names(self, formation_files=None):
self._execute_command(importFormationNames=Cmd.ImportFormationNamesRequest(formationFiles=formation_files,
applyToCaseId=self.id))
@add_method(Case)
def simulation_wells(self):
"""Get a list of all simulation wells for a case
Returns:
A list of rips **SimulationWell** objects
:class:`rips.generated.pdm_objects.SimulationWell`
"""
wells = self.descendants(SimulationWell)
return wells
@add_method(Case)
def active_cell_centers_async(
self,
@ -901,9 +985,10 @@ def active_cell_centers_async(
"""
porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model)
request = Case_pb2.CellInfoRequest(case_request=self.__request(),
porosity_model=porosity_model_enum)
porosity_model=porosity_model_enum)
return self.__case_stub.GetCellCenterForActiveCells(request)
@add_method(Case)
def active_cell_centers(
self,
@ -923,6 +1008,7 @@ def active_cell_centers(
cell_centers.append(value)
return cell_centers
@add_method(Case)
def active_cell_corners_async(
self,
@ -938,9 +1024,10 @@ def active_cell_corners_async(
"""
porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model)
request = Case_pb2.CellInfoRequest(case_request=self.__request(),
porosity_model=porosity_model_enum)
porosity_model=porosity_model_enum)
return self.__case_stub.GetCellCornersForActiveCells(request)
@add_method(Case)
def active_cell_corners(
self,
@ -950,8 +1037,20 @@ def active_cell_corners(
Arguments:
porosity_model(str): string enum. See available()
Returns:
A list of CellCorners
**CellCorner class description**::
Parameter | Description | Type
----------- | ------------ | -----
c0 | | Vec3d
c1 | | Vec3d
c2 | | Vec3d
c3 | | Vec3d
c4 | | Vec3d
c5 | | Vec3d
c6 | | Vec3d
c7 | | Vec3d
"""
cell_corners = []
generator = self.active_cell_corners_async(porosity_model)
@ -960,16 +1059,18 @@ def active_cell_corners(
cell_corners.append(value)
return cell_corners
@add_method(Case)
def selected_cells_async(self):
"""Get the selected cells. Async, so returns an iterator.
Returns:
An iterator to a chunk object containing an array of cells.
Loop through the chunks and then the cells within the chunk to get all cells.
"""
return self.__case_stub.GetSelectedCells(self.__request())
@add_method(Case)
def selected_cells(self):
"""Get the selected cells. Synchronous, so returns a list.
@ -984,6 +1085,7 @@ def selected_cells(self):
cells.append(value)
return cells
@add_method(Case)
def coarsening_info(self):
"""Get a coarsening information for all grids in the case.
@ -994,12 +1096,24 @@ def coarsening_info(self):
"""
return self.__case_stub.GetCoarseningInfoArray(self.__request()).data
@add_method(Case)
def available_nnc_properties(self):
"""Get a list of available NNC properties
**NNCConnection class description**::
Parameter | Description | Type
------------------------| --------------------------------------------- | -----
cell_grid_index1 | Reservoir Cell Index to cell 1 | int32
cell_grid_index2 | Reservoir Cell Index to cell 2 | int32
cell1 | Reservoir Cell IJK to cell 1 | Vec3i
cell2 | Reservoir Cell IJK to cell 1 | Vec3i
"""
return self.__nnc_properties_stub.GetAvailableNNCProperties(self.__request()).properties
@add_method(Case)
def nnc_connections_async(self):
"""Get the NNC connections. Async, so returns an iterator.
@ -1010,6 +1124,7 @@ def nnc_connections_async(self):
"""
return self.__nnc_properties_stub.GetNNCConnections(self.__request())
@add_method(Case)
def nnc_connections(self):
"""Get the NNC connection. Synchronous, so returns a list.
@ -1024,14 +1139,16 @@ def nnc_connections(self):
connections.append(value)
return connections
@add_method(Case)
def __nnc_connections_values_async(self, property_name, property_type, time_step):
request = NNCProperties_pb2.NNCValuesRequest(case_id=self.id,
property_name=property_name,
property_type=property_type,
time_step=time_step)
property_name=property_name,
property_type=property_type,
time_step=time_step)
return self.__nnc_properties_stub.GetNNCValues(request)
@add_method(Case)
def __nnc_values_generator_to_list(self, generator):
"""Converts a NNC values generator to a list."""
@ -1041,10 +1158,11 @@ def __nnc_values_generator_to_list(self, generator):
vals.append(value)
return vals
@add_method(Case)
def nnc_connections_static_values_async(self, property_name):
"""Get the static NNC values. Async, so returns an iterator.
Returns:
An iterator to a chunk object containing an list of doubles.
Loop through the chunks and then the values within the chunk to get values
@ -1054,10 +1172,11 @@ def nnc_connections_static_values_async(self, property_name):
"""
return self.__nnc_connections_values_async(property_name, NNCProperties_pb2.NNC_STATIC, 0)
@add_method(Case)
def nnc_connections_static_values(self, property_name):
"""Get the static NNC values.
Returns:
A list of doubles. The order of the list matches the list from
nnc_connections, i.e. the nth object of nnc_connections() refers to nth
@ -1066,10 +1185,11 @@ def nnc_connections_static_values(self, property_name):
generator = self.nnc_connections_static_values_async(property_name)
return self.__nnc_values_generator_to_list(generator)
@add_method(Case)
def nnc_connections_dynamic_values_async(self, property_name, time_step):
"""Get the dynamic NNC values. Async, so returns an iterator.
Returns:
An iterator to a chunk object containing an list of doubles.
Loop through the chunks and then the values within the chunk to get values
@ -1079,10 +1199,11 @@ def nnc_connections_dynamic_values_async(self, property_name, time_step):
"""
return self.__nnc_connections_values_async(property_name, NNCProperties_pb2.NNC_DYNAMIC, time_step)
@add_method(Case)
def nnc_connections_dynamic_values(self, property_name, time_step):
"""Get the dynamic NNC values.
Returns:
A list of doubles. The order of the list matches the list from
nnc_connections, i.e. the nth object of nnc_connections() refers to nth
@ -1091,10 +1212,11 @@ def nnc_connections_dynamic_values(self, property_name, time_step):
generator = self.nnc_connections_dynamic_values_async(property_name, time_step)
return self.__nnc_values_generator_to_list(generator)
@add_method(Case)
def nnc_connections_generated_values_async(self, property_name, time_step):
"""Get the generated NNC values. Async, so returns an iterator.
Returns:
An iterator to a chunk object containing an list of doubles.
Loop through the chunks and then the values within the chunk to get values
@ -1104,10 +1226,11 @@ def nnc_connections_generated_values_async(self, property_name, time_step):
"""
return self.__nnc_connections_values_async(property_name, NNCProperties_pb2.NNC_GENERATED, time_step)
@add_method(Case)
def nnc_connections_generated_values(self, property_name, time_step):
"""Get the generated NNC values.
Returns:
A list of doubles. The order of the list matches the list from
nnc_connections, i.e. the nth object of nnc_connections() refers to nth
@ -1116,6 +1239,7 @@ def nnc_connections_generated_values(self, property_name, time_step):
generator = self.nnc_connections_generated_values_async(property_name, time_step)
return self.__nnc_values_generator_to_list(generator)
@add_method(Case)
def __generate_nnc_property_input_chunks(self, array, parameters):
index = -1
@ -1135,6 +1259,7 @@ def __generate_nnc_property_input_chunks(self, array, parameters):
chunk = NNCProperties_pb2.NNCValuesChunk()
yield chunk
@add_method(Case)
def set_nnc_connections_values(
self,

View File

@ -7,10 +7,11 @@ from rips.pdmobject import PdmObject, add_method
from rips.view import View
from rips.generated.pdm_objects import EclipseContourMap, GeoMechContourMap
@add_method(EclipseContourMap)
def export_to_text(self, export_file_name='', export_local_coordinates=False, undefined_value_label="NaN", exclude_undefined_values=False):
""" Export snapshot for the current view
Arguments:
export_file_name(str): The file location to store results in.
export_local_coordinates(bool): Should we export local coordinates, or UTM.
@ -25,10 +26,11 @@ def export_to_text(self, export_file_name='', export_local_coordinates=False, un
excludeUndefinedValues=exclude_undefined_values,
viewId=self.id))
@add_method(GeoMechContourMap)
def export_to_text(self, export_file_name='', export_local_coordinates=False, undefined_value_label="NaN", exclude_undefined_values=False):
""" Export snapshot for the current view
Arguments:
export_file_name(str): The file location to store results in.
export_local_coordinates(bool): Should we export local coordinates, or UTM.
@ -42,4 +44,3 @@ def export_to_text(self, export_file_name='', export_local_coordinates=False, un
undefinedValueLabel=undefined_value_label,
excludeUndefinedValues=exclude_undefined_values,
viewId=self.id))

View File

@ -11,10 +11,11 @@ import rips.generated.Grid_pb2_grpc as Grid_pb2_grpc
class Grid:
"""Grid Information. Not meant to be constructed separately
Create Grid objects using methods on Case: Grid() and Grids()
"""Grid Information. Created by methods in Case
:meth:`rips.case.grid()`
:meth:`rips.case.grids()`
"""
def __init__(self, index, case, channel):
self.__channel = channel
self.__stub = Grid_pb2_grpc.GridStub(self.__channel)
@ -33,7 +34,6 @@ class Grid:
Grid_pb2.GridRequest(case_request=case_request,
grid_index=self.index)).dimensions
def cell_centers_async(self):
"""The cells center for all cells in given grid async.

View File

@ -9,12 +9,13 @@ from rips.case import Case
import rips.generated.Commands_pb2 as Cmd
from rips.generated.pdm_objects import GridCaseGroup
@add_method(GridCaseGroup)
def create_statistics_case(self):
"""Create a Statistics case in the Grid Case Group
Returns:
A new Case
:class:`rips.generated.pdm_objects.EclipseCase`
"""
command_reply = self._execute_command(
createStatisticsCase=Cmd.CreateStatisticsCaseRequest(
@ -22,28 +23,42 @@ def create_statistics_case(self):
return Case(self.channel,
command_reply.createStatisticsCaseResult.caseId)
@add_method(GridCaseGroup)
def statistics_cases(self):
"""Get a list of all statistics cases in the Grid Case Group"""
"""Get a list of all statistics cases in the Grid Case Group
Returns:
List of :class:`rips.generated.pdm_objects.EclipseCase`
"""
stat_case_collection = self.children("StatisticsCaseCollection")[0]
return stat_case_collection.children("Reservoirs")
@add_method(GridCaseGroup)
def views(self):
"""Get a list of views belonging to a grid case group"""
"""Get a list of views belonging to a grid case group
Returns:
List of :class:`rips.generated.pdm_objects.EclipseView`
"""
pdm_objects = self.descendants(EclipseView)
view_list = []
for pdm_object in pdm_objects:
view_list.append(pdm_object)
return view_list
@add_method(GridCaseGroup)
def view(self, view_id):
"""Get a particular view belonging to a case group by providing view id
Arguments:
id(int): view id
Returns: a view object
Returns:
List of :class:`rips.generated.pdm_objects.EclipseView`
"""
views = self.views()
@ -52,13 +67,13 @@ def view(self, view_id):
return view_object
return None
@add_method(GridCaseGroup)
def compute_statistics(self, case_ids=None):
""" Compute statistics for the given case ids
Arguments:
case_ids(list of integers): list of case ids.
If this is None all cases in group are included
case_ids(list of integers): List of case ids. If this is None all cases in group are included
"""
if case_ids is None:

View File

@ -46,7 +46,7 @@ class Instance:
options=[
('grpc.enable_http_proxy',
False)
])
])
app = App_pb2_grpc.AppStub(channel)
try:
app.GetVersion(Empty(), timeout=1)
@ -91,7 +91,7 @@ class Instance:
return None
print("Trying port " + str(port))
while Instance.__is_port_in_use(port):
while Instance.__is_port_in_use(port):
port += 1
print("Trying port " + str(port))
@ -266,7 +266,7 @@ class Instance:
Set the plot window size in pixels
**Parameters**::
Parameter | Description | Type
--------- | ---------------- | -----
width | Width in pixels | Integer

View File

@ -17,29 +17,34 @@ import rips.generated.Commands_pb2 as Cmd
import rips.generated.Commands_pb2_grpc as CmdRpc
from rips.generated.pdm_objects import PdmObject, class_from_keyword
def camel_to_snake(name):
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
def snake_to_camel(name):
return ''.join(word.title() for word in name.split('_'))
def add_method(cls):
def decorator(func):
setattr(cls, func.__name__, func)
return func # returning func means func can still be used normally
return func # returning func means func can still be used normally
return decorator
def add_static_method(cls):
def decorator(func):
@wraps(func)
def wrapper(*args, **kwargs):
@wraps(func)
def wrapper(*args, **kwargs):
return func(*args, **kwargs)
setattr(cls, func.__name__, wrapper)
# Note we are not binding func, but wrapper which accepts self but does exactly the same as func
return func # returning func means func can still be used normally
return func # returning func means func can still be used normally
return decorator
@add_method(PdmObject)
def _execute_command(self, **command_params):
self.__warnings = []
@ -51,13 +56,14 @@ def _execute_command(self, **command_params):
return response
@add_method(PdmObject)
def __custom_init__(self, pb2_object, channel):
self.__warnings = []
self.__chunk_size = 8160
self._channel = channel
# Create stubs
if self._channel:
self._pdm_object_stub = PdmObject_pb2_grpc.PdmObjectServiceStub(self._channel)
@ -66,7 +72,7 @@ def __custom_init__(self, pb2_object, channel):
if pb2_object is not None:
# Copy parameters from ResInsight
assert(not isinstance(pb2_object, PdmObject))
self._pb2_object = pb2_object
self._pb2_object = pb2_object
for camel_keyword in self._pb2_object.parameters:
snake_keyword = camel_to_snake(camel_keyword)
setattr(self, snake_keyword, self.__get_grpc_value(camel_keyword))
@ -75,6 +81,7 @@ def __custom_init__(self, pb2_object, channel):
self._pb2_object = PdmObject_pb2.PdmObject(class_keyword=self.__class__.__name__)
self.__copy_to_pb2()
@add_method(PdmObject)
def copy_from(self, object):
"""Copy attribute values from object to self
@ -84,19 +91,22 @@ def copy_from(self, object):
value = getattr(object, attribute)
# This is crucial to avoid overwriting methods
if not callable(value):
setattr(self, attribute, value)
setattr(self, attribute, value)
if self.__custom_init__ is not None:
self.__custom_init__(self._pb2_object, self._channel)
self.update()
@add_method(PdmObject)
def warnings(self):
return self.__warnings
@add_method(PdmObject)
@add_method(PdmObject)
def has_warnings(self):
return len(self.__warnings) > 0
@add_method(PdmObject)
def __copy_to_pb2(self):
if self._pb2_object is not None:
@ -108,16 +118,19 @@ def __copy_to_pb2(self):
camel_kw = snake_to_camel(snake_kw)
self.__set_grpc_value(camel_kw, value)
@add_method(PdmObject)
def pb2_object(self):
""" Private method"""
return self._pb2_object
@add_method(PdmObject)
def channel(self):
""" Private method"""
return self._channel
@add_method(PdmObject)
def address(self):
"""Get the unique address of the PdmObject
@ -128,15 +141,18 @@ def address(self):
return self._pb2_object.address
@add_method(PdmObject)
def set_visible(self, visible):
"""Set the visibility of the object in the ResInsight project tree"""
self._pb2_object.visible = visible
@add_method(PdmObject)
def visible(self):
"""Get the visibility of the object in the ResInsight project tree"""
return self._pb2_object.visible
return self._pb2_object.visible
@add_method(PdmObject)
def print_object_info(self):
@ -147,11 +163,12 @@ def print_object_info(self):
if not snake_kw.startswith("_") and not callable(getattr(self, snake_kw)):
camel_kw = snake_to_camel(snake_kw)
print(" " + snake_kw + " [" + type(getattr(self, snake_kw)).__name__ +
"]: " + str(getattr(self, snake_kw)))
"]: " + str(getattr(self, snake_kw)))
print("Object Methods:")
for snake_kw in dir(self):
if not snake_kw.startswith("_") and callable(getattr(self, snake_kw)):
print (" " + snake_kw)
print(" " + snake_kw)
@add_method(PdmObject)
def __convert_from_grpc_value(self, value):
@ -173,6 +190,7 @@ def __convert_from_grpc_value(self, value):
return self.__makelist(value)
return value
@add_method(PdmObject)
def __convert_to_grpc_value(self, value):
if isinstance(value, bool):
@ -188,14 +206,17 @@ def __convert_to_grpc_value(self, value):
return "[" + ", ".join(list_of_strings) + "]"
return str(value)
@add_method(PdmObject)
def __get_grpc_value(self, camel_keyword):
return self.__convert_from_grpc_value(self._pb2_object.parameters[camel_keyword])
@add_method(PdmObject)
def __set_grpc_value(self, camel_keyword, value):
self._pb2_object.parameters[camel_keyword] = self.__convert_to_grpc_value(value)
@add_method(PdmObject)
def set_value(self, snake_keyword, value):
"""Set the value associated with the provided keyword and updates ResInsight
@ -208,10 +229,12 @@ def set_value(self, snake_keyword, value):
setattr(self, snake_keyword, value)
self.update()
@add_method(PdmObject)
def __islist(self, value):
return value.startswith("[") and value.endswith("]")
@add_method(PdmObject)
def __makelist(self, list_string):
list_string = list_string.lstrip("[")
@ -222,6 +245,7 @@ def __makelist(self, list_string):
values.append(self.__convert_from_grpc_value(string))
return values
@add_method(PdmObject)
def __from_pb2_to_pdm_objects(self, pb2_object_list, super_class_definition):
pdm_object_list = []
@ -231,9 +255,10 @@ def __from_pb2_to_pdm_objects(self, pb2_object_list, super_class_definition):
child_class_definition = super_class_definition
pdm_object = child_class_definition(pb2_object=pb2_object, channel=self.channel())
pdm_object_list.append(pdm_object)
pdm_object_list.append(pdm_object)
return pdm_object_list
@add_method(PdmObject)
def descendants(self, class_definition):
"""Get a list of all project tree descendants matching the class keyword
@ -254,8 +279,9 @@ def descendants(self, class_definition):
return self.__from_pb2_to_pdm_objects(object_list, class_definition)
except grpc.RpcError as e:
if e.code() == grpc.StatusCode.NOT_FOUND:
return [] # Valid empty result
raise e
return [] # Valid empty result
raise e
@add_method(PdmObject)
def children(self, child_field, class_definition=PdmObject):
@ -275,6 +301,7 @@ def children(self, child_field, class_definition=PdmObject):
return []
raise e
@add_method(PdmObject)
def ancestor(self, class_definition):
"""Find the first ancestor that matches the provided class_keyword
@ -301,12 +328,14 @@ def ancestor(self, class_definition):
return None
raise e
@add_method(PdmObject)
def _call_get_method_async(self, method_name):
request = PdmObject_pb2.PdmObjectGetterRequest(object=self._pb2_object, method=method_name)
for chunk in self._pdm_object_stub.CallPdmObjectGetter(request):
yield chunk
@add_method(PdmObject)
def _call_get_method(self, method_name):
all_values = []
@ -317,6 +346,7 @@ def _call_get_method(self, method_name):
all_values.append(value)
return all_values
@add_method(PdmObject)
def __generate_set_method_chunks(self, array, method_request):
index = -1
@ -324,22 +354,23 @@ def __generate_set_method_chunks(self, array, method_request):
while index < len(array):
chunk = PdmObject_pb2.PdmObjectSetterChunk()
if index is -1:
chunk.set_request.CopyFrom(PdmObject_pb2.PdmObjectSetterRequest(request=method_request, data_count=len(array)))
chunk.set_request.CopyFrom(PdmObject_pb2.PdmObjectSetterRequest(
request=method_request, data_count=len(array)))
index += 1
else:
actual_chunk_size = min(len(array) - index + 1, self.__chunk_size)
if isinstance(array[0], float):
chunk.CopyFrom(
PdmObject_pb2.PdmObjectSetterChunk(doubles=PdmObject_pb2.DoubleArray(data=array[index:index +
actual_chunk_size])))
actual_chunk_size])))
elif isinstance(array[0], int):
chunk.CopyFrom(
PdmObject_pb2.PdmObjectSetterChunk(ints=PdmObject_pb2.IntArray(data=array[index:index +
actual_chunk_size])))
actual_chunk_size])))
elif isinstance(array[0], str):
chunk.CopyFrom(
PdmObject_pb2.PdmObjectSetterChunk(strings=PdmObject_pb2.StringArray(data=array[index:index +
actual_chunk_size])))
actual_chunk_size])))
else:
raise Exception("Wrong data type for set method")
index += actual_chunk_size
@ -348,20 +379,24 @@ def __generate_set_method_chunks(self, array, method_request):
chunk = PdmObject_pb2.PdmObjectSetterChunk()
yield chunk
@add_method(PdmObject)
def _call_set_method(self, method_name, values):
method_request = PdmObject_pb2.PdmObjectGetterRequest(object=self._pb2_object, method=method_name)
method_request = PdmObject_pb2.PdmObjectGetterRequest(
object=self._pb2_object, method=method_name)
request_iterator = self.__generate_set_method_chunks(values, method_request)
reply = self._pdm_object_stub.CallPdmObjectSetter(request_iterator)
if reply.accepted_value_count < len(values):
raise IndexError
@add_method(PdmObject)
def _call_pdm_method(self, method_name, **kwargs):
pb2_params = PdmObject_pb2.PdmObject(class_keyword=method_name)
for key, value in kwargs.items():
pb2_params.parameters[snake_to_camel(key)] = self.__convert_to_grpc_value(value)
request = PdmObject_pb2.PdmObjectMethodRequest(object=self._pb2_object, method=method_name, params=pb2_params)
request = PdmObject_pb2.PdmObjectMethodRequest(
object=self._pb2_object, method=method_name, params=pb2_params)
pb2_object = self._pdm_object_stub.CallPdmObjectMethod(request)
@ -372,6 +407,7 @@ def _call_pdm_method(self, method_name, **kwargs):
pdm_object = child_class_definition(pb2_object=pb2_object, channel=self.channel())
return pdm_object
@add_method(PdmObject)
def update(self):
"""Sync all fields from the Python Object to ResInsight"""

View File

@ -7,21 +7,20 @@ from rips.pdmobject import PdmObject
from rips.generated.pdm_objects import PlotWindow, Plot
from rips.pdmobject import add_method
@add_method(PlotWindow)
def export_snapshot(self, export_folder='', file_prefix='', output_format='PNG'):
""" Export snapshot for the current plot
Arguments:
export_folder(str): The path to export to. By default will use the global export folder
prefix (str): Exported file name prefix
output_format(str): Enum string. Can be 'PNG' or 'PDF'.
"""
return self._execute_command(
exportSnapshots=Cmd.ExportSnapshotsRequest(type='PLOTS',
prefix=file_prefix,
viewId=self.id,
exportFolder=export_folder,
plotOutputFormat=output_format))
prefix=file_prefix,
viewId=self.id,
exportFolder=export_folder,
plotOutputFormat=output_format))

View File

@ -24,12 +24,14 @@ from rips.generated.pdm_objects import Project, PlotWindow, WellPath
def __custom_init__(self, pb2_object, channel):
self._project_stub = Project_pb2_grpc.ProjectStub(self._channel)
@add_static_method(Project)
def create(channel):
project_stub = Project_pb2_grpc.ProjectStub(channel)
pb2_object = project_stub.GetPdmObject(Empty())
return Project(pb2_object, channel)
@add_method(Project)
def open(self, path):
"""Open a new project from the given path
@ -40,21 +42,25 @@ def open(self, path):
"""
self._execute_command(openProject=Cmd.FilePathRequest(path=path))
return self
@add_method(Project)
def save(self, path=""):
"""Save the project to the existing project file, or to a new file
Arguments:
path(str): File path to the file to save the project to. If empty, saves to the active project file
"""
self._execute_command(saveProject=Cmd.SaveProjectRequest(filePath=path))
return self
@add_method(Project)
def close(self):
"""Close the current project (and open new blank project)"""
self._execute_command(closeProject=Empty())
@add_method(Project)
def load_case(self, path):
"""Load a new case from the given file path
@ -62,18 +68,19 @@ def load_case(self, path):
Arguments:
path(str): file path to case
Returns:
A rips Case object
:class:`rips.generated.pdm_objects.Case`
"""
command_reply = self._execute_command(loadCase=Cmd.FilePathRequest(
path=path))
return self.case(command_reply.loadCaseResult.id)
@add_method(Project)
def selected_cases(self):
"""Get a list of all cases selected in the project tree
Returns:
A list of rips Case objects
A list of :class:`rips.generated.pdm_objects.Case`
"""
case_infos = self._project_stub.GetSelectedCases(Empty())
cases = []
@ -81,15 +88,17 @@ def selected_cases(self):
cases.append(self.case(case_info.id))
return cases
@add_method(Project)
def cases(self):
"""Get a list of all cases in the project
Returns:
A list of rips Case objects
A list of :class:`rips.generated.pdm_objects.Case`
"""
return self.descendants(Case)
@add_method(Project)
def case(self, case_id):
"""Get a specific case from the provided case Id
@ -97,7 +106,7 @@ def case(self, case_id):
Arguments:
id(int): case id
Returns:
A rips Case object
:class:`rips.generated.pdm_objects.Case`
"""
allCases = self.cases()
for case in allCases:
@ -105,10 +114,11 @@ def case(self, case_id):
return case
return None
@add_method(Project)
def replace_source_cases(self, grid_list_file, case_group_id=0):
"""Replace all source cases within a case group
Arguments:
grid_list_file (str): path to file containing a list of cases
case_group_id (int): id of the case group to replace
@ -117,14 +127,15 @@ def replace_source_cases(self, grid_list_file, case_group_id=0):
replaceSourceCases=Cmd.ReplaceSourceCasesRequest(
gridListFile=grid_list_file, caseGroupId=case_group_id))
@add_method(Project)
def create_grid_case_group(self, case_paths):
"""Create a Grid Case Group from a list of cases
Arguments:
case_paths (list): list of file path strings
Returns:
A case group id and name
:class:`rips.generated.pdm_objects.GridCaseGroup`
"""
command_reply = self._execute_command(
createGridCaseGroup=Cmd.CreateGridCaseGroupRequest(
@ -132,18 +143,21 @@ def create_grid_case_group(self, case_paths):
return self.grid_case_group(
command_reply.createGridCaseGroupResult.groupId)
@add_method(Project)
def views(self):
"""Get a list of views belonging to a project"""
return self.descendants(View)
@add_method(Project)
def view(self, view_id):
"""Get a particular view belonging to a case by providing view id
Arguments:
view_id(int): view id
Returns: a view object
Returns:
:class:`rips.generated.pdm_objects.View`
"""
views = self.views()
for view_object in views:
@ -151,9 +165,14 @@ def view(self, view_id):
return view_object
return None
@add_method(Project)
def plots(self):
"""Get a list of all plots belonging to a project"""
"""Get a list of all plots belonging to a project
Returns:
List of :class:`rips.generated.pdm_objects.Plot`
"""
pdm_objects = self.descendants(PlotWindow)
plot_list = []
for pdm_object in pdm_objects:
@ -161,12 +180,16 @@ def plots(self):
plot_list.append(pdm_object)
return plot_list
@add_method(Project)
def plot(self, view_id):
"""Get a particular plot by providing view id
Arguments:
view_id(int): view id
Returns: a plot object
Returns:
:class:`rips.generated.pdm_objects.Plot`
"""
plots = self.plots()
for plot_object in plots:
@ -174,20 +197,28 @@ def plot(self, view_id):
return plot_object
return None
@add_method(Project)
def grid_case_groups(self):
"""Get a list of all grid case groups in the project"""
"""Get a list of all grid case groups in the project
Returns:
List of :class:`rips.generated.pdm_objects.GridCaseGroup`
"""
case_groups = self.descendants(GridCaseGroup)
return case_groups
@add_method(Project)
def grid_case_group(self, group_id):
"""Get a particular grid case group belonging to a project
Arguments:
groupId(int): group id
Returns: a grid case group object
Returns:
:class:`rips.generated.pdm_objects.GridCaseGroup`
"""
case_groups = self.grid_case_groups()
for case_group in case_groups:
@ -195,10 +226,11 @@ def grid_case_group(self, group_id):
return case_group
return None
@add_method(Project)
def export_multi_case_snapshots(self, grid_list_file):
"""Export snapshots for a set of cases
Arguments:
grid_list_file (str): Path to a file containing a list of grids to export snapshot for
"""
@ -206,10 +238,11 @@ def export_multi_case_snapshots(self, grid_list_file):
exportMultiCaseSnapshot=Cmd.ExportMultiCaseRequest(
gridListFile=grid_list_file))
@add_method(Project)
def export_snapshots(self, snapshot_type='ALL', prefix='', plot_format='PNG'):
""" Export all snapshots of a given type
Arguments:
snapshot_type (str): Enum string ('ALL', 'VIEWS' or 'PLOTS')
prefix (str): Exported file name prefix
@ -219,10 +252,11 @@ def export_snapshots(self, snapshot_type='ALL', prefix='', plot_format='PNG'):
exportSnapshots=Cmd.ExportSnapshotsRequest(
type=snapshot_type, prefix=prefix, caseId=-1, viewId=-1, plotOutputFormat=plot_format))
@add_method(Project)
def export_well_paths(self, well_paths=None, md_step_size=5.0):
""" Export a set of well paths
Arguments:
well_paths(list): List of strings of well paths. If none, export all.
md_step_size(double): resolution of the exported well path
@ -234,11 +268,12 @@ def export_well_paths(self, well_paths=None, md_step_size=5.0):
return self._execute_command(exportWellPaths=Cmd.ExportWellPathRequest(
wellPathNames=well_paths, mdStepSize=md_step_size))
@add_method(Project)
def scale_fracture_template(self, template_id, half_length, height,
d_factor, conductivity):
""" Scale fracture template parameters
Arguments:
template_id(int): ID of fracture template
half_length (double): Half Length scale factor
@ -254,10 +289,11 @@ def scale_fracture_template(self, template_id, half_length, height,
dFactor=d_factor,
conductivity=conductivity))
@add_method(Project)
def set_fracture_containment(self, template_id, top_layer, base_layer):
""" Set fracture template containment parameters
Arguments:
template_id(int): ID of fracture template
top_layer (int): Top layer containment
@ -267,6 +303,7 @@ def set_fracture_containment(self, template_id, top_layer, base_layer):
setFractureContainment=Cmd.SetFracContainmentRequest(
id=template_id, topLayer=top_layer, baseLayer=base_layer))
@add_method(Project)
def import_well_paths(self, well_path_files=None, well_path_folder=''):
""" Import well paths into project
@ -276,33 +313,35 @@ def import_well_paths(self, well_path_files=None, well_path_folder=''):
well_path_folder(str): A folder path containing files to import
Returns:
A list of WellPath objects
List of :class:`rips.generated.pdm_objects.WellPath`
"""
if well_path_files is None:
well_path_files = []
res = self._execute_command(importWellPaths=Cmd.ImportWellPathsRequest(wellPathFolder=well_path_folder,
wellPathFiles=well_path_files))
wellPathFiles=well_path_files))
well_paths = []
for well_path_name in res.importWellPathsResult.wellPathNames:
well_paths.append(self.well_path_by_name(well_path_name))
return well_paths
@add_method(Project)
def well_paths(self):
"""Get a list of all well paths in the project
Returns:
A list of rips WellPath objects
List of :class:`rips.generated.pdm_objects.WellPath`
"""
return self.descendants(WellPath)
@add_method(Project)
def well_path_by_name(self, well_path_name):
"""Get a specific well path by name from the project
Returns:
A WellPath object
:class:`rips.generated.pdm_objects.WellPath`
"""
all_well_paths = self.well_paths()
for well_path in all_well_paths:
@ -310,6 +349,7 @@ def well_path_by_name(self, well_path_name):
return well_path
return None
@add_method(Project)
def import_well_log_files(self, well_log_files=None, well_log_folder=''):
""" Import well log files into project
@ -325,9 +365,10 @@ def import_well_log_files(self, well_log_files=None, well_log_folder=''):
if well_log_files is None:
well_log_files = []
res = self._execute_command(importWellLogFiles=Cmd.ImportWellLogFilesRequest(wellLogFolder=well_log_folder,
wellLogFiles=well_log_files))
wellLogFiles=well_log_files))
return res.importWellLogFilesResult.wellPathNames
@add_method(Project)
def import_formation_names(self, formation_files=None):
""" Import formation names into project
@ -342,5 +383,5 @@ def import_formation_names(self, formation_files=None):
formation_files = [formation_files]
self._execute_command(importFormationNames=Cmd.ImportFormationNamesRequest(formationFiles=formation_files,
applyToCaseId=-1))
applyToCaseId=-1))

View File

@ -15,24 +15,60 @@ from rips.generated.pdm_objects import SimulationWell
from rips.pdmobject import PdmObject, add_method
import rips.case
@add_method(SimulationWell)
def __custom_init__(self, pb2_object, channel):
self._simulation_well_stub = SimulationWell_pb2_grpc.SimulationWellStub(channel)
@add_method(SimulationWell)
def status(self, timestep):
"""Get simulation well status
**SimulationWellStatus class description**::
Parameter | Description | Type
----------- | ------------------------------------------------------------- | -----
well_type | Well type as string | string
is_open | True if simulation well is open at the specified time step | bool
Arguments:
timestep(int): Time step index
"""
sim_well_request = SimulationWell_pb2.SimulationWellRequest(case_id=self.case().id,
well_name=self.name,
timestep=timestep)
return self._simulation_well_stub.GetSimulationWellStatus(sim_well_request)
@add_method(SimulationWell)
def cells(self, timestep):
"""Get reservoir cells the simulation well is defined for
**SimulationWellCellInfo class description**::
Parameter | Description | Type
----------- | --------------------------------------------------------- | -----
ijk | Cell IJK location | Vec3i
grid_index | Grid index | int
is_open | True if connection to is open at the specified time step | bool
branch_id | | int
segment_id | | int
Arguments:
timestep(int): Time step index
Returns:
List of SimulationWellCellInfo
"""
sim_well_request = SimulationWell_pb2.SimulationWellRequest(case_id=self.case().id,
well_name=self.name,
timestep=timestep)
return self._simulation_well_stub.GetSimulationWellCells(sim_well_request).data
@add_method(SimulationWell)
def case(self):
return self.ancestor(rips.case.Case)

View File

@ -8,19 +8,25 @@ import rips
_rips_instance = None
@pytest.fixture
def rips_instance():
return _rips_instance
@pytest.fixture
def initialize_test():
_rips_instance.project.close() # make sure ResInsight is clean before execution of test
_rips_instance.project.close() # make sure ResInsight is clean before execution of test
yield initialize_test
_rips_instance.project.close() # make sure ResInsight is clean after test
_rips_instance.project.close() # make sure ResInsight is clean after test
def pytest_addoption(parser):
parser.addoption("--console", action="store_true", default=False, help="Run as console application")
parser.addoption("--existing", action="store_true", default=False, help="Look for existing ResInsight")
parser.addoption("--console", action="store_true", default=False,
help="Run as console application")
parser.addoption("--existing", action="store_true", default=False,
help="Look for existing ResInsight")
def pytest_configure(config):
global _rips_instance
@ -36,6 +42,7 @@ def pytest_configure(config):
print("Need a valid ResInsight executable to launch tests")
exit(0)
def pytest_unconfigure(config):
if not config.getoption('--existing'):
_rips_instance.exit()

View File

@ -1,7 +1,7 @@
import sys
import os
import math
import pytest
import pytest
import grpc
import tempfile
@ -10,22 +10,28 @@ import rips
import dataroot
def test_Launch(rips_instance, initialize_test):
assert(rips_instance is not None)
def test_EmptyProject(rips_instance, initialize_test):
cases = rips_instance.project.cases()
assert(len(cases) is 0)
def test_OneCase(rips_instance, initialize_test):
case = rips_instance.project.load_case(dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID")
case = rips_instance.project.load_case(
dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID")
assert(case.name == "TEST10K_FLT_LGR_NNC")
assert(case.id == 0)
cases = rips_instance.project.cases()
assert(len(cases) is 1)
def test_BoundingBox(rips_instance, initialize_test):
case = rips_instance.project.load_case(dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID")
case = rips_instance.project.load_case(
dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID")
assert(case.name == "TEST10K_FLT_LGR_NNC")
boundingbox = case.reservoir_boundingbox()
assert(math.isclose(3382.90, boundingbox.min_x, abs_tol=1.0e-1))
@ -39,12 +45,13 @@ def test_BoundingBox(rips_instance, initialize_test):
assert(math.isclose(4103.60, min_depth, abs_tol=1.0e-1))
assert(math.isclose(4252.61, max_depth, abs_tol=1.0e-1))
def test_MultipleCases(rips_instance, initialize_test):
case_paths = []
case_paths.append(dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID")
case_paths.append(dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID")
case_paths.append(dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID")
case_names = []
for case_path in case_paths:
case_name = os.path.splitext(os.path.basename(case_path))[0]
@ -56,17 +63,20 @@ def test_MultipleCases(rips_instance, initialize_test):
for i, case_name in enumerate(case_names):
assert(case_name == cases[i].name)
def get_cell_index_with_ijk(cell_info, i, j, k):
for (idx, cell) in enumerate(cell_info):
if cell.local_ijk.i == i and cell.local_ijk.j == j and cell.local_ijk.k == k:
return idx
return -1
def check_corner(actual, expected):
assert(math.isclose(actual.x, expected[0], abs_tol=0.1))
assert(math.isclose(actual.y, expected[1], abs_tol=0.1))
assert(math.isclose(actual.z, expected[2], abs_tol=0.1))
def test_10k(rips_instance, initialize_test):
case_path = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID"
case = rips_instance.project.load_case(path=case_path)
@ -96,14 +106,14 @@ def test_10k(rips_instance, initialize_test):
cell_corners = case.active_cell_corners()
assert(len(cell_corners) == cell_count_info.active_cell_count)
# Expected values from ResInsight UI
expected_corners = [[ 3565.22, 5179.02, 4177.18],
[ 3655.67, 5145.34, 4176.63],
[ 3690.07, 5240.69, 4180.02],
[ 3599.87, 5275.16, 4179.32],
[ 3564.13, 5178.61, 4179.75],
[ 3654.78, 5144.79, 4179.23],
[ 3688.99, 5239.88, 4182.7],
[ 3598.62, 5274.48, 4181.96]]
expected_corners = [[3565.22, 5179.02, 4177.18],
[3655.67, 5145.34, 4176.63],
[3690.07, 5240.69, 4180.02],
[3599.87, 5275.16, 4179.32],
[3564.13, 5178.61, 4179.75],
[3654.78, 5144.79, 4179.23],
[3688.99, 5239.88, 4182.7],
[3598.62, 5274.48, 4181.96]]
check_corner(cell_corners[cell_index].c0, expected_corners[0])
check_corner(cell_corners[cell_index].c1, expected_corners[1])
check_corner(cell_corners[cell_index].c2, expected_corners[2])
@ -117,6 +127,7 @@ def test_10k(rips_instance, initialize_test):
coarsening_info = case.coarsening_info()
assert(len(coarsening_info) == 0)
def test_PdmObject(rips_instance, initialize_test):
case_path = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID"
case = rips_instance.project.load_case(path=case_path)
@ -124,6 +135,7 @@ def test_PdmObject(rips_instance, initialize_test):
assert(case.address() is not 0)
assert(case.__class__.__name__ == "EclipseCase")
@pytest.mark.skipif(sys.platform.startswith('linux'), reason="Brugge is currently exceptionally slow on Linux")
def test_brugge_0010(rips_instance, initialize_test):
case_path = dataroot.PATH + "/Case_with_10_timesteps/Real10/BRUGGE_0010.EGRID"
@ -137,6 +149,7 @@ def test_brugge_0010(rips_instance, initialize_test):
days_since_start = case.days_since_start()
assert(len(days_since_start) == 11)
@pytest.mark.skipif(sys.platform.startswith('linux'), reason="Brugge is currently exceptionally slow on Linux")
def test_replaceCase(rips_instance, initialize_test):
project = rips_instance.project.open(dataroot.PATH + "/TEST10K_FLT_LGR_NNC/10KWithWellLog.rsp")
@ -159,12 +172,14 @@ def test_replaceCase(rips_instance, initialize_test):
case = project.case(case_id=0)
assert(case.name == "Real0--BRUGGE_0000.EGRID")
assert(case.id == 0)
def test_loadNonExistingCase(rips_instance, initialize_test):
case_path = "Nonsense/Nonsense/Nonsense"
with pytest.raises(grpc.RpcError):
assert rips_instance.project.load_case(case_path)
@pytest.mark.skipif(sys.platform.startswith('linux'), reason="Brugge is currently exceptionally slow on Linux")
def test_exportFlowCharacteristics(rips_instance, initialize_test):
case_path = dataroot.PATH + "/Case_with_10_timesteps/Real0/BRUGGE_0000.EGRID"
@ -172,10 +187,13 @@ def test_exportFlowCharacteristics(rips_instance, initialize_test):
with tempfile.TemporaryDirectory(prefix="rips") as tmpdirname:
print("Temporary folder: ", tmpdirname)
file_name = tmpdirname + "/exportFlowChar.txt"
case.export_flow_characteristics(time_steps=8, producers=[], injectors = "I01", file_name = file_name)
case.export_flow_characteristics(time_steps=8, producers=[],
injectors="I01", file_name=file_name)
def test_selected_cells(rips_instance, initialize_test):
case = rips_instance.project.load_case(dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID")
case = rips_instance.project.load_case(
dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID")
assert(case.name == "TEST10K_FLT_LGR_NNC")
selected_cells = case.selected_cells()
assert(len(selected_cells) == 0)

View File

@ -8,4 +8,3 @@ sys.path.insert(1, os.path.join(sys.path[0], '../../'))
import rips
import dataroot

View File

@ -7,11 +7,13 @@ import rips
import dataroot
def check_corner(actual, expected):
assert(math.isclose(actual.x, expected[0], abs_tol=0.1))
assert(math.isclose(actual.y, expected[1], abs_tol=0.1))
assert(math.isclose(actual.z, expected[2], abs_tol=0.1))
def test_10k(rips_instance, initialize_test):
casePath = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID"
case = rips_instance.project.load_case(path=casePath)
@ -35,14 +37,14 @@ def test_10k(rips_instance, initialize_test):
assert(len(cell_corners) == (dimensions.i * dimensions.j * dimensions.k))
# Expected values from ResInsight UI
expected_corners = [[ 3565.22, 5179.02, 4177.18],
[ 3655.67, 5145.34, 4176.63],
[ 3690.07, 5240.69, 4180.02],
[ 3599.87, 5275.16, 4179.32],
[ 3564.13, 5178.61, 4179.75],
[ 3654.78, 5144.79, 4179.23],
[ 3688.99, 5239.88, 4182.7],
[ 3598.62, 5274.48, 4181.96]]
expected_corners = [[3565.22, 5179.02, 4177.18],
[3655.67, 5145.34, 4176.63],
[3690.07, 5240.69, 4180.02],
[3599.87, 5275.16, 4179.32],
[3564.13, 5178.61, 4179.75],
[3654.78, 5144.79, 4179.23],
[3688.99, 5239.88, 4182.7],
[3598.62, 5274.48, 4181.96]]
check_corner(cell_corners[cell_index].c0, expected_corners[0])
check_corner(cell_corners[cell_index].c1, expected_corners[1])
check_corner(cell_corners[cell_index].c2, expected_corners[2])

View File

@ -68,6 +68,7 @@ def test_10kSync(rips_instance, initialize_test):
for i in range(0, len(new_data)):
assert(new_data[i] == new_prop_vals[i])
def test_non_existing_dynamic_values(rips_instance, initialize_test):
casePath = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID"
case = rips_instance.project.load_case(path=casePath)
@ -75,6 +76,7 @@ def test_non_existing_dynamic_values(rips_instance, initialize_test):
with pytest.raises(grpc.RpcError):
case.nnc_connections_dynamic_values("x", 0)
def test_invalid_time_steps(rips_instance, initialize_test):
casePath = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID"
case = rips_instance.project.load_case(path=casePath)

View File

@ -9,6 +9,7 @@ import rips
import dataroot
def test_loadProject(rips_instance, initialize_test):
project = rips_instance.project.open(dataroot.PATH + "/TEST10K_FLT_LGR_NNC/10KWithWellLog.rsp")
case = project.cases()[0]
@ -18,6 +19,7 @@ def test_loadProject(rips_instance, initialize_test):
cases = rips_instance.project.cases()
assert(len(cases) is 1)
def test_well_log_plots(rips_instance, initialize_test):
project = rips_instance.project.open(dataroot.PATH + "/TEST10K_FLT_LGR_NNC/10KWithWellLog.rsp")
plots = project.plots()
@ -36,24 +38,26 @@ def test_well_log_plots(rips_instance, initialize_test):
well_log_plot.export_snapshot(tmpdirname)
well_log_plot.export_data_as_las(tmpdirname)
files = os.listdir(tmpdirname)
print (files)
print(files)
if rips_instance.is_gui():
assert(len(files) == 4)
else:
assert(len(files) == 2)
plots2 = project.plots()
for plot2 in plots2:
for plot2 in plots2:
if isinstance(plot2, rips.WellLogPlot):
assert(plot2.depth_type == "TRUE_VERTICAL_DEPTH_RKB")
@pytest.mark.skipif(sys.platform.startswith('linux'), reason="Brugge is currently exceptionally slow on Linux")
def test_loadGridCaseGroup(rips_instance, initialize_test):
case_paths = []
case_paths.append(dataroot.PATH + "/Case_with_10_timesteps/Real0/BRUGGE_0000.EGRID")
case_paths.append(dataroot.PATH + "/Case_with_10_timesteps/Real10/BRUGGE_0010.EGRID")
grid_case_group = rips_instance.project.create_grid_case_group(case_paths=case_paths)
assert(grid_case_group is not None and grid_case_group.group_id == 0)
case_paths = []
case_paths.append(dataroot.PATH + "/Case_with_10_timesteps/Real0/BRUGGE_0000.EGRID")
case_paths.append(dataroot.PATH + "/Case_with_10_timesteps/Real10/BRUGGE_0010.EGRID")
grid_case_group = rips_instance.project.create_grid_case_group(case_paths=case_paths)
assert(grid_case_group is not None and grid_case_group.group_id == 0)
def test_exportSnapshots(rips_instance, initialize_test):
if not rips_instance.is_gui():

View File

@ -9,6 +9,7 @@ import rips
import dataroot
def test_10kAsync(rips_instance, initialize_test):
casePath = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID"
case = rips_instance.project.load_case(path=casePath)
@ -24,6 +25,7 @@ def test_10kAsync(rips_instance, initialize_test):
assert(average != pytest.approx(0.0158893, abs=0.0000001))
assert(average == pytest.approx(0.0558893, abs=0.0000001))
def test_10kSync(rips_instance, initialize_test):
casePath = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID"
case = rips_instance.project.load_case(path=casePath)
@ -35,6 +37,7 @@ def test_10kSync(rips_instance, initialize_test):
assert(average != pytest.approx(0.0158893, abs=0.0000001))
assert(average == pytest.approx(0.0558893, abs=0.0000001))
def test_10k_set(rips_instance, initialize_test):
casePath = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID"
case = rips_instance.project.load_case(path=casePath)
@ -42,6 +45,7 @@ def test_10k_set(rips_instance, initialize_test):
results = case.active_cell_property('DYNAMIC_NATIVE', 'SOIL', 1)
case.set_active_cell_property(results, 'GENERATED', 'SOIL', 1)
def test_10k_set_out_of_bounds(rips_instance, initialize_test):
casePath = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID"
case = rips_instance.project.load_case(path=casePath)
@ -51,6 +55,7 @@ def test_10k_set_out_of_bounds(rips_instance, initialize_test):
with pytest.raises(grpc.RpcError):
assert case.set_active_cell_property(results, 'GENERATED', 'SOIL', 1)
def test_10k_set_out_of_bounds_client(rips_instance, initialize_test):
casePath = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID"
case = rips_instance.project.load_case(path=casePath)
@ -61,6 +66,7 @@ def test_10k_set_out_of_bounds_client(rips_instance, initialize_test):
with pytest.raises(IndexError):
assert case.set_active_cell_property(results, 'GENERATED', 'SOIL', 1)
def createResult(poroChunks, permxChunks):
for (poroChunk, permxChunk) in zip(poroChunks, permxChunks):
resultChunk = []
@ -68,10 +74,12 @@ def createResult(poroChunks, permxChunks):
resultChunk.append(poro * permx)
yield resultChunk
def checkResults(poroValues, permxValues, poropermxValues):
for (poro, permx, poropermx) in zip(poroValues, permxValues, poropermxValues):
recalc = poro * permx
assert(recalc == pytest.approx(poropermx, rel=1.0e-10))
recalc = poro * permx
assert(recalc == pytest.approx(poropermx, rel=1.0e-10))
def test_10k_PoroPermX(rips_instance, initialize_test):
casePath = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID"
@ -80,7 +88,8 @@ def test_10k_PoroPermX(rips_instance, initialize_test):
poroChunks = case.active_cell_property_async('STATIC_NATIVE', 'PORO', 0)
permxChunks = case.active_cell_property_async('STATIC_NATIVE', 'PERMX', 0)
case.set_active_cell_property_async(createResult(poroChunks, permxChunks), 'GENERATED', 'POROPERMXAS', 0)
case.set_active_cell_property_async(createResult(
poroChunks, permxChunks), 'GENERATED', 'POROPERMXAS', 0)
poro = case.active_cell_property('STATIC_NATIVE', 'PORO', 0)
permx = case.active_cell_property('STATIC_NATIVE', 'PERMX', 0)
@ -88,6 +97,7 @@ def test_10k_PoroPermX(rips_instance, initialize_test):
checkResults(poro, permx, poroPermX)
def test_exportPropertyInView(rips_instance, initialize_test):
case_path = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID"
rips_instance.project.load_case(case_path)
@ -99,4 +109,4 @@ def test_exportPropertyInView(rips_instance, initialize_test):
view.export_property()
expected_file_name = case.name + "-" + str("3D_View") + "-" + "T0" + "-SOIL"
full_path = tmpdirname + "/" + expected_file_name
assert(os.path.exists(full_path))
assert(os.path.exists(full_path))

View File

@ -6,6 +6,7 @@ import rips
import dataroot
def test_10k(rips_instance, initialize_test):
case_path = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID"
case = rips_instance.project.load_case(path=case_path)
@ -28,7 +29,7 @@ def test_10k(rips_instance, initialize_test):
# On time step 3 all wells are producing
for sim_well in sim_wells:
status = sim_well.status(3)
status = sim_well.status(3)
assert(status.well_type == "Producer")
# On time step 0 all simulation wells have no cells
@ -45,5 +46,6 @@ def test_10k(rips_instance, initialize_test):
for (tidx, timestep) in enumerate(timesteps):
if (tidx > 0):
cells = sim_well.cells(tidx)
print("well: " + sim_well.name + " timestep: " + str(tidx) + " cells:" + str(len(cells)))
print("well: " + sim_well.name + " timestep: " +
str(tidx) + " cells:" + str(len(cells)))
assert(len(cells) == expected_cell_count[sim_well.name])

View File

@ -7,6 +7,7 @@ import rips
import dataroot
def test_summary_import_and_find(rips_instance, initialize_test):
casePath = dataroot.PATH + "/flow_diagnostics_test/SIMPLE_SUMMARY2.SMSPEC"
summary_case = rips_instance.project.import_summary_case(casePath)
@ -37,6 +38,7 @@ def test_summary_data(rips_instance, initialize_test):
summary_data = summary_case.summary_vector_values("FOPT")
assert(len(summary_data.values) == 60)
def test_summary_resample(rips_instance, initialize_test):
casePath = dataroot.PATH + "/flow_diagnostics_test/SIMPLE_SUMMARY2.SMSPEC"
summary_case = rips_instance.project.import_summary_case(casePath)

View File

@ -6,6 +6,7 @@ import rips
import dataroot
def test_10k(rips_instance, initialize_test):
case_root_path = dataroot.PATH + "/TEST10K_FLT_LGR_NNC"
case_path = case_root_path + "/TEST10K_FLT_LGR_NNC.EGRID"

View File

@ -9,6 +9,7 @@ import rips.case # Circular import of Case, which already imports View. Use ful
from rips.pdmobject import add_method
from rips.generated.pdm_objects import View, ViewWindow, EclipseView, GeoMechView
@add_method(View)
def apply_cell_result(self, result_type, result_variable):
"""Apply a regular cell result
@ -30,6 +31,7 @@ def apply_cell_result(self, result_type, result_variable):
cell_result.result_variable = result_variable
cell_result.update()
@add_method(View)
def apply_flow_diagnostics_cell_result(
self,
@ -71,6 +73,7 @@ def apply_flow_diagnostics_cell_result(
cell_result.selected_producer_tracers = producers
cell_result.update()
@add_method(View)
def clone(self):
"""Clone the current view"""
@ -78,6 +81,7 @@ def clone(self):
viewId=self.id)).createViewResult.viewId
return self.case().view(view_id)
@add_method(View)
def set_time_step(self, time_step):
"""Set the time step for current view"""
@ -85,10 +89,11 @@ def set_time_step(self, time_step):
return self._execute_command(setTimeStep=Cmd.SetTimeStepParams(
caseId=case_id, viewId=self.id, timeStep=time_step))
@add_method(View)
def export_sim_well_fracture_completions(self, time_step,
simulation_well_names, file_split,
compdat_export):
simulation_well_names, file_split,
compdat_export):
"""Export fracture completions for simulation wells
**Parameters**::
@ -129,12 +134,13 @@ def export_sim_well_fracture_completions(self, time_step,
fileSplit=file_split,
compdatExport=compdat_export))
@add_method(View)
def export_visible_cells(self,
export_keyword='FLUXNUM',
visible_active_cells_value=1,
hidden_active_cells_value=0,
inactive_cells_value=0):
export_keyword='FLUXNUM',
visible_active_cells_value=1,
hidden_active_cells_value=0,
inactive_cells_value=0):
"""Export special properties for all visible cells.
Arguments:
@ -154,6 +160,7 @@ def export_visible_cells(self,
hiddenActiveCellsValue=hidden_active_cells_value,
inactiveCellsValue=inactive_cells_value))
@add_method(View)
def export_property(self, undefined_value=0.0):
""" Export the current Eclipse property from the view
@ -168,6 +175,7 @@ def export_property(self, undefined_value=0.0):
viewIds=[self.id],
undefinedValue=undefined_value))
@add_method(ViewWindow)
def case(self):
"""Get the case the view belongs to"""
@ -175,10 +183,11 @@ def case(self):
assert(mycase is not None)
return mycase
@add_method(ViewWindow)
def export_snapshot(self, prefix='', export_folder=''):
""" Export snapshot for the current view
Arguments:
prefix (str): Exported file name prefix
export_folder(str): The path to export to. By default will use the global export folder
@ -186,7 +195,7 @@ def export_snapshot(self, prefix='', export_folder=''):
case_id = self.case().id
return self._execute_command(
exportSnapshots=Cmd.ExportSnapshotsRequest(type='VIEWS',
prefix=prefix,
caseId=case_id,
viewId=self.id,
exportFolder=export_folder))
prefix=prefix,
caseId=case_id,
viewId=self.id,
exportFolder=export_folder))

View File

@ -9,47 +9,49 @@ from rips.pdmobject import PdmObject
from rips.generated.pdm_objects import WellLogPlot
from rips.pdmobject import add_method
@add_method(WellLogPlot)
def export_data_as_las(self, export_folder, file_prefix='', export_tvdrkb=False, capitalize_file_names=False, resample_interval=0.0, convert_to_standard_units=False):
""" Export LAS file(s) for the current plot
Arguments:
export_folder(str): The path to export to. By default will use the global export folder
file_prefix (str): Exported file name prefix
export_tvdrkb(bool): Export in TVD-RKB format
capitalize_file_names(bool): Make all file names upper case
resample_interval(double): if > 0.0 the files will be resampled
Returns:
A list of files exported
"""
"""
res = self._execute_command(exportWellLogPlotData=Cmd.ExportWellLogPlotDataRequest(exportFormat='LAS',
viewId=self.id,
exportFolder=export_folder,
filePrefix=file_prefix,
exportTvdRkb=export_tvdrkb,
capitalizeFileNames=capitalize_file_names,
resampleInterval=resample_interval,
convertCurveUnits=convert_to_standard_units))
viewId=self.id,
exportFolder=export_folder,
filePrefix=file_prefix,
exportTvdRkb=export_tvdrkb,
capitalizeFileNames=capitalize_file_names,
resampleInterval=resample_interval,
convertCurveUnits=convert_to_standard_units))
return res.exportWellLogPlotDataResult.exportedFiles
@add_method(WellLogPlot)
def export_data_as_ascii(self, export_folder, file_prefix='', capitalize_file_names=False):
""" Export LAS file(s) for the current plot
Arguments:
export_folder(str): The path to export to. By default will use the global export folder
file_prefix (str): Exported file name prefix
capitalize_file_names(bool): Make all file names upper case
Returns:
A list of files exported
"""
res = self._execute_command(exportWellLogPlotData=Cmd.ExportWellLogPlotDataRequest(exportFormat='ASCII',
viewId=self.id,
exportFolder=export_folder,
filePrefix=file_prefix,
exportTvdRkb=False,
capitalizeFileNames=capitalize_file_names,
resampleInterval=0.0))
viewId=self.id,
exportFolder=export_folder,
filePrefix=file_prefix,
exportTvdRkb=False,
capitalizeFileNames=capitalize_file_names,
resampleInterval=0.0))
return res.exportWellLogPlotDataResult.exportedFiles

View File

@ -18,6 +18,6 @@ setup(
url='http://www.resinsight.org',
license=license,
packages=['rips'],
package_data={'rips': ['*.py', 'generated/*.py', 'PythonExamples/*.py', 'tests/*.py']}
package_data={'rips': ['*.py', 'generated/*.py', 'PythonExamples/*.py', 'tests/*.py']},
install_requires=['grpcio>=1.20.0']
)

View File

@ -80,6 +80,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimPlotWindow.h
${CMAKE_CURRENT_LIST_DIR}/RimMultiPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimDepthTrackPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimWellBoreStabilityPlot.h
@ -235,6 +236,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimPlotWindow.cpp
${CMAKE_CURRENT_LIST_DIR}/RimMultiPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimDepthTrackPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellBoreStabilityPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWbsParameters.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.cpp

View File

@ -861,6 +861,24 @@ QString Rim3dOverlayInfoConfig::resultInfoText( const HistogramData& histData, R
QString( "<b>Cell result:</b> %1, %2, %3<br>" ).arg( resultPos ).arg( fieldName ).arg( compName );
}
if ( geoMechView->cellResultResultDefinition()->isBiotCoefficientDependent() )
{
if ( geoMechCase->biotCoefficientType() == RimGeoMechCase::BiotCoefficientType::BIOT_NONE )
{
infoText += QString( "<b>Biot Coefficient</b>: 1.0 (None)<br>" );
}
else if ( geoMechCase->biotCoefficientType() == RimGeoMechCase::BiotCoefficientType::BIOT_FIXED )
{
infoText +=
QString( "<b>Biot Coefficient</b>: %1 (Fixed)<br>" ).arg( geoMechCase->biotFixedCoefficient() );
}
else if ( geoMechCase->biotCoefficientType() == RimGeoMechCase::BiotCoefficientType::BIOT_PER_ELEMENT )
{
infoText += QString( "<b>Biot Coefficient</b>: %1 (From element property)<br>" )
.arg( geoMechCase->biotResultAddress() );
}
}
const RimGeoMechContourMapView* contourMapView = dynamic_cast<const RimGeoMechContourMapView*>( geoMechView );
if ( contourMapView )
{

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,174 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
//
// 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 "cafAppEnum.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmChildField.h"
#include "cafPdmField.h"
#include "cafPdmFieldHandle.h"
#include "cafPdmObject.h"
#include "RiaDefines.h"
#include "RimPlotWindow.h"
#include "RimWellLogPlotNameConfig.h"
#include <QPointer>
#include <set>
class RimWellLogCurveCommonDataSource;
class RiuWellLogPlot;
class RimPlot;
class QKeyEvent;
//==================================================================================================
///
///
//==================================================================================================
class RimDepthTrackPlot : public RimPlotWindow, public RimNameConfigHolderInterface
{
CAF_PDM_HEADER_INIT;
public:
enum AxisGridVisibility
{
AXIS_GRID_NONE = 0x00,
AXIS_GRID_MAJOR = 0x01,
AXIS_GRID_MINOR = 0x02,
AXIS_GRID_MAJOR_AND_MINOR = 0x03
};
typedef caf::AppEnum<AxisGridVisibility> AxisGridEnum;
using DepthTypeEnum = RiaDefines::DepthTypeEnum;
public:
RimDepthTrackPlot();
~RimDepthTrackPlot() override;
QWidget* viewWidget() override;
QWidget* createPlotWidget( QWidget* mainWindowParent = nullptr );
QString description() const override;
bool isPlotTitleVisible() const;
void setPlotTitleVisible( bool visible );
void addPlot( RimPlot* plot );
void insertPlot( RimPlot* plot, size_t index );
void removePlot( RimPlot* plot );
size_t plotCount() const;
size_t plotIndex( const RimPlot* plot ) const;
RimPlot* plotByIndex( size_t index ) const;
std::vector<RimPlot*> plots() const;
std::vector<RimPlot*> visiblePlots() const;
DepthTypeEnum depthType() const;
void setDepthType( DepthTypeEnum depthType );
RiaDefines::DepthUnitType depthUnit() const;
void setDepthUnit( RiaDefines::DepthUnitType depthUnit );
QString depthAxisTitle() const;
void enableDepthAxisGridLines( AxisGridVisibility gridVisibility );
AxisGridVisibility depthAxisGridLinesEnabled() const;
void setAutoScaleXEnabled( bool enabled );
void setAutoScaleDepthEnabled( bool enabled );
void zoomAll() override;
void updateZoom();
void setDepthAxisRangeByFactorAndCenter( double zoomFactor, double zoomCenter );
void setDepthAxisRangeByPanDepth( double panFactor );
void setDepthAxisRange( double minimumDepth, double maximumDepth );
void calculateAvailableDepthRange();
void availableDepthRange( double* minimumDepth, double* maximumDepth ) const;
void visibleDepthRange( double* minimumDepth, double* maximumDepth ) const;
void uiOrderingForDepthAxis( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
void uiOrderingForAutoName( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
QString createAutoName() const override;
RimWellLogPlotNameConfig* nameConfig() const;
RimWellLogCurveCommonDataSource* commonDataSource() const;
void updateCommonDataSource();
void setCommonDataSourceEnabled( bool enable );
void setAvailableDepthUnits( const std::set<RiaDefines::DepthUnitType>& depthUnits );
void setAvailableDepthTypes( const std::set<DepthTypeEnum>& depthTypes );
QString asciiDataForPlotExport() const;
void handleKeyPressEvent( QKeyEvent* keyEvent );
protected:
QImage snapshotWindowContent() override;
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
void deleteViewWidget() override;
void performAutoNameUpdate() override;
void recreatePlotWidgets();
// Overridden PDM methods
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;
void initAfterRead() override;
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void onLoadDataAndUpdate() override;
void updatePlots();
caf::PdmFieldHandle* userDescriptionField() override;
private:
void cleanupBeforeClose();
void updateSubPlotNames();
void onPlotAdditionOrRemoval();
void doRenderWindowContent( QPaintDevice* paintDevice ) override;
void doUpdateLayout() override;
protected:
caf::PdmChildField<RimWellLogCurveCommonDataSource*> m_commonDataSource;
bool m_commonDataSourceEnabled;
caf::PdmField<bool> m_showPlotWindowTitle;
caf::PdmField<QString> m_plotWindowTitle;
caf::PdmField<caf::AppEnum<DepthTypeEnum>> m_depthType;
caf::PdmField<caf::AppEnum<RiaDefines::DepthUnitType>> m_depthUnit;
caf::PdmField<double> m_minVisibleDepth;
caf::PdmField<double> m_maxVisibleDepth;
caf::PdmField<AxisGridEnum> m_depthAxisGridVisibility;
caf::PdmField<bool> m_isAutoScaleDepthEnabled;
caf::PdmChildField<RimWellLogPlotNameConfig*> m_nameConfig;
caf::PdmChildArrayField<RimPlot*> m_plots;
QPointer<RiuWellLogPlot> m_viewer;
std::set<RiaDefines::DepthUnitType> m_availableDepthUnits;
std::set<DepthTypeEnum> m_availableDepthTypes;
double m_minAvailableDepth;
double m_maxAvailableDepth;
};

View File

@ -97,7 +97,7 @@ QString RimEclipseGeometrySelectionItem::geometrySelectionText() const
}
else
{
text = "No case";
return "No case";
}
text += ", ";

View File

@ -652,7 +652,7 @@ QList<caf::PdmOptionItemInfo>
{
RigCaseCellResultsData* cellResultsData = m_eclipseCase->results( this->porosityModel() );
if ( cellResultsData->hasFlowDiagUsableFluxes() )
if ( cellResultsData && cellResultsData->hasFlowDiagUsableFluxes() )
{
enableSouring = true;
}

View File

@ -23,6 +23,7 @@
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RicImportElementPropertyFeature.h"
#include "RicfCommandObject.h"
#include "RifOdbReader.h"
@ -49,8 +50,11 @@
#include "RimTools.h"
#include "RimWellLogPlotCollection.h"
#include "cafCmdFeatureManager.h"
#include "cafPdmFieldIOScriptability.h"
#include "cafPdmObjectScriptability.h"
#include "cafPdmUiDoubleValueEditor.h"
#include "cafPdmUiListEditor.h"
#include "cafPdmUiPropertyViewDialog.h"
#include "cafPdmUiPushButtonEditor.h"
#include "cafPdmUiTreeOrdering.h"
@ -58,13 +62,27 @@
#include "cvfVector3.h"
#include <QFile>
#include <QIcon>
#include <QFileInfo>
#include <array>
CAF_PDM_SOURCE_INIT( RimGeoMechCase, "ResInsightGeoMechCase" );
namespace caf
{
template <>
void caf::AppEnum<RimGeoMechCase::BiotCoefficientType>::setUp()
{
addItem( RimGeoMechCase::BiotCoefficientType::BIOT_NONE, "BIOT_NONE", "None" );
addItem( RimGeoMechCase::BiotCoefficientType::BIOT_FIXED, "BIOT_FIXED", "Fixed biot coefficient" );
addItem( RimGeoMechCase::BiotCoefficientType::BIOT_PER_ELEMENT,
"BIOT_PER_ELEMENT",
"Biot coefficient from element properties" );
setDefault( RimGeoMechCase::BiotCoefficientType::BIOT_NONE );
}
} // End namespace caf
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -106,12 +124,23 @@ RimGeoMechCase::RimGeoMechCase( void )
"" );
m_elementPropertyFileNameIndexUiSelection.xmlCapability()->disableIO();
CAF_PDM_InitField( &m_importElementPropertyFileCommand, "importElementPropertyFileCommad", false, "", "", "", "" );
caf::PdmUiPushButtonEditor::configureEditorForField( &m_importElementPropertyFileCommand );
CAF_PDM_InitField( &m_closeElementPropertyFileCommand, "closeElementPropertyFileCommad", false, "", "", "", "" );
caf::PdmUiPushButtonEditor::configureEditorForField( &m_closeElementPropertyFileCommand );
CAF_PDM_InitField( &m_reloadElementPropertyFileCommand, "reloadElementPropertyFileCommand", false, "", "", "", "" );
caf::PdmUiPushButtonEditor::configureEditorForField( &m_reloadElementPropertyFileCommand );
caf::AppEnum<BiotCoefficientType> defaultBiotCoefficientType = RimGeoMechCase::BiotCoefficientType::BIOT_NONE;
CAF_PDM_InitField( &m_biotCoefficientType, "BiotCoefficientType", defaultBiotCoefficientType, "Biot Coefficient", "", "", "" );
CAF_PDM_InitField( &m_biotFixedCoefficient, "BiotFixedCoefficient", 1.0, "Fixed coefficient", "", "", "" );
m_biotFixedCoefficient.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() );
CAF_PDM_InitField( &m_biotResultAddress, "BiotResultAddress", QString( "" ), "Value", "", "", "" );
m_biotResultAddress.uiCapability()->setUiEditorTypeName( caf::PdmUiListEditor::uiEditorTypeName() );
CAF_PDM_InitFieldNoDefault( &m_contourMapCollection, "ContourMaps", "2d Contour Maps", "", "", "" );
m_contourMapCollection = new RimGeoMechContourMapViewCollection;
m_contourMapCollection.uiCapability()->setUiTreeHidden( true );
@ -564,6 +593,30 @@ double RimGeoMechCase::frictionAngleDeg() const
return m_frictionAngleDeg;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechCase::BiotCoefficientType RimGeoMechCase::biotCoefficientType() const
{
return m_biotCoefficientType();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimGeoMechCase::biotFixedCoefficient() const
{
return m_biotFixedCoefficient;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGeoMechCase::biotResultAddress() const
{
return m_biotResultAddress;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -636,14 +689,56 @@ void RimGeoMechCase::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
cvf::Math::toRadians( m_frictionAngleDeg() ) );
}
std::vector<Rim3dView*> views = this->views();
for ( Rim3dView* view : views )
updateConnectedViews();
}
else if ( changedField == &m_biotFixedCoefficient || changedField == &m_biotCoefficientType ||
changedField == &m_biotResultAddress )
{
RigGeoMechCaseData* rigCaseData = geoMechData();
if ( rigCaseData && rigCaseData->femPartResults() )
{
if ( view ) // Todo: only those using the variable actively
if ( m_biotCoefficientType() == RimGeoMechCase::BiotCoefficientType::BIOT_NONE )
{
view->scheduleCreateDisplayModelAndRedraw();
rigCaseData->femPartResults()->setBiotCoefficientParameters( 1.0, "" );
}
else if ( m_biotCoefficientType() == RimGeoMechCase::BiotCoefficientType::BIOT_FIXED )
{
rigCaseData->femPartResults()->setBiotCoefficientParameters( m_biotFixedCoefficient(), "" );
}
else if ( m_biotCoefficientType() == RimGeoMechCase::BiotCoefficientType::BIOT_PER_ELEMENT )
{
if ( changedField == &m_biotCoefficientType )
{
// Show info message to user when selecting "from file" option before
// an element property has been imported
std::vector<std::string> elementProperties = possibleElementPropertyFieldNames();
if ( elementProperties.empty() )
{
QString importMessage =
QString( "Please import biot coefficients from file (typically called alpha.inp) by "
"selecting 'Import Element Property Table' on the Geomechanical Model." );
RiaLogging::info( importMessage );
// Set back to default value
m_biotCoefficientType = RimGeoMechCase::BiotCoefficientType::BIOT_NONE;
return;
}
}
if ( biotResultAddress().isEmpty() )
{
// Automatically select the first available property element if empty
std::vector<std::string> elementProperties = possibleElementPropertyFieldNames();
if ( !elementProperties.empty() )
{
m_biotResultAddress = QString::fromStdString( elementProperties[0] );
}
}
rigCaseData->femPartResults()->setBiotCoefficientParameters( 1.0, biotResultAddress() );
}
}
updateConnectedViews();
}
else if ( changedField == &m_reloadElementPropertyFileCommand )
{
@ -657,6 +752,12 @@ void RimGeoMechCase::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
closeSelectedElementPropertyFiles();
updateConnectedEditors();
}
else if ( changedField == &m_importElementPropertyFileCommand )
{
m_importElementPropertyFileCommand = false;
importElementPropertyFile();
updateConnectedEditors();
}
}
//--------------------------------------------------------------------------------------------------
@ -795,6 +896,12 @@ void RimGeoMechCase::closeSelectedElementPropertyFiles()
view->cellResult()->setResultAddress( RigFemResultAddress() );
}
if ( address.fieldName == biotResultAddress().toStdString() )
{
// If the used biot value is being removed we need to change the biot type back to default
m_biotCoefficientType = RimGeoMechCase::BiotCoefficientType::BIOT_NONE;
}
for ( RimGeoMechPropertyFilter* propertyFilter : view->geoMechPropertyFilterCollection()->propertyFilters() )
{
if ( address == propertyFilter->resultDefinition->resultAddress() )
@ -834,6 +941,14 @@ void RimGeoMechCase::reloadSelectedElementPropertyFiles()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechCase::importElementPropertyFile()
{
RicImportElementPropertyFeature::importElementProperties();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -850,9 +965,19 @@ void RimGeoMechCase::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
caf::PdmUiGroup* elmPropGroup = uiOrdering.addNewGroup( "Element Properties" );
elmPropGroup->add( &m_elementPropertyFileNameIndexUiSelection );
elmPropGroup->add( &m_importElementPropertyFileCommand );
elmPropGroup->add( &m_reloadElementPropertyFileCommand );
elmPropGroup->add( &m_closeElementPropertyFileCommand );
caf::PdmUiGroup* biotGroup = uiOrdering.addNewGroup( "Biot Coefficient" );
biotGroup->add( &m_biotCoefficientType );
biotGroup->add( &m_biotFixedCoefficient );
biotGroup->add( &m_biotResultAddress );
m_biotFixedCoefficient.uiCapability()->setUiHidden( m_biotCoefficientType !=
RimGeoMechCase::BiotCoefficientType::BIOT_FIXED );
m_biotResultAddress.uiCapability()->setUiHidden( m_biotCoefficientType !=
RimGeoMechCase::BiotCoefficientType::BIOT_PER_ELEMENT );
caf::PdmUiGroup* timeStepFilterGroup = uiOrdering.addNewGroup( "Time Step Filter" );
timeStepFilterGroup->setCollapsedByDefault( true );
m_timeStepFilter->uiOrdering( uiConfigName, *timeStepFilterGroup );
@ -865,13 +990,27 @@ void RimGeoMechCase::defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
{
if ( field == &m_importElementPropertyFileCommand )
{
dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>( attribute )->m_buttonText = "Import Element Property";
}
if ( field == &m_reloadElementPropertyFileCommand )
{
dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>( attribute )->m_buttonText = "Reload Case(s)";
dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>( attribute )->m_buttonText = "Reload Element Property";
}
if ( field == &m_closeElementPropertyFileCommand )
{
dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>( attribute )->m_buttonText = "Close Case(s)";
dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>( attribute )->m_buttonText = "Close Element Property";
}
if ( field == &m_biotFixedCoefficient )
{
auto uiDoubleValueEditorAttr = dynamic_cast<caf::PdmUiDoubleValueEditorAttribute*>( attribute );
if ( uiDoubleValueEditorAttr )
{
uiDoubleValueEditorAttr->m_decimals = 2;
uiDoubleValueEditorAttr->m_validator = new QDoubleValidator( 0.0, 1.0, 2 );
}
}
}
@ -892,6 +1031,80 @@ QList<caf::PdmOptionItemInfo> RimGeoMechCase::calculateValueOptions( const caf::
options.push_back( caf::PdmOptionItemInfo( m_elementPropertyFileNames.v().at( i ).path(), (int)i, true ) );
}
}
else if ( fieldNeedingOptions == &m_biotResultAddress )
{
std::vector<std::string> elementProperties = possibleElementPropertyFieldNames();
std::vector<QString> paths;
for ( auto path : m_elementPropertyFileNames.v() )
{
paths.push_back( path.path() );
}
std::map<std::string, QString> addressesInFile =
geoMechData()->femPartResults()->addressesInElementPropertyFiles( paths );
for ( const std::string elementProperty : elementProperties )
{
QString result = QString::fromStdString( elementProperty );
QString filename = findFileNameForElementProperty( elementProperty, addressesInFile );
options.push_back( caf::PdmOptionItemInfo( result + " (" + filename + ")", result ) );
}
}
return options;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGeoMechCase::findFileNameForElementProperty( const std::string& elementProperty,
const std::map<std::string, QString> addressesInFiles ) const
{
auto it = addressesInFiles.find( elementProperty );
if ( it != addressesInFiles.end() )
{
QFileInfo fileInfo( it->second );
return fileInfo.fileName();
}
else
{
return QString( "Unknown file" );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechCase::updateConnectedViews()
{
std::vector<Rim3dView*> views = this->views();
for ( Rim3dView* view : views )
{
if ( view )
{
view->scheduleCreateDisplayModelAndRedraw();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::string> RimGeoMechCase::possibleElementPropertyFieldNames()
{
std::vector<std::string> fieldNames;
if ( geoMechData() )
{
std::map<std::string, std::vector<std::string>> fieldWithComponentNames =
geoMechData()->femPartResults()->scalarFieldAndComponentNames( RIG_ELEMENT );
std::map<std::string, std::vector<std::string>>::const_iterator fieldIt;
for ( fieldIt = fieldWithComponentNames.begin(); fieldIt != fieldWithComponentNames.end(); ++fieldIt )
{
fieldNames.push_back( fieldIt->first );
}
}
return fieldNames;
}

View File

@ -52,6 +52,14 @@ public:
CASE_OPEN_CANCELLED,
CASE_OPEN_ERROR
};
enum class BiotCoefficientType
{
BIOT_NONE = 0,
BIOT_FIXED,
BIOT_PER_ELEMENT
};
RimGeoMechCase( void );
~RimGeoMechCase( void ) override;
@ -88,6 +96,10 @@ public:
// Fields:
caf::PdmChildArrayField<RimGeoMechView*> geoMechViews;
BiotCoefficientType biotCoefficientType() const;
double biotFixedCoefficient() const;
QString biotResultAddress() const;
private:
cvf::Vec3d displayModelOffset() const override;
static std::vector<QDateTime> vectorOfValidDateTimesFromTimeStepStrings( const QStringList& timeStepStrings );
@ -102,14 +114,20 @@ private:
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;
QString findFileNameForElementProperty( const std::string& elementProperty,
const std::map<std::string, QString> addressesInFiles ) const;
void updateFormationNamesData() override;
void initAfterRead() override;
static QString subStringOfDigits( const QString& timeStepString, int numberOfDigitsToFind );
void closeSelectedElementPropertyFiles();
void reloadSelectedElementPropertyFiles();
std::vector<Rim3dView*> allSpecialViews() const override;
void importElementPropertyFile();
void closeSelectedElementPropertyFiles();
void reloadSelectedElementPropertyFiles();
std::vector<Rim3dView*> allSpecialViews() const override;
void updateConnectedViews();
std::vector<std::string> possibleElementPropertyFieldNames();
private:
cvf::ref<RigGeoMechCaseData> m_geoMechCaseData;
@ -117,9 +135,14 @@ private:
caf::PdmField<double> m_frictionAngleDeg;
caf::PdmField<std::vector<caf::FilePath>> m_elementPropertyFileNames;
caf::PdmField<std::vector<int>> m_elementPropertyFileNameIndexUiSelection;
caf::PdmField<bool> m_importElementPropertyFileCommand;
caf::PdmField<bool> m_closeElementPropertyFileCommand;
caf::PdmField<bool> m_reloadElementPropertyFileCommand;
caf::PdmField<caf::AppEnum<BiotCoefficientType>> m_biotCoefficientType;
caf::PdmField<double> m_biotFixedCoefficient;
caf::PdmField<QString> m_biotResultAddress;
caf::PdmChildField<RimGeoMechContourMapViewCollection*> m_contourMapCollection;
bool m_applyTimeFilter;

View File

@ -931,3 +931,11 @@ void RimGeoMechResultDefinition::updateLegendTextAndRanges( RimRegularLegendConf
legendConfigToUpdate->setTitle( legendTitle );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimGeoMechResultDefinition::isBiotCoefficientDependent() const
{
return ( this->resultFieldName() == "SE" || this->resultFieldName() == "ST" );
}

View File

@ -80,6 +80,8 @@ public:
const QString& legendHeading,
int timeStepIndex );
bool isBiotCoefficientDependent() const;
protected:
virtual void updateLegendCategorySettings(){};
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;

View File

@ -225,13 +225,16 @@ std::vector<double> RimGridTimeHistoryCurve::yValues() const
RigCaseCellResultsData* cellResultsData = m_eclipseResultDefinition->currentGridCellResults();
std::vector<QDateTime> timeStepDates = cellResultsData->timeStepDates();
if ( cellResultsData )
{
std::vector<QDateTime> timeStepDates = cellResultsData->timeStepDates();
values = RigTimeHistoryResultAccessor::timeHistoryValues( eclTopItem->eclipseCase()->eclipseCaseData(),
m_eclipseResultDefinition(),
gridIndex,
cellIndex,
timeStepDates.size() );
values = RigTimeHistoryResultAccessor::timeHistoryValues( eclTopItem->eclipseCase()->eclipseCaseData(),
m_eclipseResultDefinition(),
gridIndex,
cellIndex,
timeStepDates.size() );
}
}
if ( geoMechGeomSelectionItem() && geoMechGeomSelectionItem()->geoMechCase() )
@ -464,11 +467,14 @@ std::vector<time_t> RimGridTimeHistoryCurve::timeStepValues() const
{
RigCaseCellResultsData* cellResultsData = m_eclipseResultDefinition->currentGridCellResults();
std::vector<QDateTime> timeStepDates = cellResultsData->timeStepDates();
for ( QDateTime dt : timeStepDates )
if ( cellResultsData )
{
dateTimes.push_back( dt.toTime_t() );
std::vector<QDateTime> timeStepDates = cellResultsData->timeStepDates();
for ( QDateTime dt : timeStepDates )
{
dateTimes.push_back( dt.toTime_t() );
}
}
}
@ -512,7 +518,10 @@ std::vector<double> RimGridTimeHistoryCurve::daysSinceSimulationStart() const
{
RigCaseCellResultsData* cellResultsData = m_eclipseResultDefinition->currentGridCellResults();
daysSinceSimulationStart = cellResultsData->daysSinceSimulationStart();
if ( cellResultsData )
{
daysSinceSimulationStart = cellResultsData->daysSinceSimulationStart();
}
}
RimGeoMechGeometrySelectionItem* geoMechTopItem = geoMechGeomSelectionItem();

View File

@ -42,7 +42,7 @@ CAF_PDM_SOURCE_INIT( RimIntersectionResultDefinition, "IntersectionResultDefinit
//--------------------------------------------------------------------------------------------------
RimIntersectionResultDefinition::RimIntersectionResultDefinition()
{
CAF_PDM_InitObject( "Intersection Result Definition", "", "", "" );
CAF_PDM_InitObject( "Intersection Result Definition", ":/CellResult.png", "", "" );
CAF_PDM_InitField( &m_isActive, "IsActive", true, "Active", "", "", "" );
m_isActive.uiCapability()->setUiHidden( true );
@ -327,12 +327,21 @@ void RimIntersectionResultDefinition::fieldChangedByUi( const caf::PdmFieldHandl
if ( changedField == &m_isActive || ( changedField == &m_timeStep && isInAction ) )
{
std::vector<PdmObject*> referringObjects;
this->objectsWithReferringPtrFieldsOfType( referringObjects );
for ( auto* obj : referringObjects )
{
obj->updateConnectedEditors();
}
RimGridView* gridView = nullptr;
this->firstAncestorOrThisOfType( gridView );
if ( gridView ) gridView->scheduleCreateDisplayModelAndRedraw();
update2dIntersectionViews();
}
this->updateUiIconFromToggleField();
}
//--------------------------------------------------------------------------------------------------
@ -440,6 +449,8 @@ void RimIntersectionResultDefinition::initAfterRead()
{
m_geomResultDefinition->setGeoMechCase( geomCase );
}
this->updateUiIconFromToggleField();
}
//--------------------------------------------------------------------------------------------------

View File

@ -304,6 +304,8 @@ void RimRegularLegendConfig::fieldChangedByUi( const caf::PdmFieldHandle* change
{
rftPlot->onLegendDefinitionChanged();
}
this->updateUiIconFromToggleField();
}
//--------------------------------------------------------------------------------------------------
@ -540,8 +542,13 @@ void RimRegularLegendConfig::setAutomaticRanges( double globalMin, double global
void RimRegularLegendConfig::initAfterRead()
{
updateFieldVisibility();
this->updateUiIconFromToggleField();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimRegularLegendConfig::objectToggleField()
{
return &m_showLegend;

View File

@ -649,6 +649,7 @@ double RimSimWellInView::calculateInjectionProductionFractions( const RimWellDis
const RimEclipseView* reservoirView = nullptr;
this->firstAncestorOrThisOfType( reservoirView );
if ( !reservoirView ) return false;
if ( !reservoirView->eclipseCase() ) return false;
size_t timeStep = static_cast<size_t>( reservoirView->currentTimeStep() );
std::vector<QDateTime> caseTimeSteps = reservoirView->eclipseCase()->timeStepDates();

File diff suppressed because it is too large Load Diff

View File

@ -19,158 +19,21 @@
#pragma once
#include "cafAppEnum.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmChildField.h"
#include "cafPdmField.h"
#include "cafPdmFieldHandle.h"
#include "cafPdmObject.h"
#include "RiaDefines.h"
#include "RimPlotWindow.h"
#include "RimWellLogPlotNameConfig.h"
#include <QPointer>
#include <set>
class RimWellLogCurveCommonDataSource;
class RiuWellLogPlot;
class RimPlot;
class QKeyEvent;
#include "RimDepthTrackPlot.h"
//==================================================================================================
///
///
//==================================================================================================
class RimWellLogPlot : public RimPlotWindow, public RimNameConfigHolderInterface
class RimWellLogPlot : public RimDepthTrackPlot
{
CAF_PDM_HEADER_INIT;
public:
enum AxisGridVisibility
{
AXIS_GRID_NONE = 0x00,
AXIS_GRID_MAJOR = 0x01,
AXIS_GRID_MINOR = 0x02,
AXIS_GRID_MAJOR_AND_MINOR = 0x03
};
typedef caf::AppEnum<AxisGridVisibility> AxisGridEnum;
using DepthTypeEnum = RiaDefines::DepthTypeEnum;
public:
RimWellLogPlot();
~RimWellLogPlot() override;
RimWellLogPlot& operator=( RimWellLogPlot&& rhs );
QWidget* viewWidget() override;
QWidget* createPlotWidget( QWidget* mainWindowParent = nullptr );
QString description() const override;
bool isPlotTitleVisible() const;
void setPlotTitleVisible( bool visible );
void addPlot( RimPlot* plot );
void insertPlot( RimPlot* plot, size_t index );
void removePlot( RimPlot* plot );
size_t plotCount() const;
size_t plotIndex( const RimPlot* plot ) const;
RimPlot* plotByIndex( size_t index ) const;
std::vector<RimPlot*> plots() const;
std::vector<RimPlot*> visiblePlots() const;
DepthTypeEnum depthType() const;
void setDepthType( DepthTypeEnum depthType );
RiaDefines::DepthUnitType depthUnit() const;
void setDepthUnit( RiaDefines::DepthUnitType depthUnit );
QString depthAxisTitle() const;
void enableDepthAxisGridLines( AxisGridVisibility gridVisibility );
AxisGridVisibility depthAxisGridLinesEnabled() const;
void setAutoScaleXEnabled( bool enabled );
void setAutoScaleDepthEnabled( bool enabled );
void zoomAll() override;
void updateZoom();
void setDepthAxisRangeByFactorAndCenter( double zoomFactor, double zoomCenter );
void setDepthAxisRangeByPanDepth( double panFactor );
void setDepthAxisRange( double minimumDepth, double maximumDepth );
void calculateAvailableDepthRange();
void availableDepthRange( double* minimumDepth, double* maximumDepth ) const;
void visibleDepthRange( double* minimumDepth, double* maximumDepth ) const;
void uiOrderingForDepthAxis( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
void uiOrderingForAutoName( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
QString createAutoName() const override;
RimWellLogPlotNameConfig* nameConfig() const;
RimWellLogCurveCommonDataSource* commonDataSource() const;
void updateCommonDataSource();
void setCommonDataSourceEnabled( bool enable );
void setAvailableDepthUnits( const std::set<RiaDefines::DepthUnitType>& depthUnits );
void setAvailableDepthTypes( const std::set<DepthTypeEnum>& depthTypes );
QString asciiDataForPlotExport() const;
void handleKeyPressEvent( QKeyEvent* keyEvent );
protected:
QImage snapshotWindowContent() override;
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
void deleteViewWidget() override;
void performAutoNameUpdate() override;
void recreatePlotWidgets();
// Overridden PDM methods
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;
void initAfterRead() override;
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void onLoadDataAndUpdate() override;
void updatePlots();
caf::PdmFieldHandle* userDescriptionField() override;
private:
void cleanupBeforeClose();
void updateSubPlotNames();
void onPlotAdditionOrRemoval();
void doRenderWindowContent( QPaintDevice* paintDevice ) override;
void doUpdateLayout() override;
protected:
caf::PdmChildField<RimWellLogCurveCommonDataSource*> m_commonDataSource;
bool m_commonDataSourceEnabled;
caf::PdmField<bool> m_showPlotWindowTitle;
caf::PdmField<QString> m_plotWindowTitle;
caf::PdmField<caf::AppEnum<DepthTypeEnum>> m_depthType;
caf::PdmField<caf::AppEnum<RiaDefines::DepthUnitType>> m_depthUnit;
caf::PdmField<double> m_minVisibleDepth;
caf::PdmField<double> m_maxVisibleDepth;
caf::PdmField<AxisGridEnum> m_depthAxisGridVisibility;
caf::PdmField<bool> m_isAutoScaleDepthEnabled;
caf::PdmChildField<RimWellLogPlotNameConfig*> m_nameConfig;
caf::PdmChildArrayField<RimPlot*> m_plots;
QPointer<RiuWellLogPlot> m_viewer;
std::set<RiaDefines::DepthUnitType> m_availableDepthUnits;
std::set<DepthTypeEnum> m_availableDepthTypes;
double m_minAvailableDepth;
double m_maxAvailableDepth;
};

View File

@ -1,130 +1,130 @@
#include "RiuWellLogPlot.h"
#include "RimPlotWindow.h"
#include "RimWellLogPlot.h"
#include "RiuQwtPlotWidget.h"
#include "RiuWellLogTrack.h"
#include "cafAssert.h"
#include "cafPdmPointer.h"
#include <QScrollBar>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuWellLogPlot::RiuWellLogPlot( RimWellLogPlot* plotDefinition, QWidget* parent )
: RiuMultiPlotPage( plotDefinition, parent )
{
m_trackScrollBar = new QScrollBar( nullptr );
m_trackScrollBar->setOrientation( Qt::Vertical );
m_trackScrollBar->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
m_trackScrollBarLayout = new QVBoxLayout;
m_trackScrollBarLayout->addWidget( m_trackScrollBar, 0 );
connect( m_trackScrollBar, SIGNAL( valueChanged( int ) ), this, SLOT( slotSetMinDepth( int ) ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogPlot* RiuWellLogPlot::wellLogPlotDefinition()
{
RimWellLogPlot* wellLogPlot = dynamic_cast<RimWellLogPlot*>( m_plotDefinition.p() );
CAF_ASSERT( wellLogPlot );
return wellLogPlot;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimViewWindow* RiuWellLogPlot::ownerViewWindow() const
{
return m_plotDefinition;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuWellLogPlot::updateVerticalScrollBar( double minVisible, double maxVisible, double minAvailable, double maxAvailable )
{
maxAvailable += 0.01 * ( maxAvailable - minAvailable );
double visibleRange = maxVisible - minVisible;
m_trackScrollBar->blockSignals( true );
{
m_trackScrollBar->setRange( (int)minAvailable, (int)( ( maxAvailable - visibleRange ) ) );
m_trackScrollBar->setPageStep( (int)visibleRange );
m_trackScrollBar->setValue( (int)minVisible );
}
m_trackScrollBar->blockSignals( false );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuWellLogPlot::renderTo( QPaintDevice* paintDevice )
{
m_trackScrollBar->setVisible( false );
RiuMultiPlotPage::renderTo( paintDevice );
m_trackScrollBar->setVisible( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiuWellLogPlot::showYAxis( int row, int column ) const
{
return column == 0;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuWellLogPlot::reinsertScrollbar()
{
QList<QPointer<RiuQwtPlotWidget>> plotWidgets = this->visiblePlotWidgets();
QList<QPointer<RiuQwtPlotLegend>> legends = this->legendsForVisiblePlots();
int colCount = this->m_gridLayout->columnCount();
m_gridLayout->addLayout( m_trackScrollBarLayout, 2, colCount, 1, 1 );
m_trackScrollBar->setVisible( !plotWidgets.empty() );
m_gridLayout->setColumnStretch( colCount, 0 );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuWellLogPlot::alignScrollbar( int offset )
{
m_trackScrollBarLayout->setContentsMargins( 0, offset, 0, 0 );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuWellLogPlot::slotSetMinDepth( int value )
{
double minimumDepth;
double maximumDepth;
wellLogPlotDefinition()->visibleDepthRange( &minimumDepth, &maximumDepth );
double delta = value - minimumDepth;
wellLogPlotDefinition()->setDepthAxisRange( minimumDepth + delta, maximumDepth + delta );
wellLogPlotDefinition()->setAutoScaleDepthEnabled( false );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuWellLogPlot::performUpdate()
{
m_trackScrollBar->setVisible( false );
reinsertPlotWidgets();
reinsertScrollbar();
int axisShift = alignCanvasTops();
alignScrollbar( axisShift );
}
#include "RiuWellLogPlot.h"
#include "RimDepthTrackPlot.h"
#include "RimPlotWindow.h"
#include "RiuQwtPlotWidget.h"
#include "RiuWellLogTrack.h"
#include "cafAssert.h"
#include "cafPdmPointer.h"
#include <QScrollBar>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuWellLogPlot::RiuWellLogPlot( RimDepthTrackPlot* plotDefinition, QWidget* parent )
: RiuMultiPlotPage( plotDefinition, parent )
{
m_trackScrollBar = new QScrollBar( nullptr );
m_trackScrollBar->setOrientation( Qt::Vertical );
m_trackScrollBar->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
m_trackScrollBarLayout = new QVBoxLayout;
m_trackScrollBarLayout->addWidget( m_trackScrollBar, 0 );
connect( m_trackScrollBar, SIGNAL( valueChanged( int ) ), this, SLOT( slotSetMinDepth( int ) ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimDepthTrackPlot* RiuWellLogPlot::wellLogPlotDefinition()
{
RimDepthTrackPlot* wellLogPlot = dynamic_cast<RimDepthTrackPlot*>( m_plotDefinition.p() );
CAF_ASSERT( wellLogPlot );
return wellLogPlot;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimViewWindow* RiuWellLogPlot::ownerViewWindow() const
{
return m_plotDefinition;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuWellLogPlot::updateVerticalScrollBar( double minVisible, double maxVisible, double minAvailable, double maxAvailable )
{
maxAvailable += 0.01 * ( maxAvailable - minAvailable );
double visibleRange = maxVisible - minVisible;
m_trackScrollBar->blockSignals( true );
{
m_trackScrollBar->setRange( (int)minAvailable, (int)( ( maxAvailable - visibleRange ) ) );
m_trackScrollBar->setPageStep( (int)visibleRange );
m_trackScrollBar->setValue( (int)minVisible );
}
m_trackScrollBar->blockSignals( false );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuWellLogPlot::renderTo( QPaintDevice* paintDevice )
{
m_trackScrollBar->setVisible( false );
RiuMultiPlotPage::renderTo( paintDevice );
m_trackScrollBar->setVisible( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiuWellLogPlot::showYAxis( int row, int column ) const
{
return column == 0;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuWellLogPlot::reinsertScrollbar()
{
QList<QPointer<RiuQwtPlotWidget>> plotWidgets = this->visiblePlotWidgets();
QList<QPointer<RiuQwtPlotLegend>> legends = this->legendsForVisiblePlots();
int colCount = this->m_gridLayout->columnCount();
m_gridLayout->addLayout( m_trackScrollBarLayout, 2, colCount, 1, 1 );
m_trackScrollBar->setVisible( !plotWidgets.empty() );
m_gridLayout->setColumnStretch( colCount, 0 );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuWellLogPlot::alignScrollbar( int offset )
{
m_trackScrollBarLayout->setContentsMargins( 0, offset, 0, 0 );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuWellLogPlot::slotSetMinDepth( int value )
{
double minimumDepth;
double maximumDepth;
wellLogPlotDefinition()->visibleDepthRange( &minimumDepth, &maximumDepth );
double delta = value - minimumDepth;
wellLogPlotDefinition()->setDepthAxisRange( minimumDepth + delta, maximumDepth + delta );
wellLogPlotDefinition()->setAutoScaleDepthEnabled( false );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuWellLogPlot::performUpdate()
{
m_trackScrollBar->setVisible( false );
reinsertPlotWidgets();
reinsertScrollbar();
int axisShift = alignCanvasTops();
alignScrollbar( axisShift );
}

View File

@ -1,53 +1,53 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- 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 "RiuInterfaceToViewWindow.h"
#include "RiuMultiPlotPage.h"
class RiuQwtPlotWidget;
class RimWellLogPlot;
class RiuWellLogPlot : public RiuMultiPlotPage
{
Q_OBJECT
public:
RiuWellLogPlot( RimWellLogPlot* plotDefinition, QWidget* parent );
RimViewWindow* ownerViewWindow() const override;
void updateVerticalScrollBar( double minVisible, double maxVisible, double minAvailable, double maxAvailable ) override;
void renderTo( QPaintDevice* paintDevice ) override;
protected:
bool showYAxis( int row, int column ) const override;
void reinsertScrollbar();
void alignScrollbar( int offset );
private:
RimWellLogPlot* wellLogPlotDefinition();
private slots:
void slotSetMinDepth( int value );
void performUpdate() override;
private:
QPointer<QVBoxLayout> m_trackScrollBarLayout;
QScrollBar* m_trackScrollBar;
};
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- 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 "RiuInterfaceToViewWindow.h"
#include "RiuMultiPlotPage.h"
class RiuQwtPlotWidget;
class RimDepthTrackPlot;
class RiuWellLogPlot : public RiuMultiPlotPage
{
Q_OBJECT
public:
RiuWellLogPlot( RimDepthTrackPlot* plotDefinition, QWidget* parent );
RimViewWindow* ownerViewWindow() const override;
void updateVerticalScrollBar( double minVisible, double maxVisible, double minAvailable, double maxAvailable ) override;
void renderTo( QPaintDevice* paintDevice ) override;
protected:
bool showYAxis( int row, int column ) const override;
void reinsertScrollbar();
void alignScrollbar( int offset );
private:
RimDepthTrackPlot* wellLogPlotDefinition();
private slots:
void slotSetMinDepth( int value );
void performUpdate() override;
private:
QPointer<QVBoxLayout> m_trackScrollBarLayout;
QScrollBar* m_trackScrollBar;
};

View File

@ -124,6 +124,14 @@ bool PdmFieldHandle::matchesKeywordAlias(const QString& keyword) const
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<QString> PdmFieldHandle::keywordAliases() const
{
return m_keywordAliases;
}
// These two functions can be used when PdmCore is used standalone without PdmUi/PdmXml
/*
PdmUiFieldHandle* PdmFieldHandle::uiCapability()

View File

@ -27,8 +27,9 @@ public:
PdmObjectHandle* ownerObject();
QString ownerClass() const;
void registerKeywordAlias(const QString& alias);
bool matchesKeywordAlias(const QString& keyword) const;
void registerKeywordAlias(const QString& alias);
bool matchesKeywordAlias(const QString& keyword) const;
std::vector<QString> keywordAliases() const;
// Child objects
bool hasChildObjects();

View File

@ -1,7 +1,7 @@
set(RESINSIGHT_MAJOR_VERSION 2019)
set(RESINSIGHT_MINOR_VERSION 12)
set(RESINSIGHT_PATCH_VERSION 1)
set(RESINSIGHT_MAJOR_VERSION 2020)
set(RESINSIGHT_MINOR_VERSION 04)
set(RESINSIGHT_PATCH_VERSION 0)
# Opional text with no restrictions
set(RESINSIGHT_VERSION_TEXT "-dev")
@ -10,7 +10,7 @@ set(RESINSIGHT_VERSION_TEXT "-dev")
# Must be unique and increasing within one combination of major/minor/patch version
# The uniqueness of this text is independent of RESINSIGHT_VERSION_TEXT
# Format of text must be ".xx"
set(RESINSIGHT_DEV_VERSION ".05")
set(RESINSIGHT_DEV_VERSION ".01")
# https://github.com/CRAVA/crava/tree/master/libs/nrlib
set(NRLIB_GITHUB_SHA "ba35d4359882f1c6f5e9dc30eb95fe52af50fd6f")

View File

@ -28,6 +28,7 @@
#include <map>
#include <algorithm>
#include <memory>
#include <stdexcept>
#include <ert/util/hash.hpp>
#include <ert/util/util.h>

View File

@ -12,6 +12,29 @@ Operate on a ResInsight case specified by a Case Id integer.
Not meant to be constructed separately but created by one of the following
methods in Project: loadCase, case, allCases, selectedCases
.. _result-definition-label:
Result Definition
-----------------
When working with grid case results, the following two argumenst are used in many functions to identify a
result
**Result Definition enums**::
property_type | | porosity_model
(str enum) | | (str enum)
----------------------- | ----- | --------------
DYNAMIC_NATIVE | | MATRIX_MODEL
STATIC_NATIVE | | FRACTURE_MODEL
SOURSIMRL | |
GENERATED | |
INPUT_PROPERTY | |
FORMATION_NAMES | |
FLOW_DIAGNOSTICS | |
INJECTION_FLOODING | |
Attributes:
id (int): Case Id corresponding to case Id in ResInsight project.
name (str): Case name
@ -55,6 +78,7 @@ def __custom_init__(self, pb2_object, channel):
# Public properties
self.chunk_size = 8160
@add_method(Case)
def __grid_count(self):
"""Get number of grids in the case"""
@ -65,10 +89,12 @@ def __grid_count(self):
return 0
return 0
@add_method(Case)
def __request(self):
return Case_pb2.CaseRequest(id=self.id)
@add_method(Case)
def __generate_property_input_iterator(self, values_iterator, parameters):
chunk = Properties_pb2.PropertyInputChunk()
@ -80,6 +106,7 @@ def __generate_property_input_iterator(self, values_iterator, parameters):
chunk.values.CopyFrom(valmsg)
yield chunk
@add_method(Case)
def __generate_property_input_chunks(self, array, parameters):
index = -1
@ -92,7 +119,7 @@ def __generate_property_input_chunks(self, array, parameters):
actual_chunk_size = min(len(array) - index + 1, self.chunk_size)
chunk.values.CopyFrom(
Properties_pb2.PropertyChunk(values=array[index:index +
actual_chunk_size]))
actual_chunk_size]))
index += actual_chunk_size
yield chunk
@ -100,6 +127,7 @@ def __generate_property_input_chunks(self, array, parameters):
chunk = Properties_pb2.PropertyInputChunk()
yield chunk
@add_method(Case)
def grid(self, index):
"""Get Grid of a given index
@ -107,27 +135,31 @@ def grid(self, index):
Arguments:
index (int): The grid index
Returns: :class:`rips.grid.Grid`
Returns:
:class:`rips.grid.Grid`
"""
return Grid(index, self, self.channel())
@add_method(Case)
def grids(self):
"""Get a list of all rips Grid objects in the case
Returns: List of :class:`rips.grid.Grid`
Returns:
List of :class:`rips.grid.Grid`
"""
grid_list = []
for i in range(0, self.__grid_count()):
grid_list.append(Grid(i, self, self.channel()))
return grid_list
@add_method(Case)
def replace(self, new_grid_file):
"""Replace the current case grid with a new grid loaded from file
Arguments:
new_egrid_file (str): path to EGRID file
new_egrid_file (str): Path to EGRID file
"""
project = self.ancestor(rips.project.Project)
self._execute_command(replaceCase=Cmd.ReplaceCaseRequest(
@ -135,10 +167,10 @@ def replace(self, new_grid_file):
new_case = project.case(self.id)
self.copy_from(new_case)
@add_method(Case)
def cell_count(self, porosity_model="MATRIX_MODEL"):
"""Get a cell count object containing number of active cells and
total number of cells
"""Get a cell count object containing number of active cells and total number of cells
Arguments:
porosity_model (str): String representing an enum.
@ -147,12 +179,21 @@ def cell_count(self, porosity_model="MATRIX_MODEL"):
Cell Count object with the following integer attributes:
active_cell_count: number of active cells
reservoir_cell_count: total number of reservoir cells
**CellCount class description**::
Parameter | Description | Type
----------------------- | ------------------------- | -----
active_cell_count | Number of active cells | Integer
reservoir_cell_count | Total number of cells | Integer
"""
porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model)
request = Case_pb2.CellInfoRequest(case_request=self.__request(),
porosity_model=porosity_model_enum)
porosity_model=porosity_model_enum)
return self.__case_stub.GetCellCount(request)
@add_method(Case)
def cell_info_for_active_cells_async(self, porosity_model="MATRIX_MODEL"):
"""Get Stream of cell info objects for current case
@ -164,13 +205,14 @@ def cell_info_for_active_cells_async(self, porosity_model="MATRIX_MODEL"):
Returns:
Stream of **CellInfo** objects
See cell_info_for_active_cells() for detalis on the **CellInfo** class.
See :meth:`rips.case.cell_info_for_active_cells()` for detalis on the **CellInfo** class.
"""
porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model)
request = Case_pb2.CellInfoRequest(case_request=self.__request(),
porosity_model=porosity_model_enum)
porosity_model=porosity_model_enum)
return self.__case_stub.GetCellInfoForActiveCells(request)
@add_method(Case)
def cell_info_for_active_cells(self, porosity_model="MATRIX_MODEL"):
"""Get list of cell info objects for current case
@ -209,6 +251,7 @@ def cell_info_for_active_cells(self, porosity_model="MATRIX_MODEL"):
received_active_cells.append(active_cell)
return received_active_cells
@add_method(Case)
def time_steps(self):
"""Get a list containing all time steps
@ -230,36 +273,56 @@ def time_steps(self):
"""
return self.__case_stub.GetTimeSteps(self.__request()).dates
@add_method(Case)
def reservoir_boundingbox(self):
"""Get the reservoir bounding box
Returns: A class with six double members: min_x, max_x, min_y, max_y, min_z, max_z
Returns:
BoundingBox
**BoundingBox class description**::
Type | Name
--------- | ----------
int | min_x
int | max_x
int | min_y
int | max_y
int | min_z
int | max_z
"""
return self.__case_stub.GetReservoirBoundingBox(self.__request())
@add_method(Case)
def reservoir_depth_range(self):
"""Get the reservoir depth range
Returns: A tuple with two members. The first is the minimum depth, the second is the maximum depth
Returns:
A tuple with two members. The first is the minimum depth, the second is the maximum depth
"""
bbox = self.reservoir_boundingbox()
return -bbox.max_z, -bbox.min_z
@add_method(Case)
def days_since_start(self):
"""Get a list of decimal values representing days since the start of the simulation"""
return self.__case_stub.GetDaysSinceStart(self.__request()).day_decimals
@add_method(Case)
def view(self, view_id):
"""Get a particular view belonging to a case by providing view id
Arguments:
view_id(int): view id
Returns: a view object
Returns:
:class:`rips.generated.pdm_objects.View`
"""
views = self.views()
for view_object in views:
@ -267,13 +330,19 @@ def view(self, view_id):
return view_object
return None
@add_method(Case)
def create_view(self):
"""Create a new view in the current case"""
"""Create a new view in the current case
Returns:
:class:`rips.generated.pdm_objects.View`
"""
return self.view(
self._execute_command(createView=Cmd.CreateViewRequest(
caseId=self.id)).createViewResult.viewId)
@add_method(Case)
def export_snapshots_of_all_views(self, prefix="", export_folder=""):
""" Export snapshots for all views in the case
@ -287,6 +356,7 @@ def export_snapshots_of_all_views(self, prefix="", export_folder=""):
exportSnapshots=Cmd.ExportSnapshotsRequest(
type="VIEWS", prefix=prefix, caseId=self.id, viewId=-1, exportFolder=export_folder))
@add_method(Case)
def export_well_path_completions(
self,
@ -353,6 +423,7 @@ def export_well_path_completions(
combinationMode=combination_mode,
))
@add_method(Case)
def export_msw(self, well_path):
"""
@ -364,6 +435,7 @@ def export_msw(self, well_path):
return self._execute_command(exportMsw=Cmd.ExportMswRequest(
caseId=self.id, wellPath=well_path))
@add_method(Case)
def create_multiple_fractures(
self,
@ -408,6 +480,7 @@ def create_multiple_fractures(
action=action,
))
@add_method(Case)
def create_lgr_for_completion(
self,
@ -454,6 +527,7 @@ def create_lgr_for_completion(
splitType=split_type,
))
@add_method(Case)
def create_saturation_pressure_plots(self):
"""
@ -464,6 +538,7 @@ def create_saturation_pressure_plots(self):
createSaturationPressurePlots=Cmd.CreateSatPressPlotRequest(
caseIds=case_ids))
@add_method(Case)
def export_flow_characteristics(
self,
@ -505,23 +580,17 @@ def export_flow_characteristics(
aquiferCellThreshold=aquifer_cell_threshold,
))
@add_method(Case)
def available_properties(self,
property_type,
porosity_model="MATRIX_MODEL"):
property_type,
porosity_model="MATRIX_MODEL"):
"""Get a list of available properties
Arguments:
property_type (str): string corresponding to property_type enum. Choices::
- DYNAMIC_NATIVE
- STATIC_NATIVE
- SOURSIMRL
- GENERATED
- INPUT_PROPERTY
- FORMATION_NAMES
- FLOW_DIAGNOSTICS
- INJECTION_FLOODING
For argument details, see :ref:`result-definition-label`
Arguments:
property_type (str): string corresponding to property_type enum.
porosity_model(str): 'MATRIX_MODEL' or 'FRACTURE_MODEL'.
"""
@ -535,19 +604,20 @@ def available_properties(self,
return self.__properties_stub.GetAvailableProperties(
request).property_names
@add_method(Case)
def active_cell_property_async(self,
property_type,
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all active cells. Async, so returns an iterator
property_type,
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all active cells. Async, so returns an iterator. For argument details, see :ref:`result-definition-label`
Arguments:
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
Returns:
An iterator to a chunk object containing an array of double values
@ -565,19 +635,20 @@ def active_cell_property_async(self,
for chunk in self.__properties_stub.GetActiveCellProperty(request):
yield chunk
@add_method(Case)
def active_cell_property(self,
property_type,
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all active cells. Sync, so returns a list
property_type,
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all active cells. Sync, so returns a list. For argument details, see :ref:`result-definition-label`
Arguments:
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
Returns:
A list containing double values
@ -592,19 +663,20 @@ def active_cell_property(self,
all_values.append(value)
return all_values
@add_method(Case)
def selected_cell_property_async(self,
property_type,
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all selected cells. Async, so returns an iterator
property_type,
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all selected cells. Async, so returns an iterator. For argument details, see :ref:`result-definition-label`
Arguments:
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
Returns:
An iterator to a chunk object containing an array of double values
@ -622,19 +694,20 @@ def selected_cell_property_async(self,
for chunk in self.__properties_stub.GetSelectedCellProperty(request):
yield chunk
@add_method(Case)
def selected_cell_property(self,
property_type,
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all selected cells. Sync, so returns a list
property_type,
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all selected cells. Sync, so returns a list. For argument details, see :ref:`result-definition-label`
Arguments:
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
Returns:
A list containing double values
@ -642,13 +715,14 @@ def selected_cell_property(self,
"""
all_values = []
generator = self.selected_cell_property_async(property_type,
property_name, time_step,
porosity_model)
property_name, time_step,
porosity_model)
for chunk in generator:
for value in chunk.values:
all_values.append(value)
return all_values
@add_method(Case)
def grid_property_async(
self,
@ -657,14 +731,14 @@ def grid_property_async(
time_step,
grid_index=0,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all grid cells. Async, so returns an iterator
"""Get a cell property for all grid cells. Async, so returns an iterator. For argument details, see :ref:`result-definition-label`
Arguments:
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
gridIndex(int): index to the grid we're getting values for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
Returns:
An iterator to a chunk object containing an array of double values
@ -683,6 +757,7 @@ def grid_property_async(
for chunk in self.__properties_stub.GetGridProperty(request):
yield chunk
@add_method(Case)
def grid_property(
self,
@ -691,27 +766,28 @@ def grid_property(
time_step,
grid_index=0,
porosity_model="MATRIX_MODEL"):
"""Get a cell property for all grid cells. Synchronous, so returns a list
"""Get a cell property for all grid cells. Synchronous, so returns a list. For argument details, see :ref:`result-definition-label`
Arguments:
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
grid_index(int): index to the grid we're getting values for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
Returns:
A list of double values
"""
all_values = []
generator = self.grid_property_async(property_type, property_name,
time_step, grid_index,
porosity_model)
time_step, grid_index,
porosity_model)
for chunk in generator:
for value in chunk.values:
all_values.append(value)
return all_values
@add_method(Case)
def set_active_cell_property_async(
self,
@ -720,14 +796,14 @@ def set_active_cell_property_async(
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Set cell property for all active cells Async. Takes an iterator to the input values
"""Set cell property for all active cells Async. Takes an iterator to the input values. For argument details, see :ref:`result-definition-label`
Arguments:
values_iterator(iterator): an iterator to the properties to be set
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
"""
property_type_enum = Properties_pb2.PropertyType.Value(property_type)
porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model)
@ -743,6 +819,7 @@ def set_active_cell_property_async(
values_iterator, request)
self.__properties_stub.SetActiveCellProperty(request_iterator)
@add_method(Case)
def set_active_cell_property(
self,
@ -751,14 +828,14 @@ def set_active_cell_property(
property_name,
time_step,
porosity_model="MATRIX_MODEL"):
"""Set a cell property for all active cells.
"""Set a cell property for all active cells. For argument details, see :ref:`result-definition-label`
Arguments:
values(list): a list of double precision floating point numbers
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
"""
property_type_enum = Properties_pb2.PropertyType.Value(property_type)
porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model)
@ -775,6 +852,7 @@ def set_active_cell_property(
if reply.accepted_value_count < len(values):
raise IndexError
@add_method(Case)
def set_grid_property(
self,
@ -784,15 +862,15 @@ def set_grid_property(
time_step,
grid_index=0,
porosity_model="MATRIX_MODEL"):
"""Set a cell property for all grid cells.
"""Set a cell property for all grid cells. For argument details, see :ref:`result-definition-label`
Arguments:
values(list): a list of double precision floating point numbers
property_type(str): string enum. See available()
property_type(str): string enum
property_name(str): name of an Eclipse property
time_step(int): the time step for which to get the property for
grid_index(int): index to the grid we're setting values for
porosity_model(str): string enum. See available()
porosity_model(str): string enum
"""
property_type_enum = Properties_pb2.PropertyType.Value(property_type)
porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model)
@ -810,6 +888,7 @@ def set_grid_property(
if reply.accepted_value_count < len(values):
raise IndexError
@add_method(Case)
def export_property(
self,
@ -836,6 +915,7 @@ def export_property(
exportFile=export_file,
))
@add_method(Case)
def create_well_bore_stability_plot(self, well_path, time_step, parameters=None):
""" Create a new well bore stability plot
@ -845,7 +925,7 @@ def create_well_bore_stability_plot(self, well_path, time_step, parameters=None)
time_step(int): time step
Returns:
A new plot object
:class:`rips.generated.pdm_objects.WellBoreStabilityPlot`
"""
pb2_parameters = None
if parameters is not None:
@ -853,13 +933,14 @@ def create_well_bore_stability_plot(self, well_path, time_step, parameters=None)
pb2_parameters = parameters.pb2_object()
plot_result = self._execute_command(createWellBoreStabilityPlot=Cmd.CreateWbsPlotRequest(caseId=self.id,
wellPath=well_path,
timeStep=time_step,
wbsParameters=pb2_parameters))
wellPath=well_path,
timeStep=time_step,
wbsParameters=pb2_parameters))
project = self.ancestor(rips.project.Project)
plot = project.plot(view_id=plot_result.createWbsPlotResult.viewId)
return plot
@add_method(Case)
def import_formation_names(self, formation_files=None):
""" Import formation names into project and apply it to the current case
@ -876,16 +957,19 @@ def import_formation_names(self, formation_files=None):
self._execute_command(importFormationNames=Cmd.ImportFormationNamesRequest(formationFiles=formation_files,
applyToCaseId=self.id))
@add_method(Case)
def simulation_wells(self):
"""Get a list of all simulation wells for a case
Returns:
A list of rips **SimulationWell** objects
:class:`rips.generated.pdm_objects.SimulationWell`
"""
wells = self.descendants(SimulationWell)
return wells
@add_method(Case)
def active_cell_centers_async(
self,
@ -901,9 +985,10 @@ def active_cell_centers_async(
"""
porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model)
request = Case_pb2.CellInfoRequest(case_request=self.__request(),
porosity_model=porosity_model_enum)
porosity_model=porosity_model_enum)
return self.__case_stub.GetCellCenterForActiveCells(request)
@add_method(Case)
def active_cell_centers(
self,
@ -923,6 +1008,7 @@ def active_cell_centers(
cell_centers.append(value)
return cell_centers
@add_method(Case)
def active_cell_corners_async(
self,
@ -938,9 +1024,10 @@ def active_cell_corners_async(
"""
porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model)
request = Case_pb2.CellInfoRequest(case_request=self.__request(),
porosity_model=porosity_model_enum)
porosity_model=porosity_model_enum)
return self.__case_stub.GetCellCornersForActiveCells(request)
@add_method(Case)
def active_cell_corners(
self,
@ -950,8 +1037,20 @@ def active_cell_corners(
Arguments:
porosity_model(str): string enum. See available()
Returns:
A list of CellCorners
**CellCorner class description**::
Parameter | Description | Type
----------- | ------------ | -----
c0 | | Vec3d
c1 | | Vec3d
c2 | | Vec3d
c3 | | Vec3d
c4 | | Vec3d
c5 | | Vec3d
c6 | | Vec3d
c7 | | Vec3d
"""
cell_corners = []
generator = self.active_cell_corners_async(porosity_model)
@ -960,16 +1059,18 @@ def active_cell_corners(
cell_corners.append(value)
return cell_corners
@add_method(Case)
def selected_cells_async(self):
"""Get the selected cells. Async, so returns an iterator.
Returns:
An iterator to a chunk object containing an array of cells.
Loop through the chunks and then the cells within the chunk to get all cells.
"""
return self.__case_stub.GetSelectedCells(self.__request())
@add_method(Case)
def selected_cells(self):
"""Get the selected cells. Synchronous, so returns a list.
@ -984,6 +1085,7 @@ def selected_cells(self):
cells.append(value)
return cells
@add_method(Case)
def coarsening_info(self):
"""Get a coarsening information for all grids in the case.
@ -994,12 +1096,24 @@ def coarsening_info(self):
"""
return self.__case_stub.GetCoarseningInfoArray(self.__request()).data
@add_method(Case)
def available_nnc_properties(self):
"""Get a list of available NNC properties
**NNCConnection class description**::
Parameter | Description | Type
------------------------| --------------------------------------------- | -----
cell_grid_index1 | Reservoir Cell Index to cell 1 | int32
cell_grid_index2 | Reservoir Cell Index to cell 2 | int32
cell1 | Reservoir Cell IJK to cell 1 | Vec3i
cell2 | Reservoir Cell IJK to cell 1 | Vec3i
"""
return self.__nnc_properties_stub.GetAvailableNNCProperties(self.__request()).properties
@add_method(Case)
def nnc_connections_async(self):
"""Get the NNC connections. Async, so returns an iterator.
@ -1010,6 +1124,7 @@ def nnc_connections_async(self):
"""
return self.__nnc_properties_stub.GetNNCConnections(self.__request())
@add_method(Case)
def nnc_connections(self):
"""Get the NNC connection. Synchronous, so returns a list.
@ -1024,14 +1139,16 @@ def nnc_connections(self):
connections.append(value)
return connections
@add_method(Case)
def __nnc_connections_values_async(self, property_name, property_type, time_step):
request = NNCProperties_pb2.NNCValuesRequest(case_id=self.id,
property_name=property_name,
property_type=property_type,
time_step=time_step)
property_name=property_name,
property_type=property_type,
time_step=time_step)
return self.__nnc_properties_stub.GetNNCValues(request)
@add_method(Case)
def __nnc_values_generator_to_list(self, generator):
"""Converts a NNC values generator to a list."""
@ -1041,10 +1158,11 @@ def __nnc_values_generator_to_list(self, generator):
vals.append(value)
return vals
@add_method(Case)
def nnc_connections_static_values_async(self, property_name):
"""Get the static NNC values. Async, so returns an iterator.
Returns:
An iterator to a chunk object containing an list of doubles.
Loop through the chunks and then the values within the chunk to get values
@ -1054,10 +1172,11 @@ def nnc_connections_static_values_async(self, property_name):
"""
return self.__nnc_connections_values_async(property_name, NNCProperties_pb2.NNC_STATIC, 0)
@add_method(Case)
def nnc_connections_static_values(self, property_name):
"""Get the static NNC values.
Returns:
A list of doubles. The order of the list matches the list from
nnc_connections, i.e. the nth object of nnc_connections() refers to nth
@ -1066,10 +1185,11 @@ def nnc_connections_static_values(self, property_name):
generator = self.nnc_connections_static_values_async(property_name)
return self.__nnc_values_generator_to_list(generator)
@add_method(Case)
def nnc_connections_dynamic_values_async(self, property_name, time_step):
"""Get the dynamic NNC values. Async, so returns an iterator.
Returns:
An iterator to a chunk object containing an list of doubles.
Loop through the chunks and then the values within the chunk to get values
@ -1079,10 +1199,11 @@ def nnc_connections_dynamic_values_async(self, property_name, time_step):
"""
return self.__nnc_connections_values_async(property_name, NNCProperties_pb2.NNC_DYNAMIC, time_step)
@add_method(Case)
def nnc_connections_dynamic_values(self, property_name, time_step):
"""Get the dynamic NNC values.
Returns:
A list of doubles. The order of the list matches the list from
nnc_connections, i.e. the nth object of nnc_connections() refers to nth
@ -1091,10 +1212,11 @@ def nnc_connections_dynamic_values(self, property_name, time_step):
generator = self.nnc_connections_dynamic_values_async(property_name, time_step)
return self.__nnc_values_generator_to_list(generator)
@add_method(Case)
def nnc_connections_generated_values_async(self, property_name, time_step):
"""Get the generated NNC values. Async, so returns an iterator.
Returns:
An iterator to a chunk object containing an list of doubles.
Loop through the chunks and then the values within the chunk to get values
@ -1104,10 +1226,11 @@ def nnc_connections_generated_values_async(self, property_name, time_step):
"""
return self.__nnc_connections_values_async(property_name, NNCProperties_pb2.NNC_GENERATED, time_step)
@add_method(Case)
def nnc_connections_generated_values(self, property_name, time_step):
"""Get the generated NNC values.
Returns:
A list of doubles. The order of the list matches the list from
nnc_connections, i.e. the nth object of nnc_connections() refers to nth
@ -1116,6 +1239,7 @@ def nnc_connections_generated_values(self, property_name, time_step):
generator = self.nnc_connections_generated_values_async(property_name, time_step)
return self.__nnc_values_generator_to_list(generator)
@add_method(Case)
def __generate_nnc_property_input_chunks(self, array, parameters):
index = -1
@ -1135,6 +1259,7 @@ def __generate_nnc_property_input_chunks(self, array, parameters):
chunk = NNCProperties_pb2.NNCValuesChunk()
yield chunk
@add_method(Case)
def set_nnc_connections_values(
self,

View File

@ -7,10 +7,11 @@ from rips.pdmobject import PdmObject, add_method
from rips.view import View
from rips.generated.pdm_objects import EclipseContourMap, GeoMechContourMap
@add_method(EclipseContourMap)
def export_to_text(self, export_file_name='', export_local_coordinates=False, undefined_value_label="NaN", exclude_undefined_values=False):
""" Export snapshot for the current view
Arguments:
export_file_name(str): The file location to store results in.
export_local_coordinates(bool): Should we export local coordinates, or UTM.
@ -25,10 +26,11 @@ def export_to_text(self, export_file_name='', export_local_coordinates=False, un
excludeUndefinedValues=exclude_undefined_values,
viewId=self.id))
@add_method(GeoMechContourMap)
def export_to_text(self, export_file_name='', export_local_coordinates=False, undefined_value_label="NaN", exclude_undefined_values=False):
""" Export snapshot for the current view
Arguments:
export_file_name(str): The file location to store results in.
export_local_coordinates(bool): Should we export local coordinates, or UTM.
@ -42,4 +44,3 @@ def export_to_text(self, export_file_name='', export_local_coordinates=False, un
undefinedValueLabel=undefined_value_label,
excludeUndefinedValues=exclude_undefined_values,
viewId=self.id))

View File

@ -2,49 +2,47 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: App.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
import Definitions_pb2 as Definitions__pb2
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import reflection as _reflection
from google.protobuf import message as _message
from google.protobuf import descriptor as _descriptor
from google.protobuf.internal import enum_type_wrapper
import sys
_b = sys.version_info[0] < 3 and (
lambda x: x) or (lambda x: x.encode('latin1'))
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
import Definitions_pb2 as Definitions__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='App.proto',
package='rips',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\tApp.proto\x12\x04rips\x1a\x11\x44\x65\x66initions.proto\"N\n\x07Version\x12\x15\n\rmajor_version\x18\x01 \x01(\x05\x12\x15\n\rminor_version\x18\x02 \x01(\x05\x12\x15\n\rpatch_version\x18\x03 \x01(\x05\":\n\x0bRuntimeInfo\x12+\n\x08\x61pp_type\x18\x01 \x01(\x0e\x32\x19.rips.ApplicationTypeEnum*C\n\x13\x41pplicationTypeEnum\x12\x13\n\x0fGUI_APPLICATION\x10\x00\x12\x17\n\x13\x43ONSOLE_APPLICATION\x10\x01\x32\x89\x01\n\x03\x41pp\x12*\n\nGetVersion\x12\x0b.rips.Empty\x1a\r.rips.Version\"\x00\x12\"\n\x04\x45xit\x12\x0b.rips.Empty\x1a\x0b.rips.Empty\"\x00\x12\x32\n\x0eGetRuntimeInfo\x12\x0b.rips.Empty\x1a\x11.rips.RuntimeInfo\"\x00\x62\x06proto3')
,
dependencies=[Definitions__pb2.DESCRIPTOR,])
name='App.proto',
package='rips',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\tApp.proto\x12\x04rips\x1a\x11\x44\x65\x66initions.proto\"N\n\x07Version\x12\x15\n\rmajor_version\x18\x01 \x01(\x05\x12\x15\n\rminor_version\x18\x02 \x01(\x05\x12\x15\n\rpatch_version\x18\x03 \x01(\x05\":\n\x0bRuntimeInfo\x12+\n\x08\x61pp_type\x18\x01 \x01(\x0e\x32\x19.rips.ApplicationTypeEnum*C\n\x13\x41pplicationTypeEnum\x12\x13\n\x0fGUI_APPLICATION\x10\x00\x12\x17\n\x13\x43ONSOLE_APPLICATION\x10\x01\x32\x89\x01\n\x03\x41pp\x12*\n\nGetVersion\x12\x0b.rips.Empty\x1a\r.rips.Version\"\x00\x12\"\n\x04\x45xit\x12\x0b.rips.Empty\x1a\x0b.rips.Empty\"\x00\x12\x32\n\x0eGetRuntimeInfo\x12\x0b.rips.Empty\x1a\x11.rips.RuntimeInfo\"\x00\x62\x06proto3'),
dependencies=[Definitions__pb2.DESCRIPTOR, ])
_APPLICATIONTYPEENUM = _descriptor.EnumDescriptor(
name='ApplicationTypeEnum',
full_name='rips.ApplicationTypeEnum',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='GUI_APPLICATION', index=0, number=0,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='CONSOLE_APPLICATION', index=1, number=1,
serialized_options=None,
type=None),
],
containing_type=None,
serialized_options=None,
serialized_start=178,
serialized_end=245,
name='ApplicationTypeEnum',
full_name='rips.ApplicationTypeEnum',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='GUI_APPLICATION', index=0, number=0,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='CONSOLE_APPLICATION', index=1, number=1,
serialized_options=None,
type=None),
],
containing_type=None,
serialized_options=None,
serialized_start=178,
serialized_end=245,
)
_sym_db.RegisterEnumDescriptor(_APPLICATIONTYPEENUM)
@ -53,80 +51,79 @@ GUI_APPLICATION = 0
CONSOLE_APPLICATION = 1
_VERSION = _descriptor.Descriptor(
name='Version',
full_name='rips.Version',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='major_version', full_name='rips.Version.major_version', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='minor_version', full_name='rips.Version.minor_version', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='patch_version', full_name='rips.Version.patch_version', index=2,
number=3, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=38,
serialized_end=116,
name='Version',
full_name='rips.Version',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='major_version', full_name='rips.Version.major_version', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='minor_version', full_name='rips.Version.minor_version', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='patch_version', full_name='rips.Version.patch_version', index=2,
number=3, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=38,
serialized_end=116,
)
_RUNTIMEINFO = _descriptor.Descriptor(
name='RuntimeInfo',
full_name='rips.RuntimeInfo',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='app_type', full_name='rips.RuntimeInfo.app_type', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=118,
serialized_end=176,
name='RuntimeInfo',
full_name='rips.RuntimeInfo',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='app_type', full_name='rips.RuntimeInfo.app_type', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=118,
serialized_end=176,
)
_RUNTIMEINFO.fields_by_name['app_type'].enum_type = _APPLICATIONTYPEENUM
@ -136,58 +133,57 @@ DESCRIPTOR.enum_types_by_name['ApplicationTypeEnum'] = _APPLICATIONTYPEENUM
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
Version = _reflection.GeneratedProtocolMessageType('Version', (_message.Message,), dict(
DESCRIPTOR = _VERSION,
__module__ = 'App_pb2'
# @@protoc_insertion_point(class_scope:rips.Version)
))
DESCRIPTOR=_VERSION,
__module__='App_pb2'
# @@protoc_insertion_point(class_scope:rips.Version)
))
_sym_db.RegisterMessage(Version)
RuntimeInfo = _reflection.GeneratedProtocolMessageType('RuntimeInfo', (_message.Message,), dict(
DESCRIPTOR = _RUNTIMEINFO,
__module__ = 'App_pb2'
# @@protoc_insertion_point(class_scope:rips.RuntimeInfo)
))
DESCRIPTOR=_RUNTIMEINFO,
__module__='App_pb2'
# @@protoc_insertion_point(class_scope:rips.RuntimeInfo)
))
_sym_db.RegisterMessage(RuntimeInfo)
_APP = _descriptor.ServiceDescriptor(
name='App',
full_name='rips.App',
file=DESCRIPTOR,
index=0,
serialized_options=None,
serialized_start=248,
serialized_end=385,
methods=[
_descriptor.MethodDescriptor(
name='GetVersion',
full_name='rips.App.GetVersion',
name='App',
full_name='rips.App',
file=DESCRIPTOR,
index=0,
containing_service=None,
input_type=Definitions__pb2._EMPTY,
output_type=_VERSION,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='Exit',
full_name='rips.App.Exit',
index=1,
containing_service=None,
input_type=Definitions__pb2._EMPTY,
output_type=Definitions__pb2._EMPTY,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetRuntimeInfo',
full_name='rips.App.GetRuntimeInfo',
index=2,
containing_service=None,
input_type=Definitions__pb2._EMPTY,
output_type=_RUNTIMEINFO,
serialized_options=None,
),
])
serialized_start=248,
serialized_end=385,
methods=[
_descriptor.MethodDescriptor(
name='GetVersion',
full_name='rips.App.GetVersion',
index=0,
containing_service=None,
input_type=Definitions__pb2._EMPTY,
output_type=_VERSION,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='Exit',
full_name='rips.App.Exit',
index=1,
containing_service=None,
input_type=Definitions__pb2._EMPTY,
output_type=Definitions__pb2._EMPTY,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetRuntimeInfo',
full_name='rips.App.GetRuntimeInfo',
index=2,
containing_service=None,
input_type=Definitions__pb2._EMPTY,
output_type=_RUNTIMEINFO,
serialized_options=None,
),
])
_sym_db.RegisterServiceDescriptor(_APP)
DESCRIPTOR.services_by_name['App'] = _APP

View File

@ -6,76 +6,76 @@ import Definitions_pb2 as Definitions__pb2
class AppStub(object):
# missing associated documentation comment in .proto file
pass
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GetVersion = channel.unary_unary(
'/rips.App/GetVersion',
request_serializer=Definitions__pb2.Empty.SerializeToString,
response_deserializer=App__pb2.Version.FromString,
Args:
channel: A grpc.Channel.
"""
self.GetVersion = channel.unary_unary(
'/rips.App/GetVersion',
request_serializer=Definitions__pb2.Empty.SerializeToString,
response_deserializer=App__pb2.Version.FromString,
)
self.Exit = channel.unary_unary(
'/rips.App/Exit',
request_serializer=Definitions__pb2.Empty.SerializeToString,
response_deserializer=Definitions__pb2.Empty.FromString,
self.Exit = channel.unary_unary(
'/rips.App/Exit',
request_serializer=Definitions__pb2.Empty.SerializeToString,
response_deserializer=Definitions__pb2.Empty.FromString,
)
self.GetRuntimeInfo = channel.unary_unary(
'/rips.App/GetRuntimeInfo',
request_serializer=Definitions__pb2.Empty.SerializeToString,
response_deserializer=App__pb2.RuntimeInfo.FromString,
self.GetRuntimeInfo = channel.unary_unary(
'/rips.App/GetRuntimeInfo',
request_serializer=Definitions__pb2.Empty.SerializeToString,
response_deserializer=App__pb2.RuntimeInfo.FromString,
)
class AppServicer(object):
# missing associated documentation comment in .proto file
pass
def GetVersion(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Exit(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetVersion(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetRuntimeInfo(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Exit(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetRuntimeInfo(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_AppServicer_to_server(servicer, server):
rpc_method_handlers = {
'GetVersion': grpc.unary_unary_rpc_method_handler(
servicer.GetVersion,
request_deserializer=Definitions__pb2.Empty.FromString,
response_serializer=App__pb2.Version.SerializeToString,
),
'Exit': grpc.unary_unary_rpc_method_handler(
servicer.Exit,
request_deserializer=Definitions__pb2.Empty.FromString,
response_serializer=Definitions__pb2.Empty.SerializeToString,
),
'GetRuntimeInfo': grpc.unary_unary_rpc_method_handler(
servicer.GetRuntimeInfo,
request_deserializer=Definitions__pb2.Empty.FromString,
response_serializer=App__pb2.RuntimeInfo.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.App', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
rpc_method_handlers = {
'GetVersion': grpc.unary_unary_rpc_method_handler(
servicer.GetVersion,
request_deserializer=Definitions__pb2.Empty.FromString,
response_serializer=App__pb2.Version.SerializeToString,
),
'Exit': grpc.unary_unary_rpc_method_handler(
servicer.Exit,
request_deserializer=Definitions__pb2.Empty.FromString,
response_serializer=Definitions__pb2.Empty.SerializeToString,
),
'GetRuntimeInfo': grpc.unary_unary_rpc_method_handler(
servicer.GetRuntimeInfo,
request_deserializer=Definitions__pb2.Empty.FromString,
response_serializer=App__pb2.RuntimeInfo.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.App', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))

File diff suppressed because it is too large Load Diff

View File

@ -7,229 +7,229 @@ import PdmObject_pb2 as PdmObject__pb2
class CaseStub(object):
# missing associated documentation comment in .proto file
pass
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GetGridCount = channel.unary_unary(
'/rips.Case/GetGridCount',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=Case__pb2.GridCount.FromString,
Args:
channel: A grpc.Channel.
"""
self.GetGridCount = channel.unary_unary(
'/rips.Case/GetGridCount',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=Case__pb2.GridCount.FromString,
)
self.GetCellCount = channel.unary_unary(
'/rips.Case/GetCellCount',
request_serializer=Case__pb2.CellInfoRequest.SerializeToString,
response_deserializer=Case__pb2.CellCount.FromString,
self.GetCellCount = channel.unary_unary(
'/rips.Case/GetCellCount',
request_serializer=Case__pb2.CellInfoRequest.SerializeToString,
response_deserializer=Case__pb2.CellCount.FromString,
)
self.GetCellInfoForActiveCells = channel.unary_stream(
'/rips.Case/GetCellInfoForActiveCells',
request_serializer=Case__pb2.CellInfoRequest.SerializeToString,
response_deserializer=Case__pb2.CellInfoArray.FromString,
self.GetCellInfoForActiveCells = channel.unary_stream(
'/rips.Case/GetCellInfoForActiveCells',
request_serializer=Case__pb2.CellInfoRequest.SerializeToString,
response_deserializer=Case__pb2.CellInfoArray.FromString,
)
self.GetCellCenterForActiveCells = channel.unary_stream(
'/rips.Case/GetCellCenterForActiveCells',
request_serializer=Case__pb2.CellInfoRequest.SerializeToString,
response_deserializer=Definitions__pb2.CellCenters.FromString,
self.GetCellCenterForActiveCells = channel.unary_stream(
'/rips.Case/GetCellCenterForActiveCells',
request_serializer=Case__pb2.CellInfoRequest.SerializeToString,
response_deserializer=Definitions__pb2.CellCenters.FromString,
)
self.GetCellCornersForActiveCells = channel.unary_stream(
'/rips.Case/GetCellCornersForActiveCells',
request_serializer=Case__pb2.CellInfoRequest.SerializeToString,
response_deserializer=Definitions__pb2.CellCornersArray.FromString,
self.GetCellCornersForActiveCells = channel.unary_stream(
'/rips.Case/GetCellCornersForActiveCells',
request_serializer=Case__pb2.CellInfoRequest.SerializeToString,
response_deserializer=Definitions__pb2.CellCornersArray.FromString,
)
self.GetCoarseningInfoArray = channel.unary_unary(
'/rips.Case/GetCoarseningInfoArray',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=Case__pb2.CoarseningInfoArray.FromString,
self.GetCoarseningInfoArray = channel.unary_unary(
'/rips.Case/GetCoarseningInfoArray',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=Case__pb2.CoarseningInfoArray.FromString,
)
self.GetTimeSteps = channel.unary_unary(
'/rips.Case/GetTimeSteps',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=Case__pb2.TimeStepDates.FromString,
self.GetTimeSteps = channel.unary_unary(
'/rips.Case/GetTimeSteps',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=Case__pb2.TimeStepDates.FromString,
)
self.GetSelectedCells = channel.unary_stream(
'/rips.Case/GetSelectedCells',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=Case__pb2.SelectedCells.FromString,
self.GetSelectedCells = channel.unary_stream(
'/rips.Case/GetSelectedCells',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=Case__pb2.SelectedCells.FromString,
)
self.GetDaysSinceStart = channel.unary_unary(
'/rips.Case/GetDaysSinceStart',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=Case__pb2.DaysSinceStart.FromString,
self.GetDaysSinceStart = channel.unary_unary(
'/rips.Case/GetDaysSinceStart',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=Case__pb2.DaysSinceStart.FromString,
)
self.GetCaseInfo = channel.unary_unary(
'/rips.Case/GetCaseInfo',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=Case__pb2.CaseInfo.FromString,
self.GetCaseInfo = channel.unary_unary(
'/rips.Case/GetCaseInfo',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=Case__pb2.CaseInfo.FromString,
)
self.GetPdmObject = channel.unary_unary(
'/rips.Case/GetPdmObject',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=PdmObject__pb2.PdmObject.FromString,
self.GetPdmObject = channel.unary_unary(
'/rips.Case/GetPdmObject',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=PdmObject__pb2.PdmObject.FromString,
)
self.GetReservoirBoundingBox = channel.unary_unary(
'/rips.Case/GetReservoirBoundingBox',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=Case__pb2.BoundingBox.FromString,
self.GetReservoirBoundingBox = channel.unary_unary(
'/rips.Case/GetReservoirBoundingBox',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=Case__pb2.BoundingBox.FromString,
)
class CaseServicer(object):
# missing associated documentation comment in .proto file
pass
def GetGridCount(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCellCount(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetGridCount(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCellInfoForActiveCells(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCellCount(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCellCenterForActiveCells(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCellInfoForActiveCells(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCellCornersForActiveCells(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCellCenterForActiveCells(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCoarseningInfoArray(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCellCornersForActiveCells(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetTimeSteps(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCoarseningInfoArray(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetSelectedCells(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetTimeSteps(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetDaysSinceStart(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetSelectedCells(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCaseInfo(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetDaysSinceStart(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetPdmObject(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCaseInfo(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetReservoirBoundingBox(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetPdmObject(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetReservoirBoundingBox(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_CaseServicer_to_server(servicer, server):
rpc_method_handlers = {
'GetGridCount': grpc.unary_unary_rpc_method_handler(
servicer.GetGridCount,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=Case__pb2.GridCount.SerializeToString,
),
'GetCellCount': grpc.unary_unary_rpc_method_handler(
servicer.GetCellCount,
request_deserializer=Case__pb2.CellInfoRequest.FromString,
response_serializer=Case__pb2.CellCount.SerializeToString,
),
'GetCellInfoForActiveCells': grpc.unary_stream_rpc_method_handler(
servicer.GetCellInfoForActiveCells,
request_deserializer=Case__pb2.CellInfoRequest.FromString,
response_serializer=Case__pb2.CellInfoArray.SerializeToString,
),
'GetCellCenterForActiveCells': grpc.unary_stream_rpc_method_handler(
servicer.GetCellCenterForActiveCells,
request_deserializer=Case__pb2.CellInfoRequest.FromString,
response_serializer=Definitions__pb2.CellCenters.SerializeToString,
),
'GetCellCornersForActiveCells': grpc.unary_stream_rpc_method_handler(
servicer.GetCellCornersForActiveCells,
request_deserializer=Case__pb2.CellInfoRequest.FromString,
response_serializer=Definitions__pb2.CellCornersArray.SerializeToString,
),
'GetCoarseningInfoArray': grpc.unary_unary_rpc_method_handler(
servicer.GetCoarseningInfoArray,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=Case__pb2.CoarseningInfoArray.SerializeToString,
),
'GetTimeSteps': grpc.unary_unary_rpc_method_handler(
servicer.GetTimeSteps,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=Case__pb2.TimeStepDates.SerializeToString,
),
'GetSelectedCells': grpc.unary_stream_rpc_method_handler(
servicer.GetSelectedCells,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=Case__pb2.SelectedCells.SerializeToString,
),
'GetDaysSinceStart': grpc.unary_unary_rpc_method_handler(
servicer.GetDaysSinceStart,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=Case__pb2.DaysSinceStart.SerializeToString,
),
'GetCaseInfo': grpc.unary_unary_rpc_method_handler(
servicer.GetCaseInfo,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=Case__pb2.CaseInfo.SerializeToString,
),
'GetPdmObject': grpc.unary_unary_rpc_method_handler(
servicer.GetPdmObject,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=PdmObject__pb2.PdmObject.SerializeToString,
),
'GetReservoirBoundingBox': grpc.unary_unary_rpc_method_handler(
servicer.GetReservoirBoundingBox,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=Case__pb2.BoundingBox.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.Case', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
rpc_method_handlers = {
'GetGridCount': grpc.unary_unary_rpc_method_handler(
servicer.GetGridCount,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=Case__pb2.GridCount.SerializeToString,
),
'GetCellCount': grpc.unary_unary_rpc_method_handler(
servicer.GetCellCount,
request_deserializer=Case__pb2.CellInfoRequest.FromString,
response_serializer=Case__pb2.CellCount.SerializeToString,
),
'GetCellInfoForActiveCells': grpc.unary_stream_rpc_method_handler(
servicer.GetCellInfoForActiveCells,
request_deserializer=Case__pb2.CellInfoRequest.FromString,
response_serializer=Case__pb2.CellInfoArray.SerializeToString,
),
'GetCellCenterForActiveCells': grpc.unary_stream_rpc_method_handler(
servicer.GetCellCenterForActiveCells,
request_deserializer=Case__pb2.CellInfoRequest.FromString,
response_serializer=Definitions__pb2.CellCenters.SerializeToString,
),
'GetCellCornersForActiveCells': grpc.unary_stream_rpc_method_handler(
servicer.GetCellCornersForActiveCells,
request_deserializer=Case__pb2.CellInfoRequest.FromString,
response_serializer=Definitions__pb2.CellCornersArray.SerializeToString,
),
'GetCoarseningInfoArray': grpc.unary_unary_rpc_method_handler(
servicer.GetCoarseningInfoArray,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=Case__pb2.CoarseningInfoArray.SerializeToString,
),
'GetTimeSteps': grpc.unary_unary_rpc_method_handler(
servicer.GetTimeSteps,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=Case__pb2.TimeStepDates.SerializeToString,
),
'GetSelectedCells': grpc.unary_stream_rpc_method_handler(
servicer.GetSelectedCells,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=Case__pb2.SelectedCells.SerializeToString,
),
'GetDaysSinceStart': grpc.unary_unary_rpc_method_handler(
servicer.GetDaysSinceStart,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=Case__pb2.DaysSinceStart.SerializeToString,
),
'GetCaseInfo': grpc.unary_unary_rpc_method_handler(
servicer.GetCaseInfo,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=Case__pb2.CaseInfo.SerializeToString,
),
'GetPdmObject': grpc.unary_unary_rpc_method_handler(
servicer.GetPdmObject,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=PdmObject__pb2.PdmObject.SerializeToString,
),
'GetReservoirBoundingBox': grpc.unary_unary_rpc_method_handler(
servicer.GetReservoirBoundingBox,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=Case__pb2.BoundingBox.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.Case', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))

File diff suppressed because one or more lines are too long

View File

@ -5,52 +5,52 @@ import Commands_pb2 as Commands__pb2
class CommandsStub(object):
"""
The Commands service handles generic ResInsight RicfCommandObject-commands
The CommandParams is used to deduce command name from the chosen oneof-message
.. and the parameters are in the oneof-message itself.
Note that we several times duplicate nearly the same message. This is because
it is not recommended to reuse existing messages for different purposes.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Execute = channel.unary_unary(
'/rips.Commands/Execute',
request_serializer=Commands__pb2.CommandParams.SerializeToString,
response_deserializer=Commands__pb2.CommandReply.FromString,
The Commands service handles generic ResInsight RicfCommandObject-commands
The CommandParams is used to deduce command name from the chosen oneof-message
.. and the parameters are in the oneof-message itself.
Note that we several times duplicate nearly the same message. This is because
it is not recommended to reuse existing messages for different purposes.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Execute = channel.unary_unary(
'/rips.Commands/Execute',
request_serializer=Commands__pb2.CommandParams.SerializeToString,
response_deserializer=Commands__pb2.CommandReply.FromString,
)
class CommandsServicer(object):
"""
The Commands service handles generic ResInsight RicfCommandObject-commands
The CommandParams is used to deduce command name from the chosen oneof-message
.. and the parameters are in the oneof-message itself.
Note that we several times duplicate nearly the same message. This is because
it is not recommended to reuse existing messages for different purposes.
"""
"""
The Commands service handles generic ResInsight RicfCommandObject-commands
The CommandParams is used to deduce command name from the chosen oneof-message
.. and the parameters are in the oneof-message itself.
Note that we several times duplicate nearly the same message. This is because
it is not recommended to reuse existing messages for different purposes.
"""
def Execute(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Execute(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_CommandsServicer_to_server(servicer, server):
rpc_method_handlers = {
'Execute': grpc.unary_unary_rpc_method_handler(
servicer.Execute,
request_deserializer=Commands__pb2.CommandParams.FromString,
response_serializer=Commands__pb2.CommandReply.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.Commands', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
rpc_method_handlers = {
'Execute': grpc.unary_unary_rpc_method_handler(
servicer.Execute,
request_deserializer=Commands__pb2.CommandParams.FromString,
response_serializer=Commands__pb2.CommandReply.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.Commands', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))

View File

@ -2,314 +2,311 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: Definitions.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import reflection as _reflection
from google.protobuf import message as _message
from google.protobuf import descriptor as _descriptor
import sys
_b = sys.version_info[0] < 3 and (
lambda x: x) or (lambda x: x.encode('latin1'))
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='Definitions.proto',
package='rips',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\x11\x44\x65\x66initions.proto\x12\x04rips\"\x07\n\x05\x45mpty\"9\n\x19\x43lientToServerStreamReply\x12\x1c\n\x14\x61\x63\x63\x65pted_value_count\x18\x01 \x01(\x03\"(\n\x05Vec3i\x12\t\n\x01i\x18\x01 \x01(\x05\x12\t\n\x01j\x18\x02 \x01(\x05\x12\t\n\x01k\x18\x03 \x01(\x05\"(\n\x05Vec3d\x12\t\n\x01x\x18\x01 \x01(\x01\x12\t\n\x01y\x18\x02 \x01(\x01\x12\t\n\x01z\x18\x03 \x01(\x01\"+\n\x0b\x43\x65llCenters\x12\x1c\n\x07\x63\x65nters\x18\x01 \x03(\x0b\x32\x0b.rips.Vec3d\"\xd5\x01\n\x0b\x43\x65llCorners\x12\x17\n\x02\x63\x30\x18\x01 \x01(\x0b\x32\x0b.rips.Vec3d\x12\x17\n\x02\x63\x31\x18\x02 \x01(\x0b\x32\x0b.rips.Vec3d\x12\x17\n\x02\x63\x32\x18\x03 \x01(\x0b\x32\x0b.rips.Vec3d\x12\x17\n\x02\x63\x33\x18\x04 \x01(\x0b\x32\x0b.rips.Vec3d\x12\x17\n\x02\x63\x34\x18\x05 \x01(\x0b\x32\x0b.rips.Vec3d\x12\x17\n\x02\x63\x35\x18\x06 \x01(\x0b\x32\x0b.rips.Vec3d\x12\x17\n\x02\x63\x36\x18\x07 \x01(\x0b\x32\x0b.rips.Vec3d\x12\x17\n\x02\x63\x37\x18\x08 \x01(\x0b\x32\x0b.rips.Vec3d\"4\n\x10\x43\x65llCornersArray\x12 \n\x05\x63\x65lls\x18\x01 \x03(\x0b\x32\x11.rips.CellCornersb\x06proto3')
name='Definitions.proto',
package='rips',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\x11\x44\x65\x66initions.proto\x12\x04rips\"\x07\n\x05\x45mpty\"9\n\x19\x43lientToServerStreamReply\x12\x1c\n\x14\x61\x63\x63\x65pted_value_count\x18\x01 \x01(\x03\"(\n\x05Vec3i\x12\t\n\x01i\x18\x01 \x01(\x05\x12\t\n\x01j\x18\x02 \x01(\x05\x12\t\n\x01k\x18\x03 \x01(\x05\"(\n\x05Vec3d\x12\t\n\x01x\x18\x01 \x01(\x01\x12\t\n\x01y\x18\x02 \x01(\x01\x12\t\n\x01z\x18\x03 \x01(\x01\"+\n\x0b\x43\x65llCenters\x12\x1c\n\x07\x63\x65nters\x18\x01 \x03(\x0b\x32\x0b.rips.Vec3d\"\xd5\x01\n\x0b\x43\x65llCorners\x12\x17\n\x02\x63\x30\x18\x01 \x01(\x0b\x32\x0b.rips.Vec3d\x12\x17\n\x02\x63\x31\x18\x02 \x01(\x0b\x32\x0b.rips.Vec3d\x12\x17\n\x02\x63\x32\x18\x03 \x01(\x0b\x32\x0b.rips.Vec3d\x12\x17\n\x02\x63\x33\x18\x04 \x01(\x0b\x32\x0b.rips.Vec3d\x12\x17\n\x02\x63\x34\x18\x05 \x01(\x0b\x32\x0b.rips.Vec3d\x12\x17\n\x02\x63\x35\x18\x06 \x01(\x0b\x32\x0b.rips.Vec3d\x12\x17\n\x02\x63\x36\x18\x07 \x01(\x0b\x32\x0b.rips.Vec3d\x12\x17\n\x02\x63\x37\x18\x08 \x01(\x0b\x32\x0b.rips.Vec3d\"4\n\x10\x43\x65llCornersArray\x12 \n\x05\x63\x65lls\x18\x01 \x03(\x0b\x32\x11.rips.CellCornersb\x06proto3')
)
_EMPTY = _descriptor.Descriptor(
name='Empty',
full_name='rips.Empty',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=27,
serialized_end=34,
name='Empty',
full_name='rips.Empty',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=27,
serialized_end=34,
)
_CLIENTTOSERVERSTREAMREPLY = _descriptor.Descriptor(
name='ClientToServerStreamReply',
full_name='rips.ClientToServerStreamReply',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='accepted_value_count', full_name='rips.ClientToServerStreamReply.accepted_value_count', index=0,
number=1, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=36,
serialized_end=93,
name='ClientToServerStreamReply',
full_name='rips.ClientToServerStreamReply',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='accepted_value_count', full_name='rips.ClientToServerStreamReply.accepted_value_count', index=0,
number=1, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=36,
serialized_end=93,
)
_VEC3I = _descriptor.Descriptor(
name='Vec3i',
full_name='rips.Vec3i',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='i', full_name='rips.Vec3i.i', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='j', full_name='rips.Vec3i.j', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='k', full_name='rips.Vec3i.k', index=2,
number=3, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=95,
serialized_end=135,
name='Vec3i',
full_name='rips.Vec3i',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='i', full_name='rips.Vec3i.i', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='j', full_name='rips.Vec3i.j', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='k', full_name='rips.Vec3i.k', index=2,
number=3, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=95,
serialized_end=135,
)
_VEC3D = _descriptor.Descriptor(
name='Vec3d',
full_name='rips.Vec3d',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='x', full_name='rips.Vec3d.x', index=0,
number=1, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='y', full_name='rips.Vec3d.y', index=1,
number=2, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='z', full_name='rips.Vec3d.z', index=2,
number=3, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=137,
serialized_end=177,
name='Vec3d',
full_name='rips.Vec3d',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='x', full_name='rips.Vec3d.x', index=0,
number=1, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='y', full_name='rips.Vec3d.y', index=1,
number=2, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='z', full_name='rips.Vec3d.z', index=2,
number=3, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=137,
serialized_end=177,
)
_CELLCENTERS = _descriptor.Descriptor(
name='CellCenters',
full_name='rips.CellCenters',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='centers', full_name='rips.CellCenters.centers', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=179,
serialized_end=222,
name='CellCenters',
full_name='rips.CellCenters',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='centers', full_name='rips.CellCenters.centers', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=179,
serialized_end=222,
)
_CELLCORNERS = _descriptor.Descriptor(
name='CellCorners',
full_name='rips.CellCorners',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='c0', full_name='rips.CellCorners.c0', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='c1', full_name='rips.CellCorners.c1', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='c2', full_name='rips.CellCorners.c2', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='c3', full_name='rips.CellCorners.c3', index=3,
number=4, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='c4', full_name='rips.CellCorners.c4', index=4,
number=5, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='c5', full_name='rips.CellCorners.c5', index=5,
number=6, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='c6', full_name='rips.CellCorners.c6', index=6,
number=7, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='c7', full_name='rips.CellCorners.c7', index=7,
number=8, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=225,
serialized_end=438,
name='CellCorners',
full_name='rips.CellCorners',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='c0', full_name='rips.CellCorners.c0', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='c1', full_name='rips.CellCorners.c1', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='c2', full_name='rips.CellCorners.c2', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='c3', full_name='rips.CellCorners.c3', index=3,
number=4, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='c4', full_name='rips.CellCorners.c4', index=4,
number=5, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='c5', full_name='rips.CellCorners.c5', index=5,
number=6, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='c6', full_name='rips.CellCorners.c6', index=6,
number=7, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='c7', full_name='rips.CellCorners.c7', index=7,
number=8, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=225,
serialized_end=438,
)
_CELLCORNERSARRAY = _descriptor.Descriptor(
name='CellCornersArray',
full_name='rips.CellCornersArray',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='cells', full_name='rips.CellCornersArray.cells', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=440,
serialized_end=492,
name='CellCornersArray',
full_name='rips.CellCornersArray',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='cells', full_name='rips.CellCornersArray.cells', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=440,
serialized_end=492,
)
_CELLCENTERS.fields_by_name['centers'].message_type = _VEC3D
@ -332,52 +329,52 @@ DESCRIPTOR.message_types_by_name['CellCornersArray'] = _CELLCORNERSARRAY
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), dict(
DESCRIPTOR = _EMPTY,
__module__ = 'Definitions_pb2'
# @@protoc_insertion_point(class_scope:rips.Empty)
))
DESCRIPTOR=_EMPTY,
__module__='Definitions_pb2'
# @@protoc_insertion_point(class_scope:rips.Empty)
))
_sym_db.RegisterMessage(Empty)
ClientToServerStreamReply = _reflection.GeneratedProtocolMessageType('ClientToServerStreamReply', (_message.Message,), dict(
DESCRIPTOR = _CLIENTTOSERVERSTREAMREPLY,
__module__ = 'Definitions_pb2'
# @@protoc_insertion_point(class_scope:rips.ClientToServerStreamReply)
))
DESCRIPTOR=_CLIENTTOSERVERSTREAMREPLY,
__module__='Definitions_pb2'
# @@protoc_insertion_point(class_scope:rips.ClientToServerStreamReply)
))
_sym_db.RegisterMessage(ClientToServerStreamReply)
Vec3i = _reflection.GeneratedProtocolMessageType('Vec3i', (_message.Message,), dict(
DESCRIPTOR = _VEC3I,
__module__ = 'Definitions_pb2'
# @@protoc_insertion_point(class_scope:rips.Vec3i)
))
DESCRIPTOR=_VEC3I,
__module__='Definitions_pb2'
# @@protoc_insertion_point(class_scope:rips.Vec3i)
))
_sym_db.RegisterMessage(Vec3i)
Vec3d = _reflection.GeneratedProtocolMessageType('Vec3d', (_message.Message,), dict(
DESCRIPTOR = _VEC3D,
__module__ = 'Definitions_pb2'
# @@protoc_insertion_point(class_scope:rips.Vec3d)
))
DESCRIPTOR=_VEC3D,
__module__='Definitions_pb2'
# @@protoc_insertion_point(class_scope:rips.Vec3d)
))
_sym_db.RegisterMessage(Vec3d)
CellCenters = _reflection.GeneratedProtocolMessageType('CellCenters', (_message.Message,), dict(
DESCRIPTOR = _CELLCENTERS,
__module__ = 'Definitions_pb2'
# @@protoc_insertion_point(class_scope:rips.CellCenters)
))
DESCRIPTOR=_CELLCENTERS,
__module__='Definitions_pb2'
# @@protoc_insertion_point(class_scope:rips.CellCenters)
))
_sym_db.RegisterMessage(CellCenters)
CellCorners = _reflection.GeneratedProtocolMessageType('CellCorners', (_message.Message,), dict(
DESCRIPTOR = _CELLCORNERS,
__module__ = 'Definitions_pb2'
# @@protoc_insertion_point(class_scope:rips.CellCorners)
))
DESCRIPTOR=_CELLCORNERS,
__module__='Definitions_pb2'
# @@protoc_insertion_point(class_scope:rips.CellCorners)
))
_sym_db.RegisterMessage(CellCorners)
CellCornersArray = _reflection.GeneratedProtocolMessageType('CellCornersArray', (_message.Message,), dict(
DESCRIPTOR = _CELLCORNERSARRAY,
__module__ = 'Definitions_pb2'
# @@protoc_insertion_point(class_scope:rips.CellCornersArray)
))
DESCRIPTOR=_CELLCORNERSARRAY,
__module__='Definitions_pb2'
# @@protoc_insertion_point(class_scope:rips.CellCornersArray)
))
_sym_db.RegisterMessage(CellCornersArray)

View File

@ -1,3 +1,2 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

View File

@ -2,99 +2,95 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: Grid.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
import Case_pb2 as Case__pb2
import Definitions_pb2 as Definitions__pb2
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import reflection as _reflection
from google.protobuf import message as _message
from google.protobuf import descriptor as _descriptor
import sys
_b = sys.version_info[0] < 3 and (
lambda x: x) or (lambda x: x.encode('latin1'))
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
import Definitions_pb2 as Definitions__pb2
import Case_pb2 as Case__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='Grid.proto',
package='rips',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\nGrid.proto\x12\x04rips\x1a\x11\x44\x65\x66initions.proto\x1a\nCase.proto\"J\n\x0bGridRequest\x12\'\n\x0c\x63\x61se_request\x18\x01 \x01(\x0b\x32\x11.rips.CaseRequest\x12\x12\n\ngrid_index\x18\x02 \x01(\x05\"1\n\x0eGridDimensions\x12\x1f\n\ndimensions\x18\x01 \x01(\x0b\x32\x0b.rips.Vec3i2\xbf\x01\n\x04Grid\x12:\n\x0eGetCellCenters\x12\x11.rips.GridRequest\x1a\x11.rips.CellCenters\"\x00\x30\x01\x12?\n\x0eGetCellCorners\x12\x11.rips.GridRequest\x1a\x16.rips.CellCornersArray\"\x00\x30\x01\x12:\n\rGetDimensions\x12\x11.rips.GridRequest\x1a\x14.rips.GridDimensions\"\x00\x62\x06proto3')
,
dependencies=[Definitions__pb2.DESCRIPTOR,Case__pb2.DESCRIPTOR,])
name='Grid.proto',
package='rips',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\nGrid.proto\x12\x04rips\x1a\x11\x44\x65\x66initions.proto\x1a\nCase.proto\"J\n\x0bGridRequest\x12\'\n\x0c\x63\x61se_request\x18\x01 \x01(\x0b\x32\x11.rips.CaseRequest\x12\x12\n\ngrid_index\x18\x02 \x01(\x05\"1\n\x0eGridDimensions\x12\x1f\n\ndimensions\x18\x01 \x01(\x0b\x32\x0b.rips.Vec3i2\xbf\x01\n\x04Grid\x12:\n\x0eGetCellCenters\x12\x11.rips.GridRequest\x1a\x11.rips.CellCenters\"\x00\x30\x01\x12?\n\x0eGetCellCorners\x12\x11.rips.GridRequest\x1a\x16.rips.CellCornersArray\"\x00\x30\x01\x12:\n\rGetDimensions\x12\x11.rips.GridRequest\x1a\x14.rips.GridDimensions\"\x00\x62\x06proto3'),
dependencies=[Definitions__pb2.DESCRIPTOR, Case__pb2.DESCRIPTOR, ])
_GRIDREQUEST = _descriptor.Descriptor(
name='GridRequest',
full_name='rips.GridRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='case_request', full_name='rips.GridRequest.case_request', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='grid_index', full_name='rips.GridRequest.grid_index', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=51,
serialized_end=125,
name='GridRequest',
full_name='rips.GridRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='case_request', full_name='rips.GridRequest.case_request', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='grid_index', full_name='rips.GridRequest.grid_index', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=51,
serialized_end=125,
)
_GRIDDIMENSIONS = _descriptor.Descriptor(
name='GridDimensions',
full_name='rips.GridDimensions',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='dimensions', full_name='rips.GridDimensions.dimensions', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=127,
serialized_end=176,
name='GridDimensions',
full_name='rips.GridDimensions',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='dimensions', full_name='rips.GridDimensions.dimensions', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=127,
serialized_end=176,
)
_GRIDREQUEST.fields_by_name['case_request'].message_type = Case__pb2._CASEREQUEST
@ -104,58 +100,57 @@ DESCRIPTOR.message_types_by_name['GridDimensions'] = _GRIDDIMENSIONS
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
GridRequest = _reflection.GeneratedProtocolMessageType('GridRequest', (_message.Message,), dict(
DESCRIPTOR = _GRIDREQUEST,
__module__ = 'Grid_pb2'
# @@protoc_insertion_point(class_scope:rips.GridRequest)
))
DESCRIPTOR=_GRIDREQUEST,
__module__='Grid_pb2'
# @@protoc_insertion_point(class_scope:rips.GridRequest)
))
_sym_db.RegisterMessage(GridRequest)
GridDimensions = _reflection.GeneratedProtocolMessageType('GridDimensions', (_message.Message,), dict(
DESCRIPTOR = _GRIDDIMENSIONS,
__module__ = 'Grid_pb2'
# @@protoc_insertion_point(class_scope:rips.GridDimensions)
))
DESCRIPTOR=_GRIDDIMENSIONS,
__module__='Grid_pb2'
# @@protoc_insertion_point(class_scope:rips.GridDimensions)
))
_sym_db.RegisterMessage(GridDimensions)
_GRID = _descriptor.ServiceDescriptor(
name='Grid',
full_name='rips.Grid',
file=DESCRIPTOR,
index=0,
serialized_options=None,
serialized_start=179,
serialized_end=370,
methods=[
_descriptor.MethodDescriptor(
name='GetCellCenters',
full_name='rips.Grid.GetCellCenters',
name='Grid',
full_name='rips.Grid',
file=DESCRIPTOR,
index=0,
containing_service=None,
input_type=_GRIDREQUEST,
output_type=Definitions__pb2._CELLCENTERS,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetCellCorners',
full_name='rips.Grid.GetCellCorners',
index=1,
containing_service=None,
input_type=_GRIDREQUEST,
output_type=Definitions__pb2._CELLCORNERSARRAY,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetDimensions',
full_name='rips.Grid.GetDimensions',
index=2,
containing_service=None,
input_type=_GRIDREQUEST,
output_type=_GRIDDIMENSIONS,
serialized_options=None,
),
])
serialized_start=179,
serialized_end=370,
methods=[
_descriptor.MethodDescriptor(
name='GetCellCenters',
full_name='rips.Grid.GetCellCenters',
index=0,
containing_service=None,
input_type=_GRIDREQUEST,
output_type=Definitions__pb2._CELLCENTERS,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetCellCorners',
full_name='rips.Grid.GetCellCorners',
index=1,
containing_service=None,
input_type=_GRIDREQUEST,
output_type=Definitions__pb2._CELLCORNERSARRAY,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetDimensions',
full_name='rips.Grid.GetDimensions',
index=2,
containing_service=None,
input_type=_GRIDREQUEST,
output_type=_GRIDDIMENSIONS,
serialized_options=None,
),
])
_sym_db.RegisterServiceDescriptor(_GRID)
DESCRIPTOR.services_by_name['Grid'] = _GRID

View File

@ -6,76 +6,76 @@ import Grid_pb2 as Grid__pb2
class GridStub(object):
# missing associated documentation comment in .proto file
pass
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GetCellCenters = channel.unary_stream(
'/rips.Grid/GetCellCenters',
request_serializer=Grid__pb2.GridRequest.SerializeToString,
response_deserializer=Definitions__pb2.CellCenters.FromString,
Args:
channel: A grpc.Channel.
"""
self.GetCellCenters = channel.unary_stream(
'/rips.Grid/GetCellCenters',
request_serializer=Grid__pb2.GridRequest.SerializeToString,
response_deserializer=Definitions__pb2.CellCenters.FromString,
)
self.GetCellCorners = channel.unary_stream(
'/rips.Grid/GetCellCorners',
request_serializer=Grid__pb2.GridRequest.SerializeToString,
response_deserializer=Definitions__pb2.CellCornersArray.FromString,
self.GetCellCorners = channel.unary_stream(
'/rips.Grid/GetCellCorners',
request_serializer=Grid__pb2.GridRequest.SerializeToString,
response_deserializer=Definitions__pb2.CellCornersArray.FromString,
)
self.GetDimensions = channel.unary_unary(
'/rips.Grid/GetDimensions',
request_serializer=Grid__pb2.GridRequest.SerializeToString,
response_deserializer=Grid__pb2.GridDimensions.FromString,
self.GetDimensions = channel.unary_unary(
'/rips.Grid/GetDimensions',
request_serializer=Grid__pb2.GridRequest.SerializeToString,
response_deserializer=Grid__pb2.GridDimensions.FromString,
)
class GridServicer(object):
# missing associated documentation comment in .proto file
pass
def GetCellCenters(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCellCorners(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCellCenters(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetDimensions(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCellCorners(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetDimensions(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_GridServicer_to_server(servicer, server):
rpc_method_handlers = {
'GetCellCenters': grpc.unary_stream_rpc_method_handler(
servicer.GetCellCenters,
request_deserializer=Grid__pb2.GridRequest.FromString,
response_serializer=Definitions__pb2.CellCenters.SerializeToString,
),
'GetCellCorners': grpc.unary_stream_rpc_method_handler(
servicer.GetCellCorners,
request_deserializer=Grid__pb2.GridRequest.FromString,
response_serializer=Definitions__pb2.CellCornersArray.SerializeToString,
),
'GetDimensions': grpc.unary_unary_rpc_method_handler(
servicer.GetDimensions,
request_deserializer=Grid__pb2.GridRequest.FromString,
response_serializer=Grid__pb2.GridDimensions.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.Grid', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
rpc_method_handlers = {
'GetCellCenters': grpc.unary_stream_rpc_method_handler(
servicer.GetCellCenters,
request_deserializer=Grid__pb2.GridRequest.FromString,
response_serializer=Definitions__pb2.CellCenters.SerializeToString,
),
'GetCellCorners': grpc.unary_stream_rpc_method_handler(
servicer.GetCellCorners,
request_deserializer=Grid__pb2.GridRequest.FromString,
response_serializer=Definitions__pb2.CellCornersArray.SerializeToString,
),
'GetDimensions': grpc.unary_unary_rpc_method_handler(
servicer.GetDimensions,
request_deserializer=Grid__pb2.GridRequest.FromString,
response_serializer=Grid__pb2.GridDimensions.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.Grid', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))

View File

@ -2,54 +2,52 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: NNCProperties.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
import Definitions_pb2 as Definitions__pb2
import Case_pb2 as Case__pb2
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import reflection as _reflection
from google.protobuf import message as _message
from google.protobuf import descriptor as _descriptor
from google.protobuf.internal import enum_type_wrapper
import sys
_b = sys.version_info[0] < 3 and (
lambda x: x) or (lambda x: x.encode('latin1'))
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
import Case_pb2 as Case__pb2
import Definitions_pb2 as Definitions__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='NNCProperties.proto',
package='rips',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\x13NNCProperties.proto\x12\x04rips\x1a\nCase.proto\x1a\x11\x44\x65\x66initions.proto\"R\n\x14\x41vailableNNCProperty\x12\x0c\n\x04name\x18\x01 \x01(\t\x12,\n\rproperty_type\x18\x02 \x01(\x0e\x32\x15.rips.NNCPropertyType\"H\n\x16\x41vailableNNCProperties\x12.\n\nproperties\x18\x01 \x03(\x0b\x32\x1a.rips.AvailableNNCProperty\"{\n\rNNCConnection\x12\x18\n\x10\x63\x65ll_grid_index1\x18\x01 \x01(\x05\x12\x18\n\x10\x63\x65ll_grid_index2\x18\x02 \x01(\x05\x12\x1a\n\x05\x63\x65ll1\x18\x03 \x01(\x0b\x32\x0b.rips.Vec3i\x12\x1a\n\x05\x63\x65ll2\x18\x04 \x01(\x0b\x32\x0b.rips.Vec3i\":\n\x0eNNCConnections\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.rips.NNCConnection\"{\n\x10NNCValuesRequest\x12\x0f\n\x07\x63\x61se_id\x18\x01 \x01(\x05\x12\x15\n\rproperty_name\x18\x02 \x01(\t\x12,\n\rproperty_type\x18\x03 \x01(\x0e\x32\x15.rips.NNCPropertyType\x12\x11\n\ttime_step\x18\x04 \x01(\x05\"\x1b\n\tNNCValues\x12\x0e\n\x06values\x18\x01 \x03(\x01\"\x83\x01\n\x15NNCValuesInputRequest\x12\x0f\n\x07\x63\x61se_id\x18\x01 \x01(\x05\x12\x15\n\rproperty_name\x18\x02 \x01(\t\x12/\n\x0eporosity_model\x18\x03 \x01(\x0e\x32\x17.rips.PorosityModelType\x12\x11\n\ttime_step\x18\x04 \x01(\x05\"o\n\x0eNNCValuesChunk\x12-\n\x06params\x18\x01 \x01(\x0b\x32\x1b.rips.NNCValuesInputRequestH\x00\x12!\n\x06values\x18\x02 \x01(\x0b\x32\x0f.rips.NNCValuesH\x00\x42\x0b\n\tChunkType*E\n\x0fNNCPropertyType\x12\x0f\n\x0bNNC_DYNAMIC\x10\x00\x12\x0e\n\nNNC_STATIC\x10\x01\x12\x11\n\rNNC_GENERATED\x10\x02\x32\xa9\x02\n\rNNCProperties\x12N\n\x19GetAvailableNNCProperties\x12\x11.rips.CaseRequest\x1a\x1c.rips.AvailableNNCProperties\"\x00\x12@\n\x11GetNNCConnections\x12\x11.rips.CaseRequest\x1a\x14.rips.NNCConnections\"\x00\x30\x01\x12;\n\x0cGetNNCValues\x12\x16.rips.NNCValuesRequest\x1a\x0f.rips.NNCValues\"\x00\x30\x01\x12I\n\x0cSetNNCValues\x12\x14.rips.NNCValuesChunk\x1a\x1f.rips.ClientToServerStreamReply\"\x00(\x01\x62\x06proto3')
,
dependencies=[Case__pb2.DESCRIPTOR,Definitions__pb2.DESCRIPTOR,])
name='NNCProperties.proto',
package='rips',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\x13NNCProperties.proto\x12\x04rips\x1a\nCase.proto\x1a\x11\x44\x65\x66initions.proto\"R\n\x14\x41vailableNNCProperty\x12\x0c\n\x04name\x18\x01 \x01(\t\x12,\n\rproperty_type\x18\x02 \x01(\x0e\x32\x15.rips.NNCPropertyType\"H\n\x16\x41vailableNNCProperties\x12.\n\nproperties\x18\x01 \x03(\x0b\x32\x1a.rips.AvailableNNCProperty\"{\n\rNNCConnection\x12\x18\n\x10\x63\x65ll_grid_index1\x18\x01 \x01(\x05\x12\x18\n\x10\x63\x65ll_grid_index2\x18\x02 \x01(\x05\x12\x1a\n\x05\x63\x65ll1\x18\x03 \x01(\x0b\x32\x0b.rips.Vec3i\x12\x1a\n\x05\x63\x65ll2\x18\x04 \x01(\x0b\x32\x0b.rips.Vec3i\":\n\x0eNNCConnections\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.rips.NNCConnection\"{\n\x10NNCValuesRequest\x12\x0f\n\x07\x63\x61se_id\x18\x01 \x01(\x05\x12\x15\n\rproperty_name\x18\x02 \x01(\t\x12,\n\rproperty_type\x18\x03 \x01(\x0e\x32\x15.rips.NNCPropertyType\x12\x11\n\ttime_step\x18\x04 \x01(\x05\"\x1b\n\tNNCValues\x12\x0e\n\x06values\x18\x01 \x03(\x01\"\x83\x01\n\x15NNCValuesInputRequest\x12\x0f\n\x07\x63\x61se_id\x18\x01 \x01(\x05\x12\x15\n\rproperty_name\x18\x02 \x01(\t\x12/\n\x0eporosity_model\x18\x03 \x01(\x0e\x32\x17.rips.PorosityModelType\x12\x11\n\ttime_step\x18\x04 \x01(\x05\"o\n\x0eNNCValuesChunk\x12-\n\x06params\x18\x01 \x01(\x0b\x32\x1b.rips.NNCValuesInputRequestH\x00\x12!\n\x06values\x18\x02 \x01(\x0b\x32\x0f.rips.NNCValuesH\x00\x42\x0b\n\tChunkType*E\n\x0fNNCPropertyType\x12\x0f\n\x0bNNC_DYNAMIC\x10\x00\x12\x0e\n\nNNC_STATIC\x10\x01\x12\x11\n\rNNC_GENERATED\x10\x02\x32\xa9\x02\n\rNNCProperties\x12N\n\x19GetAvailableNNCProperties\x12\x11.rips.CaseRequest\x1a\x1c.rips.AvailableNNCProperties\"\x00\x12@\n\x11GetNNCConnections\x12\x11.rips.CaseRequest\x1a\x14.rips.NNCConnections\"\x00\x30\x01\x12;\n\x0cGetNNCValues\x12\x16.rips.NNCValuesRequest\x1a\x0f.rips.NNCValues\"\x00\x30\x01\x12I\n\x0cSetNNCValues\x12\x14.rips.NNCValuesChunk\x1a\x1f.rips.ClientToServerStreamReply\"\x00(\x01\x62\x06proto3'),
dependencies=[Case__pb2.DESCRIPTOR, Definitions__pb2.DESCRIPTOR, ])
_NNCPROPERTYTYPE = _descriptor.EnumDescriptor(
name='NNCPropertyType',
full_name='rips.NNCPropertyType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='NNC_DYNAMIC', index=0, number=0,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='NNC_STATIC', index=1, number=1,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='NNC_GENERATED', index=2, number=2,
serialized_options=None,
type=None),
],
containing_type=None,
serialized_options=None,
serialized_start=804,
serialized_end=873,
name='NNCPropertyType',
full_name='rips.NNCPropertyType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='NNC_DYNAMIC', index=0, number=0,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='NNC_STATIC', index=1, number=1,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='NNC_GENERATED', index=2, number=2,
serialized_options=None,
type=None),
],
containing_type=None,
serialized_options=None,
serialized_start=804,
serialized_end=873,
)
_sym_db.RegisterEnumDescriptor(_NNCPROPERTYTYPE)
@ -59,332 +57,331 @@ NNC_STATIC = 1
NNC_GENERATED = 2
_AVAILABLENNCPROPERTY = _descriptor.Descriptor(
name='AvailableNNCProperty',
full_name='rips.AvailableNNCProperty',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='name', full_name='rips.AvailableNNCProperty.name', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='property_type', full_name='rips.AvailableNNCProperty.property_type', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=60,
serialized_end=142,
name='AvailableNNCProperty',
full_name='rips.AvailableNNCProperty',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='name', full_name='rips.AvailableNNCProperty.name', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='property_type', full_name='rips.AvailableNNCProperty.property_type', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=60,
serialized_end=142,
)
_AVAILABLENNCPROPERTIES = _descriptor.Descriptor(
name='AvailableNNCProperties',
full_name='rips.AvailableNNCProperties',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='properties', full_name='rips.AvailableNNCProperties.properties', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=144,
serialized_end=216,
name='AvailableNNCProperties',
full_name='rips.AvailableNNCProperties',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='properties', full_name='rips.AvailableNNCProperties.properties', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=144,
serialized_end=216,
)
_NNCCONNECTION = _descriptor.Descriptor(
name='NNCConnection',
full_name='rips.NNCConnection',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='cell_grid_index1', full_name='rips.NNCConnection.cell_grid_index1', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='cell_grid_index2', full_name='rips.NNCConnection.cell_grid_index2', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='cell1', full_name='rips.NNCConnection.cell1', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='cell2', full_name='rips.NNCConnection.cell2', index=3,
number=4, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=218,
serialized_end=341,
name='NNCConnection',
full_name='rips.NNCConnection',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='cell_grid_index1', full_name='rips.NNCConnection.cell_grid_index1', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='cell_grid_index2', full_name='rips.NNCConnection.cell_grid_index2', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='cell1', full_name='rips.NNCConnection.cell1', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='cell2', full_name='rips.NNCConnection.cell2', index=3,
number=4, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=218,
serialized_end=341,
)
_NNCCONNECTIONS = _descriptor.Descriptor(
name='NNCConnections',
full_name='rips.NNCConnections',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='connections', full_name='rips.NNCConnections.connections', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=343,
serialized_end=401,
name='NNCConnections',
full_name='rips.NNCConnections',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='connections', full_name='rips.NNCConnections.connections', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=343,
serialized_end=401,
)
_NNCVALUESREQUEST = _descriptor.Descriptor(
name='NNCValuesRequest',
full_name='rips.NNCValuesRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='case_id', full_name='rips.NNCValuesRequest.case_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='property_name', full_name='rips.NNCValuesRequest.property_name', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='property_type', full_name='rips.NNCValuesRequest.property_type', index=2,
number=3, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='time_step', full_name='rips.NNCValuesRequest.time_step', index=3,
number=4, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=403,
serialized_end=526,
name='NNCValuesRequest',
full_name='rips.NNCValuesRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='case_id', full_name='rips.NNCValuesRequest.case_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='property_name', full_name='rips.NNCValuesRequest.property_name', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='property_type', full_name='rips.NNCValuesRequest.property_type', index=2,
number=3, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='time_step', full_name='rips.NNCValuesRequest.time_step', index=3,
number=4, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=403,
serialized_end=526,
)
_NNCVALUES = _descriptor.Descriptor(
name='NNCValues',
full_name='rips.NNCValues',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='values', full_name='rips.NNCValues.values', index=0,
number=1, type=1, cpp_type=5, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=528,
serialized_end=555,
name='NNCValues',
full_name='rips.NNCValues',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='values', full_name='rips.NNCValues.values', index=0,
number=1, type=1, cpp_type=5, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=528,
serialized_end=555,
)
_NNCVALUESINPUTREQUEST = _descriptor.Descriptor(
name='NNCValuesInputRequest',
full_name='rips.NNCValuesInputRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='case_id', full_name='rips.NNCValuesInputRequest.case_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='property_name', full_name='rips.NNCValuesInputRequest.property_name', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='porosity_model', full_name='rips.NNCValuesInputRequest.porosity_model', index=2,
number=3, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='time_step', full_name='rips.NNCValuesInputRequest.time_step', index=3,
number=4, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=558,
serialized_end=689,
name='NNCValuesInputRequest',
full_name='rips.NNCValuesInputRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='case_id', full_name='rips.NNCValuesInputRequest.case_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='property_name', full_name='rips.NNCValuesInputRequest.property_name', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='porosity_model', full_name='rips.NNCValuesInputRequest.porosity_model', index=2,
number=3, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='time_step', full_name='rips.NNCValuesInputRequest.time_step', index=3,
number=4, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=558,
serialized_end=689,
)
_NNCVALUESCHUNK = _descriptor.Descriptor(
name='NNCValuesChunk',
full_name='rips.NNCValuesChunk',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='params', full_name='rips.NNCValuesChunk.params', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='values', full_name='rips.NNCValuesChunk.values', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
_descriptor.OneofDescriptor(
name='ChunkType', full_name='rips.NNCValuesChunk.ChunkType',
index=0, containing_type=None, fields=[]),
],
serialized_start=691,
serialized_end=802,
name='NNCValuesChunk',
full_name='rips.NNCValuesChunk',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='params', full_name='rips.NNCValuesChunk.params', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='values', full_name='rips.NNCValuesChunk.values', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
_descriptor.OneofDescriptor(
name='ChunkType', full_name='rips.NNCValuesChunk.ChunkType',
index=0, containing_type=None, fields=[]),
],
serialized_start=691,
serialized_end=802,
)
_AVAILABLENNCPROPERTY.fields_by_name['property_type'].enum_type = _NNCPROPERTYTYPE
@ -397,10 +394,10 @@ _NNCVALUESINPUTREQUEST.fields_by_name['porosity_model'].enum_type = Case__pb2._P
_NNCVALUESCHUNK.fields_by_name['params'].message_type = _NNCVALUESINPUTREQUEST
_NNCVALUESCHUNK.fields_by_name['values'].message_type = _NNCVALUES
_NNCVALUESCHUNK.oneofs_by_name['ChunkType'].fields.append(
_NNCVALUESCHUNK.fields_by_name['params'])
_NNCVALUESCHUNK.fields_by_name['params'])
_NNCVALUESCHUNK.fields_by_name['params'].containing_oneof = _NNCVALUESCHUNK.oneofs_by_name['ChunkType']
_NNCVALUESCHUNK.oneofs_by_name['ChunkType'].fields.append(
_NNCVALUESCHUNK.fields_by_name['values'])
_NNCVALUESCHUNK.fields_by_name['values'])
_NNCVALUESCHUNK.fields_by_name['values'].containing_oneof = _NNCVALUESCHUNK.oneofs_by_name['ChunkType']
DESCRIPTOR.message_types_by_name['AvailableNNCProperty'] = _AVAILABLENNCPROPERTY
DESCRIPTOR.message_types_by_name['AvailableNNCProperties'] = _AVAILABLENNCPROPERTIES
@ -414,109 +411,108 @@ DESCRIPTOR.enum_types_by_name['NNCPropertyType'] = _NNCPROPERTYTYPE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
AvailableNNCProperty = _reflection.GeneratedProtocolMessageType('AvailableNNCProperty', (_message.Message,), dict(
DESCRIPTOR = _AVAILABLENNCPROPERTY,
__module__ = 'NNCProperties_pb2'
# @@protoc_insertion_point(class_scope:rips.AvailableNNCProperty)
))
DESCRIPTOR=_AVAILABLENNCPROPERTY,
__module__='NNCProperties_pb2'
# @@protoc_insertion_point(class_scope:rips.AvailableNNCProperty)
))
_sym_db.RegisterMessage(AvailableNNCProperty)
AvailableNNCProperties = _reflection.GeneratedProtocolMessageType('AvailableNNCProperties', (_message.Message,), dict(
DESCRIPTOR = _AVAILABLENNCPROPERTIES,
__module__ = 'NNCProperties_pb2'
# @@protoc_insertion_point(class_scope:rips.AvailableNNCProperties)
))
DESCRIPTOR=_AVAILABLENNCPROPERTIES,
__module__='NNCProperties_pb2'
# @@protoc_insertion_point(class_scope:rips.AvailableNNCProperties)
))
_sym_db.RegisterMessage(AvailableNNCProperties)
NNCConnection = _reflection.GeneratedProtocolMessageType('NNCConnection', (_message.Message,), dict(
DESCRIPTOR = _NNCCONNECTION,
__module__ = 'NNCProperties_pb2'
# @@protoc_insertion_point(class_scope:rips.NNCConnection)
))
DESCRIPTOR=_NNCCONNECTION,
__module__='NNCProperties_pb2'
# @@protoc_insertion_point(class_scope:rips.NNCConnection)
))
_sym_db.RegisterMessage(NNCConnection)
NNCConnections = _reflection.GeneratedProtocolMessageType('NNCConnections', (_message.Message,), dict(
DESCRIPTOR = _NNCCONNECTIONS,
__module__ = 'NNCProperties_pb2'
# @@protoc_insertion_point(class_scope:rips.NNCConnections)
))
DESCRIPTOR=_NNCCONNECTIONS,
__module__='NNCProperties_pb2'
# @@protoc_insertion_point(class_scope:rips.NNCConnections)
))
_sym_db.RegisterMessage(NNCConnections)
NNCValuesRequest = _reflection.GeneratedProtocolMessageType('NNCValuesRequest', (_message.Message,), dict(
DESCRIPTOR = _NNCVALUESREQUEST,
__module__ = 'NNCProperties_pb2'
# @@protoc_insertion_point(class_scope:rips.NNCValuesRequest)
))
DESCRIPTOR=_NNCVALUESREQUEST,
__module__='NNCProperties_pb2'
# @@protoc_insertion_point(class_scope:rips.NNCValuesRequest)
))
_sym_db.RegisterMessage(NNCValuesRequest)
NNCValues = _reflection.GeneratedProtocolMessageType('NNCValues', (_message.Message,), dict(
DESCRIPTOR = _NNCVALUES,
__module__ = 'NNCProperties_pb2'
# @@protoc_insertion_point(class_scope:rips.NNCValues)
))
DESCRIPTOR=_NNCVALUES,
__module__='NNCProperties_pb2'
# @@protoc_insertion_point(class_scope:rips.NNCValues)
))
_sym_db.RegisterMessage(NNCValues)
NNCValuesInputRequest = _reflection.GeneratedProtocolMessageType('NNCValuesInputRequest', (_message.Message,), dict(
DESCRIPTOR = _NNCVALUESINPUTREQUEST,
__module__ = 'NNCProperties_pb2'
# @@protoc_insertion_point(class_scope:rips.NNCValuesInputRequest)
))
DESCRIPTOR=_NNCVALUESINPUTREQUEST,
__module__='NNCProperties_pb2'
# @@protoc_insertion_point(class_scope:rips.NNCValuesInputRequest)
))
_sym_db.RegisterMessage(NNCValuesInputRequest)
NNCValuesChunk = _reflection.GeneratedProtocolMessageType('NNCValuesChunk', (_message.Message,), dict(
DESCRIPTOR = _NNCVALUESCHUNK,
__module__ = 'NNCProperties_pb2'
# @@protoc_insertion_point(class_scope:rips.NNCValuesChunk)
))
DESCRIPTOR=_NNCVALUESCHUNK,
__module__='NNCProperties_pb2'
# @@protoc_insertion_point(class_scope:rips.NNCValuesChunk)
))
_sym_db.RegisterMessage(NNCValuesChunk)
_NNCPROPERTIES = _descriptor.ServiceDescriptor(
name='NNCProperties',
full_name='rips.NNCProperties',
file=DESCRIPTOR,
index=0,
serialized_options=None,
serialized_start=876,
serialized_end=1173,
methods=[
_descriptor.MethodDescriptor(
name='GetAvailableNNCProperties',
full_name='rips.NNCProperties.GetAvailableNNCProperties',
name='NNCProperties',
full_name='rips.NNCProperties',
file=DESCRIPTOR,
index=0,
containing_service=None,
input_type=Case__pb2._CASEREQUEST,
output_type=_AVAILABLENNCPROPERTIES,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetNNCConnections',
full_name='rips.NNCProperties.GetNNCConnections',
index=1,
containing_service=None,
input_type=Case__pb2._CASEREQUEST,
output_type=_NNCCONNECTIONS,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetNNCValues',
full_name='rips.NNCProperties.GetNNCValues',
index=2,
containing_service=None,
input_type=_NNCVALUESREQUEST,
output_type=_NNCVALUES,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='SetNNCValues',
full_name='rips.NNCProperties.SetNNCValues',
index=3,
containing_service=None,
input_type=_NNCVALUESCHUNK,
output_type=Definitions__pb2._CLIENTTOSERVERSTREAMREPLY,
serialized_options=None,
),
])
serialized_start=876,
serialized_end=1173,
methods=[
_descriptor.MethodDescriptor(
name='GetAvailableNNCProperties',
full_name='rips.NNCProperties.GetAvailableNNCProperties',
index=0,
containing_service=None,
input_type=Case__pb2._CASEREQUEST,
output_type=_AVAILABLENNCPROPERTIES,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetNNCConnections',
full_name='rips.NNCProperties.GetNNCConnections',
index=1,
containing_service=None,
input_type=Case__pb2._CASEREQUEST,
output_type=_NNCCONNECTIONS,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetNNCValues',
full_name='rips.NNCProperties.GetNNCValues',
index=2,
containing_service=None,
input_type=_NNCVALUESREQUEST,
output_type=_NNCVALUES,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='SetNNCValues',
full_name='rips.NNCProperties.SetNNCValues',
index=3,
containing_service=None,
input_type=_NNCVALUESCHUNK,
output_type=Definitions__pb2._CLIENTTOSERVERSTREAMREPLY,
serialized_options=None,
),
])
_sym_db.RegisterServiceDescriptor(_NNCPROPERTIES)
DESCRIPTOR.services_by_name['NNCProperties'] = _NNCPROPERTIES

View File

@ -7,93 +7,93 @@ import NNCProperties_pb2 as NNCProperties__pb2
class NNCPropertiesStub(object):
# missing associated documentation comment in .proto file
pass
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GetAvailableNNCProperties = channel.unary_unary(
'/rips.NNCProperties/GetAvailableNNCProperties',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=NNCProperties__pb2.AvailableNNCProperties.FromString,
Args:
channel: A grpc.Channel.
"""
self.GetAvailableNNCProperties = channel.unary_unary(
'/rips.NNCProperties/GetAvailableNNCProperties',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=NNCProperties__pb2.AvailableNNCProperties.FromString,
)
self.GetNNCConnections = channel.unary_stream(
'/rips.NNCProperties/GetNNCConnections',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=NNCProperties__pb2.NNCConnections.FromString,
self.GetNNCConnections = channel.unary_stream(
'/rips.NNCProperties/GetNNCConnections',
request_serializer=Case__pb2.CaseRequest.SerializeToString,
response_deserializer=NNCProperties__pb2.NNCConnections.FromString,
)
self.GetNNCValues = channel.unary_stream(
'/rips.NNCProperties/GetNNCValues',
request_serializer=NNCProperties__pb2.NNCValuesRequest.SerializeToString,
response_deserializer=NNCProperties__pb2.NNCValues.FromString,
self.GetNNCValues = channel.unary_stream(
'/rips.NNCProperties/GetNNCValues',
request_serializer=NNCProperties__pb2.NNCValuesRequest.SerializeToString,
response_deserializer=NNCProperties__pb2.NNCValues.FromString,
)
self.SetNNCValues = channel.stream_unary(
'/rips.NNCProperties/SetNNCValues',
request_serializer=NNCProperties__pb2.NNCValuesChunk.SerializeToString,
response_deserializer=Definitions__pb2.ClientToServerStreamReply.FromString,
self.SetNNCValues = channel.stream_unary(
'/rips.NNCProperties/SetNNCValues',
request_serializer=NNCProperties__pb2.NNCValuesChunk.SerializeToString,
response_deserializer=Definitions__pb2.ClientToServerStreamReply.FromString,
)
class NNCPropertiesServicer(object):
# missing associated documentation comment in .proto file
pass
def GetAvailableNNCProperties(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetNNCConnections(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetAvailableNNCProperties(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetNNCValues(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetNNCConnections(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SetNNCValues(self, request_iterator, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetNNCValues(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SetNNCValues(self, request_iterator, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_NNCPropertiesServicer_to_server(servicer, server):
rpc_method_handlers = {
'GetAvailableNNCProperties': grpc.unary_unary_rpc_method_handler(
servicer.GetAvailableNNCProperties,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=NNCProperties__pb2.AvailableNNCProperties.SerializeToString,
),
'GetNNCConnections': grpc.unary_stream_rpc_method_handler(
servicer.GetNNCConnections,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=NNCProperties__pb2.NNCConnections.SerializeToString,
),
'GetNNCValues': grpc.unary_stream_rpc_method_handler(
servicer.GetNNCValues,
request_deserializer=NNCProperties__pb2.NNCValuesRequest.FromString,
response_serializer=NNCProperties__pb2.NNCValues.SerializeToString,
),
'SetNNCValues': grpc.stream_unary_rpc_method_handler(
servicer.SetNNCValues,
request_deserializer=NNCProperties__pb2.NNCValuesChunk.FromString,
response_serializer=Definitions__pb2.ClientToServerStreamReply.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.NNCProperties', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
rpc_method_handlers = {
'GetAvailableNNCProperties': grpc.unary_unary_rpc_method_handler(
servicer.GetAvailableNNCProperties,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=NNCProperties__pb2.AvailableNNCProperties.SerializeToString,
),
'GetNNCConnections': grpc.unary_stream_rpc_method_handler(
servicer.GetNNCConnections,
request_deserializer=Case__pb2.CaseRequest.FromString,
response_serializer=NNCProperties__pb2.NNCConnections.SerializeToString,
),
'GetNNCValues': grpc.unary_stream_rpc_method_handler(
servicer.GetNNCValues,
request_deserializer=NNCProperties__pb2.NNCValuesRequest.FromString,
response_serializer=NNCProperties__pb2.NNCValues.SerializeToString,
),
'SetNNCValues': grpc.stream_unary_rpc_method_handler(
servicer.SetNNCValues,
request_deserializer=NNCProperties__pb2.NNCValuesChunk.FromString,
response_serializer=Definitions__pb2.ClientToServerStreamReply.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.NNCProperties', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))

File diff suppressed because it is too large Load Diff

View File

@ -6,161 +6,161 @@ import PdmObject_pb2 as PdmObject__pb2
class PdmObjectServiceStub(object):
# missing associated documentation comment in .proto file
pass
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GetDescendantPdmObjects = channel.unary_unary(
'/rips.PdmObjectService/GetDescendantPdmObjects',
request_serializer=PdmObject__pb2.PdmDescendantObjectRequest.SerializeToString,
response_deserializer=PdmObject__pb2.PdmObjectArray.FromString,
Args:
channel: A grpc.Channel.
"""
self.GetDescendantPdmObjects = channel.unary_unary(
'/rips.PdmObjectService/GetDescendantPdmObjects',
request_serializer=PdmObject__pb2.PdmDescendantObjectRequest.SerializeToString,
response_deserializer=PdmObject__pb2.PdmObjectArray.FromString,
)
self.GetChildPdmObjects = channel.unary_unary(
'/rips.PdmObjectService/GetChildPdmObjects',
request_serializer=PdmObject__pb2.PdmChildObjectRequest.SerializeToString,
response_deserializer=PdmObject__pb2.PdmObjectArray.FromString,
self.GetChildPdmObjects = channel.unary_unary(
'/rips.PdmObjectService/GetChildPdmObjects',
request_serializer=PdmObject__pb2.PdmChildObjectRequest.SerializeToString,
response_deserializer=PdmObject__pb2.PdmObjectArray.FromString,
)
self.GetAncestorPdmObject = channel.unary_unary(
'/rips.PdmObjectService/GetAncestorPdmObject',
request_serializer=PdmObject__pb2.PdmParentObjectRequest.SerializeToString,
response_deserializer=PdmObject__pb2.PdmObject.FromString,
self.GetAncestorPdmObject = channel.unary_unary(
'/rips.PdmObjectService/GetAncestorPdmObject',
request_serializer=PdmObject__pb2.PdmParentObjectRequest.SerializeToString,
response_deserializer=PdmObject__pb2.PdmObject.FromString,
)
self.CreateChildPdmObject = channel.unary_unary(
'/rips.PdmObjectService/CreateChildPdmObject',
request_serializer=PdmObject__pb2.CreatePdmChildObjectRequest.SerializeToString,
response_deserializer=PdmObject__pb2.PdmObject.FromString,
self.CreateChildPdmObject = channel.unary_unary(
'/rips.PdmObjectService/CreateChildPdmObject',
request_serializer=PdmObject__pb2.CreatePdmChildObjectRequest.SerializeToString,
response_deserializer=PdmObject__pb2.PdmObject.FromString,
)
self.UpdateExistingPdmObject = channel.unary_unary(
'/rips.PdmObjectService/UpdateExistingPdmObject',
request_serializer=PdmObject__pb2.PdmObject.SerializeToString,
response_deserializer=Definitions__pb2.Empty.FromString,
self.UpdateExistingPdmObject = channel.unary_unary(
'/rips.PdmObjectService/UpdateExistingPdmObject',
request_serializer=PdmObject__pb2.PdmObject.SerializeToString,
response_deserializer=Definitions__pb2.Empty.FromString,
)
self.CallPdmObjectGetter = channel.unary_stream(
'/rips.PdmObjectService/CallPdmObjectGetter',
request_serializer=PdmObject__pb2.PdmObjectGetterRequest.SerializeToString,
response_deserializer=PdmObject__pb2.PdmObjectGetterReply.FromString,
self.CallPdmObjectGetter = channel.unary_stream(
'/rips.PdmObjectService/CallPdmObjectGetter',
request_serializer=PdmObject__pb2.PdmObjectGetterRequest.SerializeToString,
response_deserializer=PdmObject__pb2.PdmObjectGetterReply.FromString,
)
self.CallPdmObjectSetter = channel.stream_unary(
'/rips.PdmObjectService/CallPdmObjectSetter',
request_serializer=PdmObject__pb2.PdmObjectSetterChunk.SerializeToString,
response_deserializer=Definitions__pb2.ClientToServerStreamReply.FromString,
self.CallPdmObjectSetter = channel.stream_unary(
'/rips.PdmObjectService/CallPdmObjectSetter',
request_serializer=PdmObject__pb2.PdmObjectSetterChunk.SerializeToString,
response_deserializer=Definitions__pb2.ClientToServerStreamReply.FromString,
)
self.CallPdmObjectMethod = channel.unary_unary(
'/rips.PdmObjectService/CallPdmObjectMethod',
request_serializer=PdmObject__pb2.PdmObjectMethodRequest.SerializeToString,
response_deserializer=PdmObject__pb2.PdmObject.FromString,
self.CallPdmObjectMethod = channel.unary_unary(
'/rips.PdmObjectService/CallPdmObjectMethod',
request_serializer=PdmObject__pb2.PdmObjectMethodRequest.SerializeToString,
response_deserializer=PdmObject__pb2.PdmObject.FromString,
)
class PdmObjectServiceServicer(object):
# missing associated documentation comment in .proto file
pass
def GetDescendantPdmObjects(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetChildPdmObjects(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetDescendantPdmObjects(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetAncestorPdmObject(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetChildPdmObjects(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def CreateChildPdmObject(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetAncestorPdmObject(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def UpdateExistingPdmObject(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def CreateChildPdmObject(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def CallPdmObjectGetter(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def UpdateExistingPdmObject(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def CallPdmObjectSetter(self, request_iterator, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def CallPdmObjectGetter(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def CallPdmObjectMethod(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def CallPdmObjectSetter(self, request_iterator, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def CallPdmObjectMethod(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_PdmObjectServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'GetDescendantPdmObjects': grpc.unary_unary_rpc_method_handler(
servicer.GetDescendantPdmObjects,
request_deserializer=PdmObject__pb2.PdmDescendantObjectRequest.FromString,
response_serializer=PdmObject__pb2.PdmObjectArray.SerializeToString,
),
'GetChildPdmObjects': grpc.unary_unary_rpc_method_handler(
servicer.GetChildPdmObjects,
request_deserializer=PdmObject__pb2.PdmChildObjectRequest.FromString,
response_serializer=PdmObject__pb2.PdmObjectArray.SerializeToString,
),
'GetAncestorPdmObject': grpc.unary_unary_rpc_method_handler(
servicer.GetAncestorPdmObject,
request_deserializer=PdmObject__pb2.PdmParentObjectRequest.FromString,
response_serializer=PdmObject__pb2.PdmObject.SerializeToString,
),
'CreateChildPdmObject': grpc.unary_unary_rpc_method_handler(
servicer.CreateChildPdmObject,
request_deserializer=PdmObject__pb2.CreatePdmChildObjectRequest.FromString,
response_serializer=PdmObject__pb2.PdmObject.SerializeToString,
),
'UpdateExistingPdmObject': grpc.unary_unary_rpc_method_handler(
servicer.UpdateExistingPdmObject,
request_deserializer=PdmObject__pb2.PdmObject.FromString,
response_serializer=Definitions__pb2.Empty.SerializeToString,
),
'CallPdmObjectGetter': grpc.unary_stream_rpc_method_handler(
servicer.CallPdmObjectGetter,
request_deserializer=PdmObject__pb2.PdmObjectGetterRequest.FromString,
response_serializer=PdmObject__pb2.PdmObjectGetterReply.SerializeToString,
),
'CallPdmObjectSetter': grpc.stream_unary_rpc_method_handler(
servicer.CallPdmObjectSetter,
request_deserializer=PdmObject__pb2.PdmObjectSetterChunk.FromString,
response_serializer=Definitions__pb2.ClientToServerStreamReply.SerializeToString,
),
'CallPdmObjectMethod': grpc.unary_unary_rpc_method_handler(
servicer.CallPdmObjectMethod,
request_deserializer=PdmObject__pb2.PdmObjectMethodRequest.FromString,
response_serializer=PdmObject__pb2.PdmObject.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.PdmObjectService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
rpc_method_handlers = {
'GetDescendantPdmObjects': grpc.unary_unary_rpc_method_handler(
servicer.GetDescendantPdmObjects,
request_deserializer=PdmObject__pb2.PdmDescendantObjectRequest.FromString,
response_serializer=PdmObject__pb2.PdmObjectArray.SerializeToString,
),
'GetChildPdmObjects': grpc.unary_unary_rpc_method_handler(
servicer.GetChildPdmObjects,
request_deserializer=PdmObject__pb2.PdmChildObjectRequest.FromString,
response_serializer=PdmObject__pb2.PdmObjectArray.SerializeToString,
),
'GetAncestorPdmObject': grpc.unary_unary_rpc_method_handler(
servicer.GetAncestorPdmObject,
request_deserializer=PdmObject__pb2.PdmParentObjectRequest.FromString,
response_serializer=PdmObject__pb2.PdmObject.SerializeToString,
),
'CreateChildPdmObject': grpc.unary_unary_rpc_method_handler(
servicer.CreateChildPdmObject,
request_deserializer=PdmObject__pb2.CreatePdmChildObjectRequest.FromString,
response_serializer=PdmObject__pb2.PdmObject.SerializeToString,
),
'UpdateExistingPdmObject': grpc.unary_unary_rpc_method_handler(
servicer.UpdateExistingPdmObject,
request_deserializer=PdmObject__pb2.PdmObject.FromString,
response_serializer=Definitions__pb2.Empty.SerializeToString,
),
'CallPdmObjectGetter': grpc.unary_stream_rpc_method_handler(
servicer.CallPdmObjectGetter,
request_deserializer=PdmObject__pb2.PdmObjectGetterRequest.FromString,
response_serializer=PdmObject__pb2.PdmObjectGetterReply.SerializeToString,
),
'CallPdmObjectSetter': grpc.stream_unary_rpc_method_handler(
servicer.CallPdmObjectSetter,
request_deserializer=PdmObject__pb2.PdmObjectSetterChunk.FromString,
response_serializer=Definitions__pb2.ClientToServerStreamReply.SerializeToString,
),
'CallPdmObjectMethod': grpc.unary_unary_rpc_method_handler(
servicer.CallPdmObjectMethod,
request_deserializer=PdmObject__pb2.PdmObjectMethodRequest.FromString,
response_serializer=PdmObject__pb2.PdmObject.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.PdmObjectService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))

View File

@ -2,101 +2,97 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: Project.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
import PdmObject_pb2 as PdmObject__pb2
import Case_pb2 as Case__pb2
import Definitions_pb2 as Definitions__pb2
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import reflection as _reflection
from google.protobuf import message as _message
from google.protobuf import descriptor as _descriptor
import sys
_b = sys.version_info[0] < 3 and (
lambda x: x) or (lambda x: x.encode('latin1'))
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
import Definitions_pb2 as Definitions__pb2
import Case_pb2 as Case__pb2
import PdmObject_pb2 as PdmObject__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='Project.proto',
package='rips',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\rProject.proto\x12\x04rips\x1a\x11\x44\x65\x66initions.proto\x1a\nCase.proto\x1a\x0fPdmObject.proto2\xc8\x02\n\x07Project\x12\x32\n\x0eGetCurrentCase\x12\x0b.rips.Empty\x1a\x11.rips.CaseRequest\"\x00\x12\x36\n\x10GetSelectedCases\x12\x0b.rips.Empty\x1a\x13.rips.CaseInfoArray\"\x00\x12\x33\n\x10GetAllCaseGroups\x12\x0b.rips.Empty\x1a\x10.rips.CaseGroups\"\x00\x12\x31\n\x0bGetAllCases\x12\x0b.rips.Empty\x1a\x13.rips.CaseInfoArray\"\x00\x12\x39\n\x0fGetCasesInGroup\x12\x0f.rips.CaseGroup\x1a\x13.rips.CaseInfoArray\"\x00\x12.\n\x0cGetPdmObject\x12\x0b.rips.Empty\x1a\x0f.rips.PdmObject\"\x00\x62\x06proto3')
,
dependencies=[Definitions__pb2.DESCRIPTOR,Case__pb2.DESCRIPTOR,PdmObject__pb2.DESCRIPTOR,])
name='Project.proto',
package='rips',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\rProject.proto\x12\x04rips\x1a\x11\x44\x65\x66initions.proto\x1a\nCase.proto\x1a\x0fPdmObject.proto2\xc8\x02\n\x07Project\x12\x32\n\x0eGetCurrentCase\x12\x0b.rips.Empty\x1a\x11.rips.CaseRequest\"\x00\x12\x36\n\x10GetSelectedCases\x12\x0b.rips.Empty\x1a\x13.rips.CaseInfoArray\"\x00\x12\x33\n\x10GetAllCaseGroups\x12\x0b.rips.Empty\x1a\x10.rips.CaseGroups\"\x00\x12\x31\n\x0bGetAllCases\x12\x0b.rips.Empty\x1a\x13.rips.CaseInfoArray\"\x00\x12\x39\n\x0fGetCasesInGroup\x12\x0f.rips.CaseGroup\x1a\x13.rips.CaseInfoArray\"\x00\x12.\n\x0cGetPdmObject\x12\x0b.rips.Empty\x1a\x0f.rips.PdmObject\"\x00\x62\x06proto3'),
dependencies=[Definitions__pb2.DESCRIPTOR, Case__pb2.DESCRIPTOR, PdmObject__pb2.DESCRIPTOR, ])
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
_PROJECT = _descriptor.ServiceDescriptor(
name='Project',
full_name='rips.Project',
file=DESCRIPTOR,
index=0,
serialized_options=None,
serialized_start=72,
serialized_end=400,
methods=[
_descriptor.MethodDescriptor(
name='GetCurrentCase',
full_name='rips.Project.GetCurrentCase',
name='Project',
full_name='rips.Project',
file=DESCRIPTOR,
index=0,
containing_service=None,
input_type=Definitions__pb2._EMPTY,
output_type=Case__pb2._CASEREQUEST,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetSelectedCases',
full_name='rips.Project.GetSelectedCases',
index=1,
containing_service=None,
input_type=Definitions__pb2._EMPTY,
output_type=Case__pb2._CASEINFOARRAY,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetAllCaseGroups',
full_name='rips.Project.GetAllCaseGroups',
index=2,
containing_service=None,
input_type=Definitions__pb2._EMPTY,
output_type=Case__pb2._CASEGROUPS,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetAllCases',
full_name='rips.Project.GetAllCases',
index=3,
containing_service=None,
input_type=Definitions__pb2._EMPTY,
output_type=Case__pb2._CASEINFOARRAY,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetCasesInGroup',
full_name='rips.Project.GetCasesInGroup',
index=4,
containing_service=None,
input_type=Case__pb2._CASEGROUP,
output_type=Case__pb2._CASEINFOARRAY,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetPdmObject',
full_name='rips.Project.GetPdmObject',
index=5,
containing_service=None,
input_type=Definitions__pb2._EMPTY,
output_type=PdmObject__pb2._PDMOBJECT,
serialized_options=None,
),
])
serialized_start=72,
serialized_end=400,
methods=[
_descriptor.MethodDescriptor(
name='GetCurrentCase',
full_name='rips.Project.GetCurrentCase',
index=0,
containing_service=None,
input_type=Definitions__pb2._EMPTY,
output_type=Case__pb2._CASEREQUEST,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetSelectedCases',
full_name='rips.Project.GetSelectedCases',
index=1,
containing_service=None,
input_type=Definitions__pb2._EMPTY,
output_type=Case__pb2._CASEINFOARRAY,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetAllCaseGroups',
full_name='rips.Project.GetAllCaseGroups',
index=2,
containing_service=None,
input_type=Definitions__pb2._EMPTY,
output_type=Case__pb2._CASEGROUPS,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetAllCases',
full_name='rips.Project.GetAllCases',
index=3,
containing_service=None,
input_type=Definitions__pb2._EMPTY,
output_type=Case__pb2._CASEINFOARRAY,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetCasesInGroup',
full_name='rips.Project.GetCasesInGroup',
index=4,
containing_service=None,
input_type=Case__pb2._CASEGROUP,
output_type=Case__pb2._CASEINFOARRAY,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetPdmObject',
full_name='rips.Project.GetPdmObject',
index=5,
containing_service=None,
input_type=Definitions__pb2._EMPTY,
output_type=PdmObject__pb2._PDMOBJECT,
serialized_options=None,
),
])
_sym_db.RegisterServiceDescriptor(_PROJECT)
DESCRIPTOR.services_by_name['Project'] = _PROJECT

View File

@ -7,127 +7,127 @@ import PdmObject_pb2 as PdmObject__pb2
class ProjectStub(object):
# missing associated documentation comment in .proto file
pass
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GetCurrentCase = channel.unary_unary(
'/rips.Project/GetCurrentCase',
request_serializer=Definitions__pb2.Empty.SerializeToString,
response_deserializer=Case__pb2.CaseRequest.FromString,
Args:
channel: A grpc.Channel.
"""
self.GetCurrentCase = channel.unary_unary(
'/rips.Project/GetCurrentCase',
request_serializer=Definitions__pb2.Empty.SerializeToString,
response_deserializer=Case__pb2.CaseRequest.FromString,
)
self.GetSelectedCases = channel.unary_unary(
'/rips.Project/GetSelectedCases',
request_serializer=Definitions__pb2.Empty.SerializeToString,
response_deserializer=Case__pb2.CaseInfoArray.FromString,
self.GetSelectedCases = channel.unary_unary(
'/rips.Project/GetSelectedCases',
request_serializer=Definitions__pb2.Empty.SerializeToString,
response_deserializer=Case__pb2.CaseInfoArray.FromString,
)
self.GetAllCaseGroups = channel.unary_unary(
'/rips.Project/GetAllCaseGroups',
request_serializer=Definitions__pb2.Empty.SerializeToString,
response_deserializer=Case__pb2.CaseGroups.FromString,
self.GetAllCaseGroups = channel.unary_unary(
'/rips.Project/GetAllCaseGroups',
request_serializer=Definitions__pb2.Empty.SerializeToString,
response_deserializer=Case__pb2.CaseGroups.FromString,
)
self.GetAllCases = channel.unary_unary(
'/rips.Project/GetAllCases',
request_serializer=Definitions__pb2.Empty.SerializeToString,
response_deserializer=Case__pb2.CaseInfoArray.FromString,
self.GetAllCases = channel.unary_unary(
'/rips.Project/GetAllCases',
request_serializer=Definitions__pb2.Empty.SerializeToString,
response_deserializer=Case__pb2.CaseInfoArray.FromString,
)
self.GetCasesInGroup = channel.unary_unary(
'/rips.Project/GetCasesInGroup',
request_serializer=Case__pb2.CaseGroup.SerializeToString,
response_deserializer=Case__pb2.CaseInfoArray.FromString,
self.GetCasesInGroup = channel.unary_unary(
'/rips.Project/GetCasesInGroup',
request_serializer=Case__pb2.CaseGroup.SerializeToString,
response_deserializer=Case__pb2.CaseInfoArray.FromString,
)
self.GetPdmObject = channel.unary_unary(
'/rips.Project/GetPdmObject',
request_serializer=Definitions__pb2.Empty.SerializeToString,
response_deserializer=PdmObject__pb2.PdmObject.FromString,
self.GetPdmObject = channel.unary_unary(
'/rips.Project/GetPdmObject',
request_serializer=Definitions__pb2.Empty.SerializeToString,
response_deserializer=PdmObject__pb2.PdmObject.FromString,
)
class ProjectServicer(object):
# missing associated documentation comment in .proto file
pass
def GetCurrentCase(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetSelectedCases(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCurrentCase(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetAllCaseGroups(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetSelectedCases(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetAllCases(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetAllCaseGroups(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCasesInGroup(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetAllCases(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetPdmObject(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCasesInGroup(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetPdmObject(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_ProjectServicer_to_server(servicer, server):
rpc_method_handlers = {
'GetCurrentCase': grpc.unary_unary_rpc_method_handler(
servicer.GetCurrentCase,
request_deserializer=Definitions__pb2.Empty.FromString,
response_serializer=Case__pb2.CaseRequest.SerializeToString,
),
'GetSelectedCases': grpc.unary_unary_rpc_method_handler(
servicer.GetSelectedCases,
request_deserializer=Definitions__pb2.Empty.FromString,
response_serializer=Case__pb2.CaseInfoArray.SerializeToString,
),
'GetAllCaseGroups': grpc.unary_unary_rpc_method_handler(
servicer.GetAllCaseGroups,
request_deserializer=Definitions__pb2.Empty.FromString,
response_serializer=Case__pb2.CaseGroups.SerializeToString,
),
'GetAllCases': grpc.unary_unary_rpc_method_handler(
servicer.GetAllCases,
request_deserializer=Definitions__pb2.Empty.FromString,
response_serializer=Case__pb2.CaseInfoArray.SerializeToString,
),
'GetCasesInGroup': grpc.unary_unary_rpc_method_handler(
servicer.GetCasesInGroup,
request_deserializer=Case__pb2.CaseGroup.FromString,
response_serializer=Case__pb2.CaseInfoArray.SerializeToString,
),
'GetPdmObject': grpc.unary_unary_rpc_method_handler(
servicer.GetPdmObject,
request_deserializer=Definitions__pb2.Empty.FromString,
response_serializer=PdmObject__pb2.PdmObject.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.Project', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
rpc_method_handlers = {
'GetCurrentCase': grpc.unary_unary_rpc_method_handler(
servicer.GetCurrentCase,
request_deserializer=Definitions__pb2.Empty.FromString,
response_serializer=Case__pb2.CaseRequest.SerializeToString,
),
'GetSelectedCases': grpc.unary_unary_rpc_method_handler(
servicer.GetSelectedCases,
request_deserializer=Definitions__pb2.Empty.FromString,
response_serializer=Case__pb2.CaseInfoArray.SerializeToString,
),
'GetAllCaseGroups': grpc.unary_unary_rpc_method_handler(
servicer.GetAllCaseGroups,
request_deserializer=Definitions__pb2.Empty.FromString,
response_serializer=Case__pb2.CaseGroups.SerializeToString,
),
'GetAllCases': grpc.unary_unary_rpc_method_handler(
servicer.GetAllCases,
request_deserializer=Definitions__pb2.Empty.FromString,
response_serializer=Case__pb2.CaseInfoArray.SerializeToString,
),
'GetCasesInGroup': grpc.unary_unary_rpc_method_handler(
servicer.GetCasesInGroup,
request_deserializer=Case__pb2.CaseGroup.FromString,
response_serializer=Case__pb2.CaseInfoArray.SerializeToString,
),
'GetPdmObject': grpc.unary_unary_rpc_method_handler(
servicer.GetPdmObject,
request_deserializer=Definitions__pb2.Empty.FromString,
response_serializer=PdmObject__pb2.PdmObject.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.Project', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))

View File

@ -2,82 +2,80 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: Properties.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
import Case_pb2 as Case__pb2
import Definitions_pb2 as Definitions__pb2
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import reflection as _reflection
from google.protobuf import message as _message
from google.protobuf import descriptor as _descriptor
from google.protobuf.internal import enum_type_wrapper
import sys
_b = sys.version_info[0] < 3 and (
lambda x: x) or (lambda x: x.encode('latin1'))
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
import Definitions_pb2 as Definitions__pb2
import Case_pb2 as Case__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='Properties.proto',
package='rips',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\x10Properties.proto\x12\x04rips\x1a\x11\x44\x65\x66initions.proto\x1a\nCase.proto\"\xa1\x01\n\x1a\x41vailablePropertiesRequest\x12\'\n\x0c\x63\x61se_request\x18\x01 \x01(\x0b\x32\x11.rips.CaseRequest\x12)\n\rproperty_type\x18\x02 \x01(\x0e\x32\x12.rips.PropertyType\x12/\n\x0eporosity_model\x18\x03 \x01(\x0e\x32\x17.rips.PorosityModelType\"-\n\x13\x41vailableProperties\x12\x16\n\x0eproperty_names\x18\x01 \x03(\t\"\xd4\x01\n\x0fPropertyRequest\x12\'\n\x0c\x63\x61se_request\x18\x01 \x01(\x0b\x32\x11.rips.CaseRequest\x12)\n\rproperty_type\x18\x02 \x01(\x0e\x32\x12.rips.PropertyType\x12\x15\n\rproperty_name\x18\x03 \x01(\t\x12\x11\n\ttime_step\x18\x04 \x01(\x05\x12\x12\n\ngrid_index\x18\x05 \x01(\x05\x12/\n\x0eporosity_model\x18\x06 \x01(\x0e\x32\x17.rips.PorosityModelType\"\x19\n\x08TimeStep\x12\r\n\x05index\x18\x01 \x01(\x05\"q\n\x12PropertyInputChunk\x12\'\n\x06params\x18\x01 \x01(\x0b\x32\x15.rips.PropertyRequestH\x00\x12%\n\x06values\x18\x02 \x01(\x0b\x32\x13.rips.PropertyChunkH\x00\x42\x0b\n\tChunkType\"\x1f\n\rPropertyChunk\x12\x0e\n\x06values\x18\x01 \x03(\x01*\xc7\x01\n\x0cPropertyType\x12\x12\n\x0e\x44YNAMIC_NATIVE\x10\x00\x12\x11\n\rSTATIC_NATIVE\x10\x01\x12\r\n\tSOURSIMRL\x10\x02\x12\r\n\tGENERATED\x10\x03\x12\x12\n\x0eINPUT_PROPERTY\x10\x04\x12\x13\n\x0f\x46ORMATION_NAMES\x10\x05\x12\x14\n\x10\x46LOW_DIAGNOSTICS\x10\x06\x12\x16\n\x12INJECTION_FLOODING\x10\x07\x12\x0b\n\x07REMOVED\x10\x08\x12\x0e\n\tUNDEFINED\x10\xe7\x07\x32\xe6\x03\n\nProperties\x12W\n\x16GetAvailableProperties\x12 .rips.AvailablePropertiesRequest\x1a\x19.rips.AvailableProperties\"\x00\x12G\n\x15GetActiveCellProperty\x12\x15.rips.PropertyRequest\x1a\x13.rips.PropertyChunk\"\x00\x30\x01\x12I\n\x17GetSelectedCellProperty\x12\x15.rips.PropertyRequest\x1a\x13.rips.PropertyChunk\"\x00\x30\x01\x12\x41\n\x0fGetGridProperty\x12\x15.rips.PropertyRequest\x1a\x13.rips.PropertyChunk\"\x00\x30\x01\x12V\n\x15SetActiveCellProperty\x12\x18.rips.PropertyInputChunk\x1a\x1f.rips.ClientToServerStreamReply\"\x00(\x01\x12P\n\x0fSetGridProperty\x12\x18.rips.PropertyInputChunk\x1a\x1f.rips.ClientToServerStreamReply\"\x00(\x01\x62\x06proto3')
,
dependencies=[Definitions__pb2.DESCRIPTOR,Case__pb2.DESCRIPTOR,])
name='Properties.proto',
package='rips',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\x10Properties.proto\x12\x04rips\x1a\x11\x44\x65\x66initions.proto\x1a\nCase.proto\"\xa1\x01\n\x1a\x41vailablePropertiesRequest\x12\'\n\x0c\x63\x61se_request\x18\x01 \x01(\x0b\x32\x11.rips.CaseRequest\x12)\n\rproperty_type\x18\x02 \x01(\x0e\x32\x12.rips.PropertyType\x12/\n\x0eporosity_model\x18\x03 \x01(\x0e\x32\x17.rips.PorosityModelType\"-\n\x13\x41vailableProperties\x12\x16\n\x0eproperty_names\x18\x01 \x03(\t\"\xd4\x01\n\x0fPropertyRequest\x12\'\n\x0c\x63\x61se_request\x18\x01 \x01(\x0b\x32\x11.rips.CaseRequest\x12)\n\rproperty_type\x18\x02 \x01(\x0e\x32\x12.rips.PropertyType\x12\x15\n\rproperty_name\x18\x03 \x01(\t\x12\x11\n\ttime_step\x18\x04 \x01(\x05\x12\x12\n\ngrid_index\x18\x05 \x01(\x05\x12/\n\x0eporosity_model\x18\x06 \x01(\x0e\x32\x17.rips.PorosityModelType\"\x19\n\x08TimeStep\x12\r\n\x05index\x18\x01 \x01(\x05\"q\n\x12PropertyInputChunk\x12\'\n\x06params\x18\x01 \x01(\x0b\x32\x15.rips.PropertyRequestH\x00\x12%\n\x06values\x18\x02 \x01(\x0b\x32\x13.rips.PropertyChunkH\x00\x42\x0b\n\tChunkType\"\x1f\n\rPropertyChunk\x12\x0e\n\x06values\x18\x01 \x03(\x01*\xc7\x01\n\x0cPropertyType\x12\x12\n\x0e\x44YNAMIC_NATIVE\x10\x00\x12\x11\n\rSTATIC_NATIVE\x10\x01\x12\r\n\tSOURSIMRL\x10\x02\x12\r\n\tGENERATED\x10\x03\x12\x12\n\x0eINPUT_PROPERTY\x10\x04\x12\x13\n\x0f\x46ORMATION_NAMES\x10\x05\x12\x14\n\x10\x46LOW_DIAGNOSTICS\x10\x06\x12\x16\n\x12INJECTION_FLOODING\x10\x07\x12\x0b\n\x07REMOVED\x10\x08\x12\x0e\n\tUNDEFINED\x10\xe7\x07\x32\xe6\x03\n\nProperties\x12W\n\x16GetAvailableProperties\x12 .rips.AvailablePropertiesRequest\x1a\x19.rips.AvailableProperties\"\x00\x12G\n\x15GetActiveCellProperty\x12\x15.rips.PropertyRequest\x1a\x13.rips.PropertyChunk\"\x00\x30\x01\x12I\n\x17GetSelectedCellProperty\x12\x15.rips.PropertyRequest\x1a\x13.rips.PropertyChunk\"\x00\x30\x01\x12\x41\n\x0fGetGridProperty\x12\x15.rips.PropertyRequest\x1a\x13.rips.PropertyChunk\"\x00\x30\x01\x12V\n\x15SetActiveCellProperty\x12\x18.rips.PropertyInputChunk\x1a\x1f.rips.ClientToServerStreamReply\"\x00(\x01\x12P\n\x0fSetGridProperty\x12\x18.rips.PropertyInputChunk\x1a\x1f.rips.ClientToServerStreamReply\"\x00(\x01\x62\x06proto3'),
dependencies=[Definitions__pb2.DESCRIPTOR, Case__pb2.DESCRIPTOR, ])
_PROPERTYTYPE = _descriptor.EnumDescriptor(
name='PropertyType',
full_name='rips.PropertyType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='DYNAMIC_NATIVE', index=0, number=0,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='STATIC_NATIVE', index=1, number=1,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SOURSIMRL', index=2, number=2,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='GENERATED', index=3, number=3,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='INPUT_PROPERTY', index=4, number=4,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='FORMATION_NAMES', index=5, number=5,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='FLOW_DIAGNOSTICS', index=6, number=6,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='INJECTION_FLOODING', index=7, number=7,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='REMOVED', index=8, number=8,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='UNDEFINED', index=9, number=999,
serialized_options=None,
type=None),
],
containing_type=None,
serialized_options=None,
serialized_start=659,
serialized_end=858,
name='PropertyType',
full_name='rips.PropertyType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='DYNAMIC_NATIVE', index=0, number=0,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='STATIC_NATIVE', index=1, number=1,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SOURSIMRL', index=2, number=2,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='GENERATED', index=3, number=3,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='INPUT_PROPERTY', index=4, number=4,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='FORMATION_NAMES', index=5, number=5,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='FLOW_DIAGNOSTICS', index=6, number=6,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='INJECTION_FLOODING', index=7, number=7,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='REMOVED', index=8, number=8,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='UNDEFINED', index=9, number=999,
serialized_options=None,
type=None),
],
containing_type=None,
serialized_options=None,
serialized_start=659,
serialized_end=858,
)
_sym_db.RegisterEnumDescriptor(_PROPERTYTYPE)
@ -94,249 +92,248 @@ REMOVED = 8
UNDEFINED = 999
_AVAILABLEPROPERTIESREQUEST = _descriptor.Descriptor(
name='AvailablePropertiesRequest',
full_name='rips.AvailablePropertiesRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='case_request', full_name='rips.AvailablePropertiesRequest.case_request', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='property_type', full_name='rips.AvailablePropertiesRequest.property_type', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='porosity_model', full_name='rips.AvailablePropertiesRequest.porosity_model', index=2,
number=3, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=58,
serialized_end=219,
name='AvailablePropertiesRequest',
full_name='rips.AvailablePropertiesRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='case_request', full_name='rips.AvailablePropertiesRequest.case_request', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='property_type', full_name='rips.AvailablePropertiesRequest.property_type', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='porosity_model', full_name='rips.AvailablePropertiesRequest.porosity_model', index=2,
number=3, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=58,
serialized_end=219,
)
_AVAILABLEPROPERTIES = _descriptor.Descriptor(
name='AvailableProperties',
full_name='rips.AvailableProperties',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='property_names', full_name='rips.AvailableProperties.property_names', index=0,
number=1, type=9, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=221,
serialized_end=266,
name='AvailableProperties',
full_name='rips.AvailableProperties',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='property_names', full_name='rips.AvailableProperties.property_names', index=0,
number=1, type=9, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=221,
serialized_end=266,
)
_PROPERTYREQUEST = _descriptor.Descriptor(
name='PropertyRequest',
full_name='rips.PropertyRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='case_request', full_name='rips.PropertyRequest.case_request', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='property_type', full_name='rips.PropertyRequest.property_type', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='property_name', full_name='rips.PropertyRequest.property_name', index=2,
number=3, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='time_step', full_name='rips.PropertyRequest.time_step', index=3,
number=4, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='grid_index', full_name='rips.PropertyRequest.grid_index', index=4,
number=5, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='porosity_model', full_name='rips.PropertyRequest.porosity_model', index=5,
number=6, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=269,
serialized_end=481,
name='PropertyRequest',
full_name='rips.PropertyRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='case_request', full_name='rips.PropertyRequest.case_request', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='property_type', full_name='rips.PropertyRequest.property_type', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='property_name', full_name='rips.PropertyRequest.property_name', index=2,
number=3, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='time_step', full_name='rips.PropertyRequest.time_step', index=3,
number=4, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='grid_index', full_name='rips.PropertyRequest.grid_index', index=4,
number=5, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='porosity_model', full_name='rips.PropertyRequest.porosity_model', index=5,
number=6, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=269,
serialized_end=481,
)
_TIMESTEP = _descriptor.Descriptor(
name='TimeStep',
full_name='rips.TimeStep',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='index', full_name='rips.TimeStep.index', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=483,
serialized_end=508,
name='TimeStep',
full_name='rips.TimeStep',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='index', full_name='rips.TimeStep.index', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=483,
serialized_end=508,
)
_PROPERTYINPUTCHUNK = _descriptor.Descriptor(
name='PropertyInputChunk',
full_name='rips.PropertyInputChunk',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='params', full_name='rips.PropertyInputChunk.params', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='values', full_name='rips.PropertyInputChunk.values', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
_descriptor.OneofDescriptor(
name='ChunkType', full_name='rips.PropertyInputChunk.ChunkType',
index=0, containing_type=None, fields=[]),
],
serialized_start=510,
serialized_end=623,
name='PropertyInputChunk',
full_name='rips.PropertyInputChunk',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='params', full_name='rips.PropertyInputChunk.params', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='values', full_name='rips.PropertyInputChunk.values', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
_descriptor.OneofDescriptor(
name='ChunkType', full_name='rips.PropertyInputChunk.ChunkType',
index=0, containing_type=None, fields=[]),
],
serialized_start=510,
serialized_end=623,
)
_PROPERTYCHUNK = _descriptor.Descriptor(
name='PropertyChunk',
full_name='rips.PropertyChunk',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='values', full_name='rips.PropertyChunk.values', index=0,
number=1, type=1, cpp_type=5, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=625,
serialized_end=656,
name='PropertyChunk',
full_name='rips.PropertyChunk',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='values', full_name='rips.PropertyChunk.values', index=0,
number=1, type=1, cpp_type=5, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=625,
serialized_end=656,
)
_AVAILABLEPROPERTIESREQUEST.fields_by_name['case_request'].message_type = Case__pb2._CASEREQUEST
@ -348,10 +345,10 @@ _PROPERTYREQUEST.fields_by_name['porosity_model'].enum_type = Case__pb2._POROSIT
_PROPERTYINPUTCHUNK.fields_by_name['params'].message_type = _PROPERTYREQUEST
_PROPERTYINPUTCHUNK.fields_by_name['values'].message_type = _PROPERTYCHUNK
_PROPERTYINPUTCHUNK.oneofs_by_name['ChunkType'].fields.append(
_PROPERTYINPUTCHUNK.fields_by_name['params'])
_PROPERTYINPUTCHUNK.fields_by_name['params'])
_PROPERTYINPUTCHUNK.fields_by_name['params'].containing_oneof = _PROPERTYINPUTCHUNK.oneofs_by_name['ChunkType']
_PROPERTYINPUTCHUNK.oneofs_by_name['ChunkType'].fields.append(
_PROPERTYINPUTCHUNK.fields_by_name['values'])
_PROPERTYINPUTCHUNK.fields_by_name['values'])
_PROPERTYINPUTCHUNK.fields_by_name['values'].containing_oneof = _PROPERTYINPUTCHUNK.oneofs_by_name['ChunkType']
DESCRIPTOR.message_types_by_name['AvailablePropertiesRequest'] = _AVAILABLEPROPERTIESREQUEST
DESCRIPTOR.message_types_by_name['AvailableProperties'] = _AVAILABLEPROPERTIES
@ -363,113 +360,112 @@ DESCRIPTOR.enum_types_by_name['PropertyType'] = _PROPERTYTYPE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
AvailablePropertiesRequest = _reflection.GeneratedProtocolMessageType('AvailablePropertiesRequest', (_message.Message,), dict(
DESCRIPTOR = _AVAILABLEPROPERTIESREQUEST,
__module__ = 'Properties_pb2'
# @@protoc_insertion_point(class_scope:rips.AvailablePropertiesRequest)
))
DESCRIPTOR=_AVAILABLEPROPERTIESREQUEST,
__module__='Properties_pb2'
# @@protoc_insertion_point(class_scope:rips.AvailablePropertiesRequest)
))
_sym_db.RegisterMessage(AvailablePropertiesRequest)
AvailableProperties = _reflection.GeneratedProtocolMessageType('AvailableProperties', (_message.Message,), dict(
DESCRIPTOR = _AVAILABLEPROPERTIES,
__module__ = 'Properties_pb2'
# @@protoc_insertion_point(class_scope:rips.AvailableProperties)
))
DESCRIPTOR=_AVAILABLEPROPERTIES,
__module__='Properties_pb2'
# @@protoc_insertion_point(class_scope:rips.AvailableProperties)
))
_sym_db.RegisterMessage(AvailableProperties)
PropertyRequest = _reflection.GeneratedProtocolMessageType('PropertyRequest', (_message.Message,), dict(
DESCRIPTOR = _PROPERTYREQUEST,
__module__ = 'Properties_pb2'
# @@protoc_insertion_point(class_scope:rips.PropertyRequest)
))
DESCRIPTOR=_PROPERTYREQUEST,
__module__='Properties_pb2'
# @@protoc_insertion_point(class_scope:rips.PropertyRequest)
))
_sym_db.RegisterMessage(PropertyRequest)
TimeStep = _reflection.GeneratedProtocolMessageType('TimeStep', (_message.Message,), dict(
DESCRIPTOR = _TIMESTEP,
__module__ = 'Properties_pb2'
# @@protoc_insertion_point(class_scope:rips.TimeStep)
))
DESCRIPTOR=_TIMESTEP,
__module__='Properties_pb2'
# @@protoc_insertion_point(class_scope:rips.TimeStep)
))
_sym_db.RegisterMessage(TimeStep)
PropertyInputChunk = _reflection.GeneratedProtocolMessageType('PropertyInputChunk', (_message.Message,), dict(
DESCRIPTOR = _PROPERTYINPUTCHUNK,
__module__ = 'Properties_pb2'
# @@protoc_insertion_point(class_scope:rips.PropertyInputChunk)
))
DESCRIPTOR=_PROPERTYINPUTCHUNK,
__module__='Properties_pb2'
# @@protoc_insertion_point(class_scope:rips.PropertyInputChunk)
))
_sym_db.RegisterMessage(PropertyInputChunk)
PropertyChunk = _reflection.GeneratedProtocolMessageType('PropertyChunk', (_message.Message,), dict(
DESCRIPTOR = _PROPERTYCHUNK,
__module__ = 'Properties_pb2'
# @@protoc_insertion_point(class_scope:rips.PropertyChunk)
))
DESCRIPTOR=_PROPERTYCHUNK,
__module__='Properties_pb2'
# @@protoc_insertion_point(class_scope:rips.PropertyChunk)
))
_sym_db.RegisterMessage(PropertyChunk)
_PROPERTIES = _descriptor.ServiceDescriptor(
name='Properties',
full_name='rips.Properties',
file=DESCRIPTOR,
index=0,
serialized_options=None,
serialized_start=861,
serialized_end=1347,
methods=[
_descriptor.MethodDescriptor(
name='GetAvailableProperties',
full_name='rips.Properties.GetAvailableProperties',
name='Properties',
full_name='rips.Properties',
file=DESCRIPTOR,
index=0,
containing_service=None,
input_type=_AVAILABLEPROPERTIESREQUEST,
output_type=_AVAILABLEPROPERTIES,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetActiveCellProperty',
full_name='rips.Properties.GetActiveCellProperty',
index=1,
containing_service=None,
input_type=_PROPERTYREQUEST,
output_type=_PROPERTYCHUNK,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetSelectedCellProperty',
full_name='rips.Properties.GetSelectedCellProperty',
index=2,
containing_service=None,
input_type=_PROPERTYREQUEST,
output_type=_PROPERTYCHUNK,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetGridProperty',
full_name='rips.Properties.GetGridProperty',
index=3,
containing_service=None,
input_type=_PROPERTYREQUEST,
output_type=_PROPERTYCHUNK,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='SetActiveCellProperty',
full_name='rips.Properties.SetActiveCellProperty',
index=4,
containing_service=None,
input_type=_PROPERTYINPUTCHUNK,
output_type=Definitions__pb2._CLIENTTOSERVERSTREAMREPLY,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='SetGridProperty',
full_name='rips.Properties.SetGridProperty',
index=5,
containing_service=None,
input_type=_PROPERTYINPUTCHUNK,
output_type=Definitions__pb2._CLIENTTOSERVERSTREAMREPLY,
serialized_options=None,
),
])
serialized_start=861,
serialized_end=1347,
methods=[
_descriptor.MethodDescriptor(
name='GetAvailableProperties',
full_name='rips.Properties.GetAvailableProperties',
index=0,
containing_service=None,
input_type=_AVAILABLEPROPERTIESREQUEST,
output_type=_AVAILABLEPROPERTIES,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetActiveCellProperty',
full_name='rips.Properties.GetActiveCellProperty',
index=1,
containing_service=None,
input_type=_PROPERTYREQUEST,
output_type=_PROPERTYCHUNK,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetSelectedCellProperty',
full_name='rips.Properties.GetSelectedCellProperty',
index=2,
containing_service=None,
input_type=_PROPERTYREQUEST,
output_type=_PROPERTYCHUNK,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetGridProperty',
full_name='rips.Properties.GetGridProperty',
index=3,
containing_service=None,
input_type=_PROPERTYREQUEST,
output_type=_PROPERTYCHUNK,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='SetActiveCellProperty',
full_name='rips.Properties.SetActiveCellProperty',
index=4,
containing_service=None,
input_type=_PROPERTYINPUTCHUNK,
output_type=Definitions__pb2._CLIENTTOSERVERSTREAMREPLY,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='SetGridProperty',
full_name='rips.Properties.SetGridProperty',
index=5,
containing_service=None,
input_type=_PROPERTYINPUTCHUNK,
output_type=Definitions__pb2._CLIENTTOSERVERSTREAMREPLY,
serialized_options=None,
),
])
_sym_db.RegisterServiceDescriptor(_PROPERTIES)
DESCRIPTOR.services_by_name['Properties'] = _PROPERTIES

View File

@ -6,127 +6,127 @@ import Properties_pb2 as Properties__pb2
class PropertiesStub(object):
# missing associated documentation comment in .proto file
pass
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GetAvailableProperties = channel.unary_unary(
'/rips.Properties/GetAvailableProperties',
request_serializer=Properties__pb2.AvailablePropertiesRequest.SerializeToString,
response_deserializer=Properties__pb2.AvailableProperties.FromString,
Args:
channel: A grpc.Channel.
"""
self.GetAvailableProperties = channel.unary_unary(
'/rips.Properties/GetAvailableProperties',
request_serializer=Properties__pb2.AvailablePropertiesRequest.SerializeToString,
response_deserializer=Properties__pb2.AvailableProperties.FromString,
)
self.GetActiveCellProperty = channel.unary_stream(
'/rips.Properties/GetActiveCellProperty',
request_serializer=Properties__pb2.PropertyRequest.SerializeToString,
response_deserializer=Properties__pb2.PropertyChunk.FromString,
self.GetActiveCellProperty = channel.unary_stream(
'/rips.Properties/GetActiveCellProperty',
request_serializer=Properties__pb2.PropertyRequest.SerializeToString,
response_deserializer=Properties__pb2.PropertyChunk.FromString,
)
self.GetSelectedCellProperty = channel.unary_stream(
'/rips.Properties/GetSelectedCellProperty',
request_serializer=Properties__pb2.PropertyRequest.SerializeToString,
response_deserializer=Properties__pb2.PropertyChunk.FromString,
self.GetSelectedCellProperty = channel.unary_stream(
'/rips.Properties/GetSelectedCellProperty',
request_serializer=Properties__pb2.PropertyRequest.SerializeToString,
response_deserializer=Properties__pb2.PropertyChunk.FromString,
)
self.GetGridProperty = channel.unary_stream(
'/rips.Properties/GetGridProperty',
request_serializer=Properties__pb2.PropertyRequest.SerializeToString,
response_deserializer=Properties__pb2.PropertyChunk.FromString,
self.GetGridProperty = channel.unary_stream(
'/rips.Properties/GetGridProperty',
request_serializer=Properties__pb2.PropertyRequest.SerializeToString,
response_deserializer=Properties__pb2.PropertyChunk.FromString,
)
self.SetActiveCellProperty = channel.stream_unary(
'/rips.Properties/SetActiveCellProperty',
request_serializer=Properties__pb2.PropertyInputChunk.SerializeToString,
response_deserializer=Definitions__pb2.ClientToServerStreamReply.FromString,
self.SetActiveCellProperty = channel.stream_unary(
'/rips.Properties/SetActiveCellProperty',
request_serializer=Properties__pb2.PropertyInputChunk.SerializeToString,
response_deserializer=Definitions__pb2.ClientToServerStreamReply.FromString,
)
self.SetGridProperty = channel.stream_unary(
'/rips.Properties/SetGridProperty',
request_serializer=Properties__pb2.PropertyInputChunk.SerializeToString,
response_deserializer=Definitions__pb2.ClientToServerStreamReply.FromString,
self.SetGridProperty = channel.stream_unary(
'/rips.Properties/SetGridProperty',
request_serializer=Properties__pb2.PropertyInputChunk.SerializeToString,
response_deserializer=Definitions__pb2.ClientToServerStreamReply.FromString,
)
class PropertiesServicer(object):
# missing associated documentation comment in .proto file
pass
def GetAvailableProperties(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetActiveCellProperty(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetAvailableProperties(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetSelectedCellProperty(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetActiveCellProperty(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetGridProperty(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetSelectedCellProperty(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SetActiveCellProperty(self, request_iterator, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetGridProperty(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SetGridProperty(self, request_iterator, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SetActiveCellProperty(self, request_iterator, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SetGridProperty(self, request_iterator, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_PropertiesServicer_to_server(servicer, server):
rpc_method_handlers = {
'GetAvailableProperties': grpc.unary_unary_rpc_method_handler(
servicer.GetAvailableProperties,
request_deserializer=Properties__pb2.AvailablePropertiesRequest.FromString,
response_serializer=Properties__pb2.AvailableProperties.SerializeToString,
),
'GetActiveCellProperty': grpc.unary_stream_rpc_method_handler(
servicer.GetActiveCellProperty,
request_deserializer=Properties__pb2.PropertyRequest.FromString,
response_serializer=Properties__pb2.PropertyChunk.SerializeToString,
),
'GetSelectedCellProperty': grpc.unary_stream_rpc_method_handler(
servicer.GetSelectedCellProperty,
request_deserializer=Properties__pb2.PropertyRequest.FromString,
response_serializer=Properties__pb2.PropertyChunk.SerializeToString,
),
'GetGridProperty': grpc.unary_stream_rpc_method_handler(
servicer.GetGridProperty,
request_deserializer=Properties__pb2.PropertyRequest.FromString,
response_serializer=Properties__pb2.PropertyChunk.SerializeToString,
),
'SetActiveCellProperty': grpc.stream_unary_rpc_method_handler(
servicer.SetActiveCellProperty,
request_deserializer=Properties__pb2.PropertyInputChunk.FromString,
response_serializer=Definitions__pb2.ClientToServerStreamReply.SerializeToString,
),
'SetGridProperty': grpc.stream_unary_rpc_method_handler(
servicer.SetGridProperty,
request_deserializer=Properties__pb2.PropertyInputChunk.FromString,
response_serializer=Definitions__pb2.ClientToServerStreamReply.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.Properties', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
rpc_method_handlers = {
'GetAvailableProperties': grpc.unary_unary_rpc_method_handler(
servicer.GetAvailableProperties,
request_deserializer=Properties__pb2.AvailablePropertiesRequest.FromString,
response_serializer=Properties__pb2.AvailableProperties.SerializeToString,
),
'GetActiveCellProperty': grpc.unary_stream_rpc_method_handler(
servicer.GetActiveCellProperty,
request_deserializer=Properties__pb2.PropertyRequest.FromString,
response_serializer=Properties__pb2.PropertyChunk.SerializeToString,
),
'GetSelectedCellProperty': grpc.unary_stream_rpc_method_handler(
servicer.GetSelectedCellProperty,
request_deserializer=Properties__pb2.PropertyRequest.FromString,
response_serializer=Properties__pb2.PropertyChunk.SerializeToString,
),
'GetGridProperty': grpc.unary_stream_rpc_method_handler(
servicer.GetGridProperty,
request_deserializer=Properties__pb2.PropertyRequest.FromString,
response_serializer=Properties__pb2.PropertyChunk.SerializeToString,
),
'SetActiveCellProperty': grpc.stream_unary_rpc_method_handler(
servicer.SetActiveCellProperty,
request_deserializer=Properties__pb2.PropertyInputChunk.FromString,
response_serializer=Definitions__pb2.ClientToServerStreamReply.SerializeToString,
),
'SetGridProperty': grpc.stream_unary_rpc_method_handler(
servicer.SetGridProperty,
request_deserializer=Properties__pb2.PropertyInputChunk.FromString,
response_serializer=Definitions__pb2.ClientToServerStreamReply.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.Properties', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))

View File

@ -1,16 +1,16 @@
#
# Copyright (C) 2019- 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>
#
# See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
# for more details.
#
# Python version of RiaVersionInfo.h

View File

@ -3,7 +3,7 @@
# source: SimulationWell.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
@ -17,187 +17,184 @@ import Definitions_pb2 as Definitions__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='SimulationWell.proto',
package='rips',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\x14SimulationWell.proto\x12\x04rips\x1a\x11\x44\x65\x66initions.proto\"M\n\x15SimulationWellRequest\x12\x0f\n\x07\x63\x61se_id\x18\x01 \x01(\x05\x12\x11\n\twell_name\x18\x02 \x01(\t\x12\x10\n\x08timestep\x18\x03 \x01(\x05\":\n\x14SimulationWellStatus\x12\x11\n\twell_type\x18\x01 \x01(\t\x12\x0f\n\x07is_open\x18\x02 \x01(\x08\"~\n\x16SimulationWellCellInfo\x12\x18\n\x03ijk\x18\x01 \x01(\x0b\x32\x0b.rips.Vec3i\x12\x12\n\ngrid_index\x18\x02 \x01(\x05\x12\x0f\n\x07is_open\x18\x03 \x01(\x08\x12\x11\n\tbranch_id\x18\x04 \x01(\x05\x12\x12\n\nsegment_id\x18\x05 \x01(\x05\"I\n\x1bSimulationWellCellInfoArray\x12*\n\x04\x64\x61ta\x18\x01 \x03(\x0b\x32\x1c.rips.SimulationWellCellInfo2\xc2\x01\n\x0eSimulationWell\x12T\n\x17GetSimulationWellStatus\x12\x1b.rips.SimulationWellRequest\x1a\x1a.rips.SimulationWellStatus\"\x00\x12Z\n\x16GetSimulationWellCells\x12\x1b.rips.SimulationWellRequest\x1a!.rips.SimulationWellCellInfoArray\"\x00\x62\x06proto3')
,
dependencies=[Definitions__pb2.DESCRIPTOR,])
name='SimulationWell.proto',
package='rips',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\x14SimulationWell.proto\x12\x04rips\x1a\x11\x44\x65\x66initions.proto\"M\n\x15SimulationWellRequest\x12\x0f\n\x07\x63\x61se_id\x18\x01 \x01(\x05\x12\x11\n\twell_name\x18\x02 \x01(\t\x12\x10\n\x08timestep\x18\x03 \x01(\x05\":\n\x14SimulationWellStatus\x12\x11\n\twell_type\x18\x01 \x01(\t\x12\x0f\n\x07is_open\x18\x02 \x01(\x08\"~\n\x16SimulationWellCellInfo\x12\x18\n\x03ijk\x18\x01 \x01(\x0b\x32\x0b.rips.Vec3i\x12\x12\n\ngrid_index\x18\x02 \x01(\x05\x12\x0f\n\x07is_open\x18\x03 \x01(\x08\x12\x11\n\tbranch_id\x18\x04 \x01(\x05\x12\x12\n\nsegment_id\x18\x05 \x01(\x05\"I\n\x1bSimulationWellCellInfoArray\x12*\n\x04\x64\x61ta\x18\x01 \x03(\x0b\x32\x1c.rips.SimulationWellCellInfo2\xc2\x01\n\x0eSimulationWell\x12T\n\x17GetSimulationWellStatus\x12\x1b.rips.SimulationWellRequest\x1a\x1a.rips.SimulationWellStatus\"\x00\x12Z\n\x16GetSimulationWellCells\x12\x1b.rips.SimulationWellRequest\x1a!.rips.SimulationWellCellInfoArray\"\x00\x62\x06proto3'),
dependencies=[Definitions__pb2.DESCRIPTOR, ])
_SIMULATIONWELLREQUEST = _descriptor.Descriptor(
name='SimulationWellRequest',
full_name='rips.SimulationWellRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='case_id', full_name='rips.SimulationWellRequest.case_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='well_name', full_name='rips.SimulationWellRequest.well_name', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='timestep', full_name='rips.SimulationWellRequest.timestep', index=2,
number=3, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=49,
serialized_end=126,
name='SimulationWellRequest',
full_name='rips.SimulationWellRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='case_id', full_name='rips.SimulationWellRequest.case_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='well_name', full_name='rips.SimulationWellRequest.well_name', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='timestep', full_name='rips.SimulationWellRequest.timestep', index=2,
number=3, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=49,
serialized_end=126,
)
_SIMULATIONWELLSTATUS = _descriptor.Descriptor(
name='SimulationWellStatus',
full_name='rips.SimulationWellStatus',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='well_type', full_name='rips.SimulationWellStatus.well_type', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='is_open', full_name='rips.SimulationWellStatus.is_open', index=1,
number=2, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=128,
serialized_end=186,
name='SimulationWellStatus',
full_name='rips.SimulationWellStatus',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='well_type', full_name='rips.SimulationWellStatus.well_type', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='is_open', full_name='rips.SimulationWellStatus.is_open', index=1,
number=2, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=128,
serialized_end=186,
)
_SIMULATIONWELLCELLINFO = _descriptor.Descriptor(
name='SimulationWellCellInfo',
full_name='rips.SimulationWellCellInfo',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='ijk', full_name='rips.SimulationWellCellInfo.ijk', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='grid_index', full_name='rips.SimulationWellCellInfo.grid_index', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='is_open', full_name='rips.SimulationWellCellInfo.is_open', index=2,
number=3, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='branch_id', full_name='rips.SimulationWellCellInfo.branch_id', index=3,
number=4, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='segment_id', full_name='rips.SimulationWellCellInfo.segment_id', index=4,
number=5, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=188,
serialized_end=314,
name='SimulationWellCellInfo',
full_name='rips.SimulationWellCellInfo',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='ijk', full_name='rips.SimulationWellCellInfo.ijk', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='grid_index', full_name='rips.SimulationWellCellInfo.grid_index', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='is_open', full_name='rips.SimulationWellCellInfo.is_open', index=2,
number=3, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='branch_id', full_name='rips.SimulationWellCellInfo.branch_id', index=3,
number=4, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='segment_id', full_name='rips.SimulationWellCellInfo.segment_id', index=4,
number=5, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=188,
serialized_end=314,
)
_SIMULATIONWELLCELLINFOARRAY = _descriptor.Descriptor(
name='SimulationWellCellInfoArray',
full_name='rips.SimulationWellCellInfoArray',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='data', full_name='rips.SimulationWellCellInfoArray.data', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=316,
serialized_end=389,
name='SimulationWellCellInfoArray',
full_name='rips.SimulationWellCellInfoArray',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='data', full_name='rips.SimulationWellCellInfoArray.data', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=316,
serialized_end=389,
)
_SIMULATIONWELLCELLINFO.fields_by_name['ijk'].message_type = Definitions__pb2._VEC3I
@ -209,63 +206,62 @@ DESCRIPTOR.message_types_by_name['SimulationWellCellInfoArray'] = _SIMULATIONWEL
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
SimulationWellRequest = _reflection.GeneratedProtocolMessageType('SimulationWellRequest', (_message.Message,), dict(
DESCRIPTOR = _SIMULATIONWELLREQUEST,
__module__ = 'SimulationWell_pb2'
# @@protoc_insertion_point(class_scope:rips.SimulationWellRequest)
))
DESCRIPTOR=_SIMULATIONWELLREQUEST,
__module__='SimulationWell_pb2'
# @@protoc_insertion_point(class_scope:rips.SimulationWellRequest)
))
_sym_db.RegisterMessage(SimulationWellRequest)
SimulationWellStatus = _reflection.GeneratedProtocolMessageType('SimulationWellStatus', (_message.Message,), dict(
DESCRIPTOR = _SIMULATIONWELLSTATUS,
__module__ = 'SimulationWell_pb2'
# @@protoc_insertion_point(class_scope:rips.SimulationWellStatus)
))
DESCRIPTOR=_SIMULATIONWELLSTATUS,
__module__='SimulationWell_pb2'
# @@protoc_insertion_point(class_scope:rips.SimulationWellStatus)
))
_sym_db.RegisterMessage(SimulationWellStatus)
SimulationWellCellInfo = _reflection.GeneratedProtocolMessageType('SimulationWellCellInfo', (_message.Message,), dict(
DESCRIPTOR = _SIMULATIONWELLCELLINFO,
__module__ = 'SimulationWell_pb2'
# @@protoc_insertion_point(class_scope:rips.SimulationWellCellInfo)
))
DESCRIPTOR=_SIMULATIONWELLCELLINFO,
__module__='SimulationWell_pb2'
# @@protoc_insertion_point(class_scope:rips.SimulationWellCellInfo)
))
_sym_db.RegisterMessage(SimulationWellCellInfo)
SimulationWellCellInfoArray = _reflection.GeneratedProtocolMessageType('SimulationWellCellInfoArray', (_message.Message,), dict(
DESCRIPTOR = _SIMULATIONWELLCELLINFOARRAY,
__module__ = 'SimulationWell_pb2'
# @@protoc_insertion_point(class_scope:rips.SimulationWellCellInfoArray)
))
DESCRIPTOR=_SIMULATIONWELLCELLINFOARRAY,
__module__='SimulationWell_pb2'
# @@protoc_insertion_point(class_scope:rips.SimulationWellCellInfoArray)
))
_sym_db.RegisterMessage(SimulationWellCellInfoArray)
_SIMULATIONWELL = _descriptor.ServiceDescriptor(
name='SimulationWell',
full_name='rips.SimulationWell',
file=DESCRIPTOR,
index=0,
serialized_options=None,
serialized_start=392,
serialized_end=586,
methods=[
_descriptor.MethodDescriptor(
name='GetSimulationWellStatus',
full_name='rips.SimulationWell.GetSimulationWellStatus',
name='SimulationWell',
full_name='rips.SimulationWell',
file=DESCRIPTOR,
index=0,
containing_service=None,
input_type=_SIMULATIONWELLREQUEST,
output_type=_SIMULATIONWELLSTATUS,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetSimulationWellCells',
full_name='rips.SimulationWell.GetSimulationWellCells',
index=1,
containing_service=None,
input_type=_SIMULATIONWELLREQUEST,
output_type=_SIMULATIONWELLCELLINFOARRAY,
serialized_options=None,
),
])
serialized_start=392,
serialized_end=586,
methods=[
_descriptor.MethodDescriptor(
name='GetSimulationWellStatus',
full_name='rips.SimulationWell.GetSimulationWellStatus',
index=0,
containing_service=None,
input_type=_SIMULATIONWELLREQUEST,
output_type=_SIMULATIONWELLSTATUS,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetSimulationWellCells',
full_name='rips.SimulationWell.GetSimulationWellCells',
index=1,
containing_service=None,
input_type=_SIMULATIONWELLREQUEST,
output_type=_SIMULATIONWELLCELLINFOARRAY,
serialized_options=None,
),
])
_sym_db.RegisterServiceDescriptor(_SIMULATIONWELL)
DESCRIPTOR.services_by_name['SimulationWell'] = _SIMULATIONWELL

View File

@ -5,59 +5,59 @@ import SimulationWell_pb2 as SimulationWell__pb2
class SimulationWellStub(object):
# missing associated documentation comment in .proto file
pass
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GetSimulationWellStatus = channel.unary_unary(
'/rips.SimulationWell/GetSimulationWellStatus',
request_serializer=SimulationWell__pb2.SimulationWellRequest.SerializeToString,
response_deserializer=SimulationWell__pb2.SimulationWellStatus.FromString,
Args:
channel: A grpc.Channel.
"""
self.GetSimulationWellStatus = channel.unary_unary(
'/rips.SimulationWell/GetSimulationWellStatus',
request_serializer=SimulationWell__pb2.SimulationWellRequest.SerializeToString,
response_deserializer=SimulationWell__pb2.SimulationWellStatus.FromString,
)
self.GetSimulationWellCells = channel.unary_unary(
'/rips.SimulationWell/GetSimulationWellCells',
request_serializer=SimulationWell__pb2.SimulationWellRequest.SerializeToString,
response_deserializer=SimulationWell__pb2.SimulationWellCellInfoArray.FromString,
self.GetSimulationWellCells = channel.unary_unary(
'/rips.SimulationWell/GetSimulationWellCells',
request_serializer=SimulationWell__pb2.SimulationWellRequest.SerializeToString,
response_deserializer=SimulationWell__pb2.SimulationWellCellInfoArray.FromString,
)
class SimulationWellServicer(object):
# missing associated documentation comment in .proto file
pass
def GetSimulationWellStatus(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetSimulationWellCells(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetSimulationWellStatus(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetSimulationWellCells(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_SimulationWellServicer_to_server(servicer, server):
rpc_method_handlers = {
'GetSimulationWellStatus': grpc.unary_unary_rpc_method_handler(
servicer.GetSimulationWellStatus,
request_deserializer=SimulationWell__pb2.SimulationWellRequest.FromString,
response_serializer=SimulationWell__pb2.SimulationWellStatus.SerializeToString,
),
'GetSimulationWellCells': grpc.unary_unary_rpc_method_handler(
servicer.GetSimulationWellCells,
request_deserializer=SimulationWell__pb2.SimulationWellRequest.FromString,
response_serializer=SimulationWell__pb2.SimulationWellCellInfoArray.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.SimulationWell', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
rpc_method_handlers = {
'GetSimulationWellStatus': grpc.unary_unary_rpc_method_handler(
servicer.GetSimulationWellStatus,
request_deserializer=SimulationWell__pb2.SimulationWellRequest.FromString,
response_serializer=SimulationWell__pb2.SimulationWellStatus.SerializeToString,
),
'GetSimulationWellCells': grpc.unary_unary_rpc_method_handler(
servicer.GetSimulationWellCells,
request_deserializer=SimulationWell__pb2.SimulationWellRequest.FromString,
response_serializer=SimulationWell__pb2.SimulationWellCellInfoArray.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.SimulationWell', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))

View File

@ -1,16 +1,17 @@
class PdmObject:
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
if PdmObject.__custom_init__ is not None:
PdmObject.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class DataContainerFloat(PdmObject):
"""
Attributes:
values (List of float): Float Values
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
self.values = []
@ -18,12 +19,13 @@ class DataContainerFloat(PdmObject):
if DataContainerFloat.__custom_init__ is not None:
DataContainerFloat.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class DataContainerString(PdmObject):
"""
Attributes:
values (List of str): String Values
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
self.values = []
@ -31,12 +33,13 @@ class DataContainerString(PdmObject):
if DataContainerString.__custom_init__ is not None:
DataContainerString.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class DataContainerTime(PdmObject):
"""
Attributes:
values (List of time): Time Values
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
self.values = []
@ -44,6 +47,7 @@ class DataContainerTime(PdmObject):
if DataContainerTime.__custom_init__ is not None:
DataContainerTime.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class Case(PdmObject):
"""
The ResInsight base class for Cases
@ -53,7 +57,7 @@ class Case(PdmObject):
id (int): Case ID
name (str): Case Name
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
self.file_path = ""
@ -63,12 +67,13 @@ class Case(PdmObject):
if Case.__custom_init__ is not None:
Case.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class Reservoir(Case):
"""
Abtract base class for Eclipse Cases
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
Case.__init__(self, pb2_object, channel)
@ -88,13 +93,14 @@ class EclipseCase(Reservoir):
The Regular Eclipse Results Case
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
Reservoir.__init__(self, pb2_object, channel)
if EclipseCase.__custom_init__ is not None:
EclipseCase.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class SummaryCase(PdmObject):
"""
The Base Class for all Summary Cases
@ -105,7 +111,7 @@ class SummaryCase(PdmObject):
short_name (str): Display Name
summary_header_filename (str): Summary Header File
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
self.auto_shorty_name = False
@ -118,29 +124,27 @@ class SummaryCase(PdmObject):
def available_addresses(self, ):
"""
Arguments:
Returns:
DataContainerString
"""
return self._call_pdm_method("availableAddresses")
def available_time_steps(self, ):
"""
Arguments:
Returns:
DataContainerTime
"""
return self._call_pdm_method("availableTimeSteps")
def resample_values(self, address=None, resampling_period=None):
"""
Arguments:
address (str): Formatted address specifying the summary vector
resampling_period (str): Resampling Period
@ -149,7 +153,6 @@ class SummaryCase(PdmObject):
"""
return self._call_pdm_method("resampleValues", address=address, resampling_period=resampling_period)
def summary_vector_values(self, address=None):
"""
Create a new Summary Plot
@ -161,6 +164,9 @@ class SummaryCase(PdmObject):
return self._call_pdm_method("summaryVectorValues", address=address)
return self._call_pdm_method("summaryVectorValues", address=address)
class FileSummaryCase(SummaryCase):
"""
A Summary Case based on SMSPEC files
@ -168,7 +174,7 @@ class FileSummaryCase(SummaryCase):
Attributes:
include_restart_files (str): Include Restart Files
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
self.include_restart_files = False
@ -176,18 +182,20 @@ class FileSummaryCase(SummaryCase):
if FileSummaryCase.__custom_init__ is not None:
FileSummaryCase.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class ViewWindow(PdmObject):
"""
The Base Class for all Views and Plots in ResInsight
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
PdmObject.__init__(self, pb2_object, channel)
if ViewWindow.__custom_init__ is not None:
ViewWindow.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class View(ViewWindow):
"""
Attributes:
@ -200,7 +208,7 @@ class View(ViewWindow):
show_grid_box (str): Show Grid Box
show_z_scale (str): Show Z Scale Label
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
self.background_color = "#b0c4de"
@ -215,30 +223,33 @@ class View(ViewWindow):
if View.__custom_init__ is not None:
View.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class GeoMechView(View):
"""
The Geomechanical 3d View
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
View.__init__(self, pb2_object, channel)
if GeoMechView.__custom_init__ is not None:
GeoMechView.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class GridSummaryCase(SummaryCase):
"""
A Summary Case based on extracting grid data.
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
SummaryCase.__init__(self, pb2_object, channel)
if GridSummaryCase.__custom_init__ is not None:
GridSummaryCase.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class WellPath(PdmObject):
"""
The Base class for Well Paths
@ -246,7 +257,7 @@ class WellPath(PdmObject):
Attributes:
name (str): Name
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
self.name = ""
@ -254,24 +265,26 @@ class WellPath(PdmObject):
if WellPath.__custom_init__ is not None:
WellPath.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class ModeledWellPath(WellPath):
"""
A Well Path created interactively in ResInsight
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
WellPath.__init__(self, pb2_object, channel)
if ModeledWellPath.__custom_init__ is not None:
ModeledWellPath.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class GeoMechCase(Case):
"""
The Abaqus Based GeoMech Case
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
Case.__init__(self, pb2_object, channel)
@ -291,7 +304,7 @@ class Project(PdmObject):
The ResInsight Project
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
PdmObject.__init__(self, pb2_object, channel)
@ -308,7 +321,6 @@ class Project(PdmObject):
"""
return self._call_pdm_method("importSummaryCase", file_name=file_name)
def summary_case(self, case_id=None):
"""
Find Summary Case
@ -326,7 +338,7 @@ class ResampleData(PdmObject):
time_steps (List of time): Time Steps
values (List of float): Values
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
self.time_steps = []
@ -335,12 +347,13 @@ class ResampleData(PdmObject):
if ResampleData.__custom_init__ is not None:
ResampleData.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class EclipseView(View):
"""
The Eclipse 3d Reservoir View
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
View.__init__(self, pb2_object, channel)
@ -355,7 +368,6 @@ class EclipseView(View):
children = self.children("CellResult", CellColors)
return children[0] if len(children) > 0 else None
def cell_result_data(self):
"""Current Eclipse Cell Result
Returns:
@ -363,7 +375,6 @@ class EclipseView(View):
"""
return self._call_get_method("CellResultData")
def set_cell_result_data(self, values):
"""Set Current Eclipse Cell Result
Arguments:
@ -386,7 +397,7 @@ class EclipseResult(PdmObject):
selected_producer_tracers (List of str): Producer Tracers
selected_souring_tracers (List of str): Tracers
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
self.flow_tracer_selection_mode = "FLOW_TR_INJ_AND_PROD"
@ -401,42 +412,46 @@ class EclipseResult(PdmObject):
if EclipseResult.__custom_init__ is not None:
EclipseResult.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class CellColors(EclipseResult):
"""
Eclipse Cell Colors class
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
EclipseResult.__init__(self, pb2_object, channel)
if CellColors.__custom_init__ is not None:
CellColors.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class EclipseContourMap(EclipseView):
"""
A contour map for Eclipse cases
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
EclipseView.__init__(self, pb2_object, channel)
if EclipseContourMap.__custom_init__ is not None:
EclipseContourMap.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class GeoMechContourMap(GeoMechView):
"""
A contour map for GeoMech cases
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
GeoMechView.__init__(self, pb2_object, channel)
if GeoMechContourMap.__custom_init__ is not None:
GeoMechContourMap.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class GridCaseGroup(PdmObject):
"""
A statistics case group
@ -445,7 +460,7 @@ class GridCaseGroup(PdmObject):
group_id (int): Case Group ID
user_description (str): Name
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
self.group_id = -1
@ -454,6 +469,7 @@ class GridCaseGroup(PdmObject):
if GridCaseGroup.__custom_init__ is not None:
GridCaseGroup.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class SummaryCaseSubCollection(PdmObject):
"""
Attributes:
@ -462,7 +478,7 @@ class SummaryCaseSubCollection(PdmObject):
name_count (str): Name
summary_collection_name (str): Name
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
self.id = -1
@ -473,6 +489,7 @@ class SummaryCaseSubCollection(PdmObject):
if SummaryCaseSubCollection.__custom_init__ is not None:
SummaryCaseSubCollection.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class PlotWindow(ViewWindow):
"""
The Abstract base class for all MDI Windows in the Plot Window
@ -480,7 +497,7 @@ class PlotWindow(ViewWindow):
Attributes:
id (int): View ID
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
self.id = -1
@ -488,18 +505,20 @@ class PlotWindow(ViewWindow):
if PlotWindow.__custom_init__ is not None:
PlotWindow.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class Plot(PlotWindow):
"""
The Abstract Base Class for all Plot Objects
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
PlotWindow.__init__(self, pb2_object, channel)
if Plot.__custom_init__ is not None:
Plot.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class SummaryPlot(Plot):
"""
A Summary Plot
@ -510,7 +529,7 @@ class SummaryPlot(Plot):
plot_description (str): Name
show_plot_title (str): Plot Title
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
self.is_using_auto_name = True
@ -521,8 +540,9 @@ class SummaryPlot(Plot):
if SummaryPlot.__custom_init__ is not None:
SummaryPlot.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class SummaryPlotCollection(PdmObject):
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
PdmObject.__init__(self, pb2_object, channel)
@ -563,7 +583,7 @@ class WbsParameters(PdmObject):
user_ucs (float): User Defined UCS [bar]
water_density (float): Density of Sea Water [g/cm^3]
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
self.df_source = "LAS_FILE"
@ -587,6 +607,7 @@ class WbsParameters(PdmObject):
if WbsParameters.__custom_init__ is not None:
WbsParameters.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class SimulationWell(PdmObject):
"""
An Eclipse Simulation Well
@ -594,7 +615,7 @@ class SimulationWell(PdmObject):
Attributes:
name (str): Name
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
self.name = ""
@ -602,6 +623,7 @@ class SimulationWell(PdmObject):
if SimulationWell.__custom_init__ is not None:
SimulationWell.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class WellLogPlot(PlotWindow):
"""
A Well Log Plot With a shared Depth Axis and Multiple Tracks
@ -615,7 +637,7 @@ class WellLogPlot(PlotWindow):
show_depth_grid_lines (str): Show Grid Lines
show_title_in_plot (str): Show Title
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
self.auto_scale_depth_enabled = True
@ -629,12 +651,13 @@ class WellLogPlot(PlotWindow):
if WellLogPlot.__custom_init__ is not None:
WellLogPlot.__custom_init__(self, pb2_object=pb2_object, channel=channel)
class WellBoreStabilityPlot(WellLogPlot):
"""
A GeoMechanical Well Bore Stabilit Plot
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
WellLogPlot.__init__(self, pb2_object, channel)
@ -655,13 +678,14 @@ class FileWellPath(WellPath):
Well Paths Loaded From File
"""
__custom_init__ = None #: Assign a custom init routine to be run at __init__
__custom_init__ = None # : Assign a custom init routine to be run at __init__
def __init__(self, pb2_object=None, channel=None):
WellPath.__init__(self, pb2_object, channel)
if FileWellPath.__custom_init__ is not None:
FileWellPath.__custom_init__(self, pb2_object=pb2_object, channel=channel)
def class_dict():
classes = {}
classes['Case'] = Case
@ -700,6 +724,7 @@ def class_dict():
classes['WellPath'] = WellPath
return classes
def class_from_keyword(class_keyword):
all_classes = class_dict()
if class_keyword in all_classes.keys():

View File

@ -11,10 +11,11 @@ import rips.generated.Grid_pb2_grpc as Grid_pb2_grpc
class Grid:
"""Grid Information. Not meant to be constructed separately
Create Grid objects using methods on Case: Grid() and Grids()
"""Grid Information. Created by methods in Case
:meth:`rips.case.grid()`
:meth:`rips.case.grids()`
"""
def __init__(self, index, case, channel):
self.__channel = channel
self.__stub = Grid_pb2_grpc.GridStub(self.__channel)
@ -33,7 +34,6 @@ class Grid:
Grid_pb2.GridRequest(case_request=case_request,
grid_index=self.index)).dimensions
def cell_centers_async(self):
"""The cells center for all cells in given grid async.

View File

@ -9,12 +9,13 @@ from rips.case import Case
import rips.generated.Commands_pb2 as Cmd
from rips.generated.pdm_objects import GridCaseGroup
@add_method(GridCaseGroup)
def create_statistics_case(self):
"""Create a Statistics case in the Grid Case Group
Returns:
A new Case
:class:`rips.generated.pdm_objects.EclipseCase`
"""
command_reply = self._execute_command(
createStatisticsCase=Cmd.CreateStatisticsCaseRequest(
@ -22,28 +23,42 @@ def create_statistics_case(self):
return Case(self.channel,
command_reply.createStatisticsCaseResult.caseId)
@add_method(GridCaseGroup)
def statistics_cases(self):
"""Get a list of all statistics cases in the Grid Case Group"""
"""Get a list of all statistics cases in the Grid Case Group
Returns:
List of :class:`rips.generated.pdm_objects.EclipseCase`
"""
stat_case_collection = self.children("StatisticsCaseCollection")[0]
return stat_case_collection.children("Reservoirs")
@add_method(GridCaseGroup)
def views(self):
"""Get a list of views belonging to a grid case group"""
"""Get a list of views belonging to a grid case group
Returns:
List of :class:`rips.generated.pdm_objects.EclipseView`
"""
pdm_objects = self.descendants(EclipseView)
view_list = []
for pdm_object in pdm_objects:
view_list.append(pdm_object)
return view_list
@add_method(GridCaseGroup)
def view(self, view_id):
"""Get a particular view belonging to a case group by providing view id
Arguments:
id(int): view id
Returns: a view object
Returns:
List of :class:`rips.generated.pdm_objects.EclipseView`
"""
views = self.views()
@ -52,13 +67,13 @@ def view(self, view_id):
return view_object
return None
@add_method(GridCaseGroup)
def compute_statistics(self, case_ids=None):
""" Compute statistics for the given case ids
Arguments:
case_ids(list of integers): list of case ids.
If this is None all cases in group are included
case_ids(list of integers): List of case ids. If this is None all cases in group are included
"""
if case_ids is None:

View File

@ -46,7 +46,7 @@ class Instance:
options=[
('grpc.enable_http_proxy',
False)
])
])
app = App_pb2_grpc.AppStub(channel)
try:
app.GetVersion(Empty(), timeout=1)
@ -91,7 +91,7 @@ class Instance:
return None
print("Trying port " + str(port))
while Instance.__is_port_in_use(port):
while Instance.__is_port_in_use(port):
port += 1
print("Trying port " + str(port))
@ -266,7 +266,7 @@ class Instance:
Set the plot window size in pixels
**Parameters**::
Parameter | Description | Type
--------- | ---------------- | -----
width | Width in pixels | Integer

View File

@ -17,29 +17,34 @@ import rips.generated.Commands_pb2 as Cmd
import rips.generated.Commands_pb2_grpc as CmdRpc
from rips.generated.pdm_objects import PdmObject, class_from_keyword
def camel_to_snake(name):
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
def snake_to_camel(name):
return ''.join(word.title() for word in name.split('_'))
def add_method(cls):
def decorator(func):
setattr(cls, func.__name__, func)
return func # returning func means func can still be used normally
return func # returning func means func can still be used normally
return decorator
def add_static_method(cls):
def decorator(func):
@wraps(func)
def wrapper(*args, **kwargs):
@wraps(func)
def wrapper(*args, **kwargs):
return func(*args, **kwargs)
setattr(cls, func.__name__, wrapper)
# Note we are not binding func, but wrapper which accepts self but does exactly the same as func
return func # returning func means func can still be used normally
return func # returning func means func can still be used normally
return decorator
@add_method(PdmObject)
def _execute_command(self, **command_params):
self.__warnings = []
@ -51,13 +56,14 @@ def _execute_command(self, **command_params):
return response
@add_method(PdmObject)
def __custom_init__(self, pb2_object, channel):
self.__warnings = []
self.__chunk_size = 8160
self._channel = channel
# Create stubs
if self._channel:
self._pdm_object_stub = PdmObject_pb2_grpc.PdmObjectServiceStub(self._channel)
@ -66,7 +72,7 @@ def __custom_init__(self, pb2_object, channel):
if pb2_object is not None:
# Copy parameters from ResInsight
assert(not isinstance(pb2_object, PdmObject))
self._pb2_object = pb2_object
self._pb2_object = pb2_object
for camel_keyword in self._pb2_object.parameters:
snake_keyword = camel_to_snake(camel_keyword)
setattr(self, snake_keyword, self.__get_grpc_value(camel_keyword))
@ -75,6 +81,7 @@ def __custom_init__(self, pb2_object, channel):
self._pb2_object = PdmObject_pb2.PdmObject(class_keyword=self.__class__.__name__)
self.__copy_to_pb2()
@add_method(PdmObject)
def copy_from(self, object):
"""Copy attribute values from object to self
@ -84,19 +91,22 @@ def copy_from(self, object):
value = getattr(object, attribute)
# This is crucial to avoid overwriting methods
if not callable(value):
setattr(self, attribute, value)
setattr(self, attribute, value)
if self.__custom_init__ is not None:
self.__custom_init__(self._pb2_object, self._channel)
self.update()
@add_method(PdmObject)
def warnings(self):
return self.__warnings
@add_method(PdmObject)
@add_method(PdmObject)
def has_warnings(self):
return len(self.__warnings) > 0
@add_method(PdmObject)
def __copy_to_pb2(self):
if self._pb2_object is not None:
@ -108,16 +118,19 @@ def __copy_to_pb2(self):
camel_kw = snake_to_camel(snake_kw)
self.__set_grpc_value(camel_kw, value)
@add_method(PdmObject)
def pb2_object(self):
""" Private method"""
return self._pb2_object
@add_method(PdmObject)
def channel(self):
""" Private method"""
return self._channel
@add_method(PdmObject)
def address(self):
"""Get the unique address of the PdmObject
@ -128,15 +141,18 @@ def address(self):
return self._pb2_object.address
@add_method(PdmObject)
def set_visible(self, visible):
"""Set the visibility of the object in the ResInsight project tree"""
self._pb2_object.visible = visible
@add_method(PdmObject)
def visible(self):
"""Get the visibility of the object in the ResInsight project tree"""
return self._pb2_object.visible
return self._pb2_object.visible
@add_method(PdmObject)
def print_object_info(self):
@ -147,11 +163,12 @@ def print_object_info(self):
if not snake_kw.startswith("_") and not callable(getattr(self, snake_kw)):
camel_kw = snake_to_camel(snake_kw)
print(" " + snake_kw + " [" + type(getattr(self, snake_kw)).__name__ +
"]: " + str(getattr(self, snake_kw)))
"]: " + str(getattr(self, snake_kw)))
print("Object Methods:")
for snake_kw in dir(self):
if not snake_kw.startswith("_") and callable(getattr(self, snake_kw)):
print (" " + snake_kw)
print(" " + snake_kw)
@add_method(PdmObject)
def __convert_from_grpc_value(self, value):
@ -173,6 +190,7 @@ def __convert_from_grpc_value(self, value):
return self.__makelist(value)
return value
@add_method(PdmObject)
def __convert_to_grpc_value(self, value):
if isinstance(value, bool):
@ -188,14 +206,17 @@ def __convert_to_grpc_value(self, value):
return "[" + ", ".join(list_of_strings) + "]"
return str(value)
@add_method(PdmObject)
def __get_grpc_value(self, camel_keyword):
return self.__convert_from_grpc_value(self._pb2_object.parameters[camel_keyword])
@add_method(PdmObject)
def __set_grpc_value(self, camel_keyword, value):
self._pb2_object.parameters[camel_keyword] = self.__convert_to_grpc_value(value)
@add_method(PdmObject)
def set_value(self, snake_keyword, value):
"""Set the value associated with the provided keyword and updates ResInsight
@ -208,10 +229,12 @@ def set_value(self, snake_keyword, value):
setattr(self, snake_keyword, value)
self.update()
@add_method(PdmObject)
def __islist(self, value):
return value.startswith("[") and value.endswith("]")
@add_method(PdmObject)
def __makelist(self, list_string):
list_string = list_string.lstrip("[")
@ -222,6 +245,7 @@ def __makelist(self, list_string):
values.append(self.__convert_from_grpc_value(string))
return values
@add_method(PdmObject)
def __from_pb2_to_pdm_objects(self, pb2_object_list, super_class_definition):
pdm_object_list = []
@ -231,9 +255,10 @@ def __from_pb2_to_pdm_objects(self, pb2_object_list, super_class_definition):
child_class_definition = super_class_definition
pdm_object = child_class_definition(pb2_object=pb2_object, channel=self.channel())
pdm_object_list.append(pdm_object)
pdm_object_list.append(pdm_object)
return pdm_object_list
@add_method(PdmObject)
def descendants(self, class_definition):
"""Get a list of all project tree descendants matching the class keyword
@ -254,8 +279,9 @@ def descendants(self, class_definition):
return self.__from_pb2_to_pdm_objects(object_list, class_definition)
except grpc.RpcError as e:
if e.code() == grpc.StatusCode.NOT_FOUND:
return [] # Valid empty result
raise e
return [] # Valid empty result
raise e
@add_method(PdmObject)
def children(self, child_field, class_definition=PdmObject):
@ -275,6 +301,7 @@ def children(self, child_field, class_definition=PdmObject):
return []
raise e
@add_method(PdmObject)
def ancestor(self, class_definition):
"""Find the first ancestor that matches the provided class_keyword
@ -301,12 +328,14 @@ def ancestor(self, class_definition):
return None
raise e
@add_method(PdmObject)
def _call_get_method_async(self, method_name):
request = PdmObject_pb2.PdmObjectGetterRequest(object=self._pb2_object, method=method_name)
for chunk in self._pdm_object_stub.CallPdmObjectGetter(request):
yield chunk
@add_method(PdmObject)
def _call_get_method(self, method_name):
all_values = []
@ -317,6 +346,7 @@ def _call_get_method(self, method_name):
all_values.append(value)
return all_values
@add_method(PdmObject)
def __generate_set_method_chunks(self, array, method_request):
index = -1
@ -324,22 +354,23 @@ def __generate_set_method_chunks(self, array, method_request):
while index < len(array):
chunk = PdmObject_pb2.PdmObjectSetterChunk()
if index is -1:
chunk.set_request.CopyFrom(PdmObject_pb2.PdmObjectSetterRequest(request=method_request, data_count=len(array)))
chunk.set_request.CopyFrom(PdmObject_pb2.PdmObjectSetterRequest(
request=method_request, data_count=len(array)))
index += 1
else:
actual_chunk_size = min(len(array) - index + 1, self.__chunk_size)
if isinstance(array[0], float):
chunk.CopyFrom(
PdmObject_pb2.PdmObjectSetterChunk(doubles=PdmObject_pb2.DoubleArray(data=array[index:index +
actual_chunk_size])))
actual_chunk_size])))
elif isinstance(array[0], int):
chunk.CopyFrom(
PdmObject_pb2.PdmObjectSetterChunk(ints=PdmObject_pb2.IntArray(data=array[index:index +
actual_chunk_size])))
actual_chunk_size])))
elif isinstance(array[0], str):
chunk.CopyFrom(
PdmObject_pb2.PdmObjectSetterChunk(strings=PdmObject_pb2.StringArray(data=array[index:index +
actual_chunk_size])))
actual_chunk_size])))
else:
raise Exception("Wrong data type for set method")
index += actual_chunk_size
@ -348,20 +379,24 @@ def __generate_set_method_chunks(self, array, method_request):
chunk = PdmObject_pb2.PdmObjectSetterChunk()
yield chunk
@add_method(PdmObject)
def _call_set_method(self, method_name, values):
method_request = PdmObject_pb2.PdmObjectGetterRequest(object=self._pb2_object, method=method_name)
method_request = PdmObject_pb2.PdmObjectGetterRequest(
object=self._pb2_object, method=method_name)
request_iterator = self.__generate_set_method_chunks(values, method_request)
reply = self._pdm_object_stub.CallPdmObjectSetter(request_iterator)
if reply.accepted_value_count < len(values):
raise IndexError
@add_method(PdmObject)
def _call_pdm_method(self, method_name, **kwargs):
pb2_params = PdmObject_pb2.PdmObject(class_keyword=method_name)
for key, value in kwargs.items():
pb2_params.parameters[snake_to_camel(key)] = self.__convert_to_grpc_value(value)
request = PdmObject_pb2.PdmObjectMethodRequest(object=self._pb2_object, method=method_name, params=pb2_params)
request = PdmObject_pb2.PdmObjectMethodRequest(
object=self._pb2_object, method=method_name, params=pb2_params)
pb2_object = self._pdm_object_stub.CallPdmObjectMethod(request)
@ -372,6 +407,7 @@ def _call_pdm_method(self, method_name, **kwargs):
pdm_object = child_class_definition(pb2_object=pb2_object, channel=self.channel())
return pdm_object
@add_method(PdmObject)
def update(self):
"""Sync all fields from the Python Object to ResInsight"""

View File

@ -7,21 +7,20 @@ from rips.pdmobject import PdmObject
from rips.generated.pdm_objects import PlotWindow, Plot
from rips.pdmobject import add_method
@add_method(PlotWindow)
def export_snapshot(self, export_folder='', file_prefix='', output_format='PNG'):
""" Export snapshot for the current plot
Arguments:
export_folder(str): The path to export to. By default will use the global export folder
prefix (str): Exported file name prefix
output_format(str): Enum string. Can be 'PNG' or 'PDF'.
"""
return self._execute_command(
exportSnapshots=Cmd.ExportSnapshotsRequest(type='PLOTS',
prefix=file_prefix,
viewId=self.id,
exportFolder=export_folder,
plotOutputFormat=output_format))
prefix=file_prefix,
viewId=self.id,
exportFolder=export_folder,
plotOutputFormat=output_format))

View File

@ -24,12 +24,14 @@ from rips.generated.pdm_objects import Project, PlotWindow, WellPath
def __custom_init__(self, pb2_object, channel):
self._project_stub = Project_pb2_grpc.ProjectStub(self._channel)
@add_static_method(Project)
def create(channel):
project_stub = Project_pb2_grpc.ProjectStub(channel)
pb2_object = project_stub.GetPdmObject(Empty())
return Project(pb2_object, channel)
@add_method(Project)
def open(self, path):
"""Open a new project from the given path
@ -40,21 +42,25 @@ def open(self, path):
"""
self._execute_command(openProject=Cmd.FilePathRequest(path=path))
return self
@add_method(Project)
def save(self, path=""):
"""Save the project to the existing project file, or to a new file
Arguments:
path(str): File path to the file to save the project to. If empty, saves to the active project file
"""
self._execute_command(saveProject=Cmd.SaveProjectRequest(filePath=path))
return self
@add_method(Project)
def close(self):
"""Close the current project (and open new blank project)"""
self._execute_command(closeProject=Empty())
@add_method(Project)
def load_case(self, path):
"""Load a new case from the given file path
@ -62,18 +68,19 @@ def load_case(self, path):
Arguments:
path(str): file path to case
Returns:
A rips Case object
:class:`rips.generated.pdm_objects.Case`
"""
command_reply = self._execute_command(loadCase=Cmd.FilePathRequest(
path=path))
return self.case(command_reply.loadCaseResult.id)
@add_method(Project)
def selected_cases(self):
"""Get a list of all cases selected in the project tree
Returns:
A list of rips Case objects
A list of :class:`rips.generated.pdm_objects.Case`
"""
case_infos = self._project_stub.GetSelectedCases(Empty())
cases = []
@ -81,15 +88,17 @@ def selected_cases(self):
cases.append(self.case(case_info.id))
return cases
@add_method(Project)
def cases(self):
"""Get a list of all cases in the project
Returns:
A list of rips Case objects
A list of :class:`rips.generated.pdm_objects.Case`
"""
return self.descendants(Case)
@add_method(Project)
def case(self, case_id):
"""Get a specific case from the provided case Id
@ -97,7 +106,7 @@ def case(self, case_id):
Arguments:
id(int): case id
Returns:
A rips Case object
:class:`rips.generated.pdm_objects.Case`
"""
allCases = self.cases()
for case in allCases:
@ -105,10 +114,11 @@ def case(self, case_id):
return case
return None
@add_method(Project)
def replace_source_cases(self, grid_list_file, case_group_id=0):
"""Replace all source cases within a case group
Arguments:
grid_list_file (str): path to file containing a list of cases
case_group_id (int): id of the case group to replace
@ -117,14 +127,15 @@ def replace_source_cases(self, grid_list_file, case_group_id=0):
replaceSourceCases=Cmd.ReplaceSourceCasesRequest(
gridListFile=grid_list_file, caseGroupId=case_group_id))
@add_method(Project)
def create_grid_case_group(self, case_paths):
"""Create a Grid Case Group from a list of cases
Arguments:
case_paths (list): list of file path strings
Returns:
A case group id and name
:class:`rips.generated.pdm_objects.GridCaseGroup`
"""
command_reply = self._execute_command(
createGridCaseGroup=Cmd.CreateGridCaseGroupRequest(
@ -132,18 +143,21 @@ def create_grid_case_group(self, case_paths):
return self.grid_case_group(
command_reply.createGridCaseGroupResult.groupId)
@add_method(Project)
def views(self):
"""Get a list of views belonging to a project"""
return self.descendants(View)
@add_method(Project)
def view(self, view_id):
"""Get a particular view belonging to a case by providing view id
Arguments:
view_id(int): view id
Returns: a view object
Returns:
:class:`rips.generated.pdm_objects.View`
"""
views = self.views()
for view_object in views:
@ -151,9 +165,14 @@ def view(self, view_id):
return view_object
return None
@add_method(Project)
def plots(self):
"""Get a list of all plots belonging to a project"""
"""Get a list of all plots belonging to a project
Returns:
List of :class:`rips.generated.pdm_objects.Plot`
"""
pdm_objects = self.descendants(PlotWindow)
plot_list = []
for pdm_object in pdm_objects:
@ -161,12 +180,16 @@ def plots(self):
plot_list.append(pdm_object)
return plot_list
@add_method(Project)
def plot(self, view_id):
"""Get a particular plot by providing view id
Arguments:
view_id(int): view id
Returns: a plot object
Returns:
:class:`rips.generated.pdm_objects.Plot`
"""
plots = self.plots()
for plot_object in plots:
@ -174,20 +197,28 @@ def plot(self, view_id):
return plot_object
return None
@add_method(Project)
def grid_case_groups(self):
"""Get a list of all grid case groups in the project"""
"""Get a list of all grid case groups in the project
Returns:
List of :class:`rips.generated.pdm_objects.GridCaseGroup`
"""
case_groups = self.descendants(GridCaseGroup)
return case_groups
@add_method(Project)
def grid_case_group(self, group_id):
"""Get a particular grid case group belonging to a project
Arguments:
groupId(int): group id
Returns: a grid case group object
Returns:
:class:`rips.generated.pdm_objects.GridCaseGroup`
"""
case_groups = self.grid_case_groups()
for case_group in case_groups:
@ -195,10 +226,11 @@ def grid_case_group(self, group_id):
return case_group
return None
@add_method(Project)
def export_multi_case_snapshots(self, grid_list_file):
"""Export snapshots for a set of cases
Arguments:
grid_list_file (str): Path to a file containing a list of grids to export snapshot for
"""
@ -206,10 +238,11 @@ def export_multi_case_snapshots(self, grid_list_file):
exportMultiCaseSnapshot=Cmd.ExportMultiCaseRequest(
gridListFile=grid_list_file))
@add_method(Project)
def export_snapshots(self, snapshot_type='ALL', prefix='', plot_format='PNG'):
""" Export all snapshots of a given type
Arguments:
snapshot_type (str): Enum string ('ALL', 'VIEWS' or 'PLOTS')
prefix (str): Exported file name prefix
@ -219,10 +252,11 @@ def export_snapshots(self, snapshot_type='ALL', prefix='', plot_format='PNG'):
exportSnapshots=Cmd.ExportSnapshotsRequest(
type=snapshot_type, prefix=prefix, caseId=-1, viewId=-1, plotOutputFormat=plot_format))
@add_method(Project)
def export_well_paths(self, well_paths=None, md_step_size=5.0):
""" Export a set of well paths
Arguments:
well_paths(list): List of strings of well paths. If none, export all.
md_step_size(double): resolution of the exported well path
@ -234,11 +268,12 @@ def export_well_paths(self, well_paths=None, md_step_size=5.0):
return self._execute_command(exportWellPaths=Cmd.ExportWellPathRequest(
wellPathNames=well_paths, mdStepSize=md_step_size))
@add_method(Project)
def scale_fracture_template(self, template_id, half_length, height,
d_factor, conductivity):
""" Scale fracture template parameters
Arguments:
template_id(int): ID of fracture template
half_length (double): Half Length scale factor
@ -254,10 +289,11 @@ def scale_fracture_template(self, template_id, half_length, height,
dFactor=d_factor,
conductivity=conductivity))
@add_method(Project)
def set_fracture_containment(self, template_id, top_layer, base_layer):
""" Set fracture template containment parameters
Arguments:
template_id(int): ID of fracture template
top_layer (int): Top layer containment
@ -267,6 +303,7 @@ def set_fracture_containment(self, template_id, top_layer, base_layer):
setFractureContainment=Cmd.SetFracContainmentRequest(
id=template_id, topLayer=top_layer, baseLayer=base_layer))
@add_method(Project)
def import_well_paths(self, well_path_files=None, well_path_folder=''):
""" Import well paths into project
@ -276,33 +313,35 @@ def import_well_paths(self, well_path_files=None, well_path_folder=''):
well_path_folder(str): A folder path containing files to import
Returns:
A list of WellPath objects
List of :class:`rips.generated.pdm_objects.WellPath`
"""
if well_path_files is None:
well_path_files = []
res = self._execute_command(importWellPaths=Cmd.ImportWellPathsRequest(wellPathFolder=well_path_folder,
wellPathFiles=well_path_files))
wellPathFiles=well_path_files))
well_paths = []
for well_path_name in res.importWellPathsResult.wellPathNames:
well_paths.append(self.well_path_by_name(well_path_name))
return well_paths
@add_method(Project)
def well_paths(self):
"""Get a list of all well paths in the project
Returns:
A list of rips WellPath objects
List of :class:`rips.generated.pdm_objects.WellPath`
"""
return self.descendants(WellPath)
@add_method(Project)
def well_path_by_name(self, well_path_name):
"""Get a specific well path by name from the project
Returns:
A WellPath object
:class:`rips.generated.pdm_objects.WellPath`
"""
all_well_paths = self.well_paths()
for well_path in all_well_paths:
@ -310,6 +349,7 @@ def well_path_by_name(self, well_path_name):
return well_path
return None
@add_method(Project)
def import_well_log_files(self, well_log_files=None, well_log_folder=''):
""" Import well log files into project
@ -325,9 +365,10 @@ def import_well_log_files(self, well_log_files=None, well_log_folder=''):
if well_log_files is None:
well_log_files = []
res = self._execute_command(importWellLogFiles=Cmd.ImportWellLogFilesRequest(wellLogFolder=well_log_folder,
wellLogFiles=well_log_files))
wellLogFiles=well_log_files))
return res.importWellLogFilesResult.wellPathNames
@add_method(Project)
def import_formation_names(self, formation_files=None):
""" Import formation names into project
@ -342,5 +383,5 @@ def import_formation_names(self, formation_files=None):
formation_files = [formation_files]
self._execute_command(importFormationNames=Cmd.ImportFormationNamesRequest(formationFiles=formation_files,
applyToCaseId=-1))
applyToCaseId=-1))

View File

@ -15,24 +15,60 @@ from rips.generated.pdm_objects import SimulationWell
from rips.pdmobject import PdmObject, add_method
import rips.case
@add_method(SimulationWell)
def __custom_init__(self, pb2_object, channel):
self._simulation_well_stub = SimulationWell_pb2_grpc.SimulationWellStub(channel)
@add_method(SimulationWell)
def status(self, timestep):
"""Get simulation well status
**SimulationWellStatus class description**::
Parameter | Description | Type
----------- | ------------------------------------------------------------- | -----
well_type | Well type as string | string
is_open | True if simulation well is open at the specified time step | bool
Arguments:
timestep(int): Time step index
"""
sim_well_request = SimulationWell_pb2.SimulationWellRequest(case_id=self.case().id,
well_name=self.name,
timestep=timestep)
return self._simulation_well_stub.GetSimulationWellStatus(sim_well_request)
@add_method(SimulationWell)
def cells(self, timestep):
"""Get reservoir cells the simulation well is defined for
**SimulationWellCellInfo class description**::
Parameter | Description | Type
----------- | --------------------------------------------------------- | -----
ijk | Cell IJK location | Vec3i
grid_index | Grid index | int
is_open | True if connection to is open at the specified time step | bool
branch_id | | int
segment_id | | int
Arguments:
timestep(int): Time step index
Returns:
List of SimulationWellCellInfo
"""
sim_well_request = SimulationWell_pb2.SimulationWellRequest(case_id=self.case().id,
well_name=self.name,
timestep=timestep)
return self._simulation_well_stub.GetSimulationWellCells(sim_well_request).data
@add_method(SimulationWell)
def case(self):
return self.ancestor(rips.case.Case)

View File

@ -9,6 +9,7 @@ import rips.case # Circular import of Case, which already imports View. Use ful
from rips.pdmobject import add_method
from rips.generated.pdm_objects import View, ViewWindow, EclipseView, GeoMechView
@add_method(View)
def apply_cell_result(self, result_type, result_variable):
"""Apply a regular cell result
@ -30,6 +31,7 @@ def apply_cell_result(self, result_type, result_variable):
cell_result.result_variable = result_variable
cell_result.update()
@add_method(View)
def apply_flow_diagnostics_cell_result(
self,
@ -71,6 +73,7 @@ def apply_flow_diagnostics_cell_result(
cell_result.selected_producer_tracers = producers
cell_result.update()
@add_method(View)
def clone(self):
"""Clone the current view"""
@ -78,6 +81,7 @@ def clone(self):
viewId=self.id)).createViewResult.viewId
return self.case().view(view_id)
@add_method(View)
def set_time_step(self, time_step):
"""Set the time step for current view"""
@ -85,10 +89,11 @@ def set_time_step(self, time_step):
return self._execute_command(setTimeStep=Cmd.SetTimeStepParams(
caseId=case_id, viewId=self.id, timeStep=time_step))
@add_method(View)
def export_sim_well_fracture_completions(self, time_step,
simulation_well_names, file_split,
compdat_export):
simulation_well_names, file_split,
compdat_export):
"""Export fracture completions for simulation wells
**Parameters**::
@ -129,12 +134,13 @@ def export_sim_well_fracture_completions(self, time_step,
fileSplit=file_split,
compdatExport=compdat_export))
@add_method(View)
def export_visible_cells(self,
export_keyword='FLUXNUM',
visible_active_cells_value=1,
hidden_active_cells_value=0,
inactive_cells_value=0):
export_keyword='FLUXNUM',
visible_active_cells_value=1,
hidden_active_cells_value=0,
inactive_cells_value=0):
"""Export special properties for all visible cells.
Arguments:
@ -154,6 +160,7 @@ def export_visible_cells(self,
hiddenActiveCellsValue=hidden_active_cells_value,
inactiveCellsValue=inactive_cells_value))
@add_method(View)
def export_property(self, undefined_value=0.0):
""" Export the current Eclipse property from the view
@ -168,6 +175,7 @@ def export_property(self, undefined_value=0.0):
viewIds=[self.id],
undefinedValue=undefined_value))
@add_method(ViewWindow)
def case(self):
"""Get the case the view belongs to"""
@ -175,10 +183,11 @@ def case(self):
assert(mycase is not None)
return mycase
@add_method(ViewWindow)
def export_snapshot(self, prefix='', export_folder=''):
""" Export snapshot for the current view
Arguments:
prefix (str): Exported file name prefix
export_folder(str): The path to export to. By default will use the global export folder
@ -186,7 +195,7 @@ def export_snapshot(self, prefix='', export_folder=''):
case_id = self.case().id
return self._execute_command(
exportSnapshots=Cmd.ExportSnapshotsRequest(type='VIEWS',
prefix=prefix,
caseId=case_id,
viewId=self.id,
exportFolder=export_folder))
prefix=prefix,
caseId=case_id,
viewId=self.id,
exportFolder=export_folder))

View File

@ -9,47 +9,49 @@ from rips.pdmobject import PdmObject
from rips.generated.pdm_objects import WellLogPlot
from rips.pdmobject import add_method
@add_method(WellLogPlot)
def export_data_as_las(self, export_folder, file_prefix='', export_tvdrkb=False, capitalize_file_names=False, resample_interval=0.0, convert_to_standard_units=False):
""" Export LAS file(s) for the current plot
Arguments:
export_folder(str): The path to export to. By default will use the global export folder
file_prefix (str): Exported file name prefix
export_tvdrkb(bool): Export in TVD-RKB format
capitalize_file_names(bool): Make all file names upper case
resample_interval(double): if > 0.0 the files will be resampled
Returns:
A list of files exported
"""
"""
res = self._execute_command(exportWellLogPlotData=Cmd.ExportWellLogPlotDataRequest(exportFormat='LAS',
viewId=self.id,
exportFolder=export_folder,
filePrefix=file_prefix,
exportTvdRkb=export_tvdrkb,
capitalizeFileNames=capitalize_file_names,
resampleInterval=resample_interval,
convertCurveUnits=convert_to_standard_units))
viewId=self.id,
exportFolder=export_folder,
filePrefix=file_prefix,
exportTvdRkb=export_tvdrkb,
capitalizeFileNames=capitalize_file_names,
resampleInterval=resample_interval,
convertCurveUnits=convert_to_standard_units))
return res.exportWellLogPlotDataResult.exportedFiles
@add_method(WellLogPlot)
def export_data_as_ascii(self, export_folder, file_prefix='', capitalize_file_names=False):
""" Export LAS file(s) for the current plot
Arguments:
export_folder(str): The path to export to. By default will use the global export folder
file_prefix (str): Exported file name prefix
capitalize_file_names(bool): Make all file names upper case
Returns:
A list of files exported
"""
res = self._execute_command(exportWellLogPlotData=Cmd.ExportWellLogPlotDataRequest(exportFormat='ASCII',
viewId=self.id,
exportFolder=export_folder,
filePrefix=file_prefix,
exportTvdRkb=False,
capitalizeFileNames=capitalize_file_names,
resampleInterval=0.0))
viewId=self.id,
exportFolder=export_folder,
filePrefix=file_prefix,
exportTvdRkb=False,
capitalizeFileNames=capitalize_file_names,
resampleInterval=0.0))
return res.exportWellLogPlotDataResult.exportedFiles

View File

@ -18,142 +18,147 @@ AllWells
========
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/all_wells.py
========
============
AlterWbsPlot
========
============
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/alter_wbs_plot.py
========
=============
CaseGridGroup
========
=============
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/case_grid_group.py
========
CaseInfoStreamingExample
========
=================
CaseInfoStreaming
=================
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/case_info_streaming_example.py
========
==============
CellResultData
========
==============
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/cell_result_data.py
========
==============
CommandExample
========
==============
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/command_example.py
========
===============
Create WBS Plot
========
===============
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/create_wbs_plot.py
========
=============
ErrorHandling
========
=============
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/error_handling.py
========
=================
ExportContourMaps
========
=================
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/export_contour_maps.py
========
===========
ExportPlots
========
===========
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/export_plots.py
========
===============
ExportSnapshots
========
===============
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/export_snapshots.py
========
===============
GridInformation
========
===============
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/grid_information.py
========
=================
Import Well Paths
========
=================
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/import_well_paths_and_logs.py
========
==================
InputPropTestAsync
========
==================
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/input_prop_test_async.py
========
=================
InputPropTestSync
========
=================
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/input_prop_test_sync.py
========
===============
InstanceExample
========
===============
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/instance_example.py
========
============================
LaunchWithCommandLineOptions
========
============================
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/launch_with_commandline_options.py
========
=================================
Launch Using Command Line Options
========
=================================
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/launch_with_commandline_options.py
========
==============
NewSummaryPlot
========
==============
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/new_summary_plot.py
========
==============
SelectedCases
========
==============
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/selected_cases.py
========
==============
SelectedCells
========
==============
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/selected_cells.py
========
==============
SetCellResult
========
==============
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/set_cell_result.py
========
========================
SetFlowDiagnosticsResult
========
========================
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/set_flow_diagnostics_result.py
========
==================
SetGridProperties
========
==================
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/set_grid_properties.py
========
==================================
SoilAverageAsync
========
==================================
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/soil_average_async.py
========
==================================
SoilAverageSync
========
==================================
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/soil_average_sync.py
========
==================================
SoilPorvAsync
========
==================================
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/soil_porv_async.py
========
==================================
SoilPorvSync
========
==================================
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/soil_porv_sync.py
========
==================================
SummaryVectors
==================================
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/summary_vectors.py
==================================
ViewExample
========
==================================
.. literalinclude:: ../../ApplicationCode/GrpcInterface/Python/rips/PythonExamples/view_example.py

View File

@ -4,12 +4,13 @@ ResInsight Python API
The ResInsight Python API allows you to interact with a running ResInsight instance from `Python 3 <https://www.python.org/download/releases/3.0/>`_.
This enables you to:
* start ResInsight from Python
* communicate with an a running ResInsight instance
* load a ResInsight project file
* load data files such as Eclipse EGRID files and summary files
* extract data to Python for further processing and automation
* export snapshots of graphics
* Start ResInsight from Python.
* Communicate with a running ResInsight instance.
* Load a ResInsight project file.
* Load data files such as Eclipse EGRID files and summary files.
* Extract data to Python for further processing and automation.
* Export snapshots of graphics.
* And lots of other things...
Documentation Sites
===================