mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #5799 from OPM/py-sum-case
Python Summary Case : Import and access to objects
This commit is contained in:
@@ -43,40 +43,43 @@ const DateTimeSpan RiaQDateTimeTools::TIMESPAN_DECADE = DateTimeSpan( 10, 0, 0
|
|||||||
|
|
||||||
namespace caf
|
namespace caf
|
||||||
{
|
{
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void caf::AppEnum<RiaQDateTimeTools::DateFormatComponents>::setUp()
|
void caf::AppEnum<RiaQDateTimeTools::DateFormatComponents>::setUp()
|
||||||
{
|
{
|
||||||
addItem( RiaQDateTimeTools::DATE_FORMAT_NONE, "NO_DATE", "No Date" );
|
addItem( RiaQDateTimeTools::DATE_FORMAT_NONE, "NO_DATE", "No Date" );
|
||||||
addItem( RiaQDateTimeTools::DATE_FORMAT_YEAR, "YEAR", "Year Only" );
|
addItem( RiaQDateTimeTools::DATE_FORMAT_YEAR, "YEAR", "Year Only" );
|
||||||
addItem( RiaQDateTimeTools::DATE_FORMAT_YEAR_MONTH, "YEAR_MONTH", "Year and Month" );
|
addItem( RiaQDateTimeTools::DATE_FORMAT_YEAR_MONTH, "YEAR_MONTH", "Year and Month" );
|
||||||
addItem( RiaQDateTimeTools::DATE_FORMAT_YEAR_MONTH_DAY, "YEAR_MONTH_DAY", "Year, Month and Day" );
|
addItem( RiaQDateTimeTools::DATE_FORMAT_YEAR_MONTH_DAY, "YEAR_MONTH_DAY", "Year, Month and Day" );
|
||||||
setDefault( RiaQDateTimeTools::DATE_FORMAT_YEAR_MONTH_DAY );
|
setDefault( RiaQDateTimeTools::DATE_FORMAT_YEAR_MONTH_DAY );
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void caf::AppEnum<RiaQDateTimeTools::TimeFormatComponents>::setUp()
|
void caf::AppEnum<RiaQDateTimeTools::TimeFormatComponents>::setUp()
|
||||||
{
|
{
|
||||||
addItem( RiaQDateTimeTools::TIME_FORMAT_NONE, "NO_TIME", "No Time of Day" );
|
addItem( RiaQDateTimeTools::TIME_FORMAT_NONE, "NO_TIME", "No Time of Day" );
|
||||||
addItem( RiaQDateTimeTools::TIME_FORMAT_HOUR, "HOUR", "Hour Only" );
|
addItem( RiaQDateTimeTools::TIME_FORMAT_HOUR, "HOUR", "Hour Only" );
|
||||||
addItem( RiaQDateTimeTools::TIME_FORMAT_HOUR_MINUTE, "HOUR_MINUTE", "Hour and Minute" );
|
addItem( RiaQDateTimeTools::TIME_FORMAT_HOUR_MINUTE, "HOUR_MINUTE", "Hour and Minute" );
|
||||||
addItem( RiaQDateTimeTools::TIME_FORMAT_HOUR_MINUTE_SECOND, "HOUR_MINUTE_SECONDS", "Hour, Minutes and Seconds" );
|
addItem( RiaQDateTimeTools::TIME_FORMAT_HOUR_MINUTE_SECOND, "HOUR_MINUTE_SECONDS", "Hour, Minutes and Seconds" );
|
||||||
setDefault( RiaQDateTimeTools::TIME_FORMAT_NONE );
|
setDefault( RiaQDateTimeTools::TIME_FORMAT_NONE );
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void caf::AppEnum<RiaQDateTimeTools::DateTimePeriod>::setUp()
|
void caf::AppEnum<RiaQDateTimeTools::DateTimePeriod>::setUp()
|
||||||
{
|
{
|
||||||
addItem( RiaQDateTimeTools::DateTimePeriod::NONE, "NONE", "None" );
|
addItem( RiaQDateTimeTools::DateTimePeriod::NONE, "NONE", "None" );
|
||||||
addItem( RiaQDateTimeTools::DateTimePeriod::DAY, "DAY", "Day" );
|
addItem( RiaQDateTimeTools::DateTimePeriod::DAY, "DAY", "Day" );
|
||||||
addItem( RiaQDateTimeTools::DateTimePeriod::WEEK, "WEEK", "Week" );
|
addItem( RiaQDateTimeTools::DateTimePeriod::WEEK, "WEEK", "Week" );
|
||||||
addItem( RiaQDateTimeTools::DateTimePeriod::MONTH, "MONTH", "Month" );
|
addItem( RiaQDateTimeTools::DateTimePeriod::MONTH, "MONTH", "Month" );
|
||||||
addItem( RiaQDateTimeTools::DateTimePeriod::QUARTER, "QUARTER", "Quarter," );
|
addItem( RiaQDateTimeTools::DateTimePeriod::QUARTER, "QUARTER", "Quarter" );
|
||||||
addItem( RiaQDateTimeTools::DateTimePeriod::HALFYEAR, "HALFYEAR", "Half Year" );
|
addItem( RiaQDateTimeTools::DateTimePeriod::HALFYEAR, "HALFYEAR", "Half Year" );
|
||||||
addItem( RiaQDateTimeTools::DateTimePeriod::YEAR, "YEAR,", "Year," );
|
addItem( RiaQDateTimeTools::DateTimePeriod::YEAR, "YEAR", "Year" );
|
||||||
addItem( RiaQDateTimeTools::DateTimePeriod::DECADE, "DECADE", "Decade" );
|
addItem( RiaQDateTimeTools::DateTimePeriod::DECADE, "DECADE", "Decade" );
|
||||||
setDefault( RiaQDateTimeTools::DateTimePeriod::NONE );
|
setDefault( RiaQDateTimeTools::DateTimePeriod::NONE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clang-format on
|
||||||
} // namespace caf
|
} // namespace caf
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -198,7 +198,6 @@ bool RicImportSummaryCasesFeature::createSummaryCasesFromFiles( const QStringLis
|
|||||||
{
|
{
|
||||||
QString errorMessage = fileSelector.createCombinedErrorMessage();
|
QString errorMessage = fileSelector.createCombinedErrorMessage();
|
||||||
RiaLogging::error( errorMessage );
|
RiaLogging::error( errorMessage );
|
||||||
QMessageBox::warning( nullptr, QString( "Problem Importing Summary Case File(s)" ), errorMessage );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1,18 +1,31 @@
|
|||||||
import rips
|
import rips
|
||||||
|
import time
|
||||||
|
|
||||||
resinsight = rips.Instance.find()
|
resinsight = rips.Instance.find()
|
||||||
|
|
||||||
project = resinsight.project
|
project = resinsight.project
|
||||||
summary_cases = project.descendants(rips.SummaryCase)
|
|
||||||
|
|
||||||
# Assumes at least one summery case loaded
|
# Use the following commented lines to import a file from disk
|
||||||
firstCase = summary_cases[0]
|
# filename = "path/to/file/1_R001_REEK-0.SMSPEC"
|
||||||
|
# summary_case = project.import_summary_case(filename)
|
||||||
|
|
||||||
|
# Assumes at least one summery case loaded with case_id 1
|
||||||
|
summary_case = project.summary_case(1)
|
||||||
|
if summary_case is None:
|
||||||
|
print("No summary case found")
|
||||||
|
exit()
|
||||||
|
|
||||||
vector_name = "FOPT"
|
vector_name = "FOPT"
|
||||||
summary_data = firstCase.summary_vector_values(vector_name)
|
summary_data = summary_case.summary_vector_values(vector_name)
|
||||||
|
|
||||||
print("Data for summary vector " + vector_name)
|
print("Data for summary vector " + vector_name)
|
||||||
print(summary_data.values)
|
print(summary_data.values)
|
||||||
|
|
||||||
time_steps = firstCase.available_time_steps()
|
time_steps = summary_case.available_time_steps()
|
||||||
print(time_steps.values)
|
print(time_steps.values)
|
||||||
|
|
||||||
|
summary_data_sampled = summary_case.resample_values("FOPT", "QUARTER")
|
||||||
|
print("\nResampled data")
|
||||||
|
|
||||||
|
for t, value in zip(summary_data_sampled.time_steps, summary_data_sampled.values):
|
||||||
|
print(time.strftime("%a, %d %b %Y ", time.gmtime(t)) + " | " + str(value))
|
||||||
|
|||||||
@@ -5,6 +5,22 @@
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
Module containing the Case class
|
Module containing the Case class
|
||||||
|
|
||||||
|
ResInsight Case class
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
id (int): Case Id corresponding to case Id in ResInsight project.
|
||||||
|
name (str): Case name
|
||||||
|
group_id (int): Case Group id
|
||||||
|
chunkSize(int): The size of each chunk during value streaming.
|
||||||
|
A good chunk size is 64KiB = 65536B.
|
||||||
|
Meaning the ideal number of doubles would be 8192.
|
||||||
|
However we need overhead space, so the default is 8160.
|
||||||
|
This leaves 256B for overhead.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import builtins
|
import builtins
|
||||||
@@ -29,22 +45,6 @@ from rips.view import View
|
|||||||
from rips.generated.pdm_objects import WellBoreStabilityPlot, WbsParameters
|
from rips.generated.pdm_objects import WellBoreStabilityPlot, WbsParameters
|
||||||
from rips.simulation_well import SimulationWell
|
from rips.simulation_well import SimulationWell
|
||||||
|
|
||||||
"""ResInsight case class
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
Attributes:
|
|
||||||
id (int): Case Id corresponding to case Id in ResInsight project.
|
|
||||||
name (str): Case name
|
|
||||||
group_id (int): Case Group id
|
|
||||||
chunkSize(int): The size of each chunk during value streaming.
|
|
||||||
A good chunk size is 64KiB = 65536B.
|
|
||||||
Meaning the ideal number of doubles would be 8192.
|
|
||||||
However we need overhead space, so the default is 8160.
|
|
||||||
This leaves 256B for overhead.
|
|
||||||
"""
|
|
||||||
@add_method(Case)
|
@add_method(Case)
|
||||||
def __custom_init__(self, pb2_object, channel):
|
def __custom_init__(self, pb2_object, channel):
|
||||||
self.__case_stub = Case_pb2_grpc.CaseStub(self._channel)
|
self.__case_stub = Case_pb2_grpc.CaseStub(self._channel)
|
||||||
@@ -102,18 +102,21 @@ def __generate_property_input_chunks(self, array, parameters):
|
|||||||
|
|
||||||
@add_method(Case)
|
@add_method(Case)
|
||||||
def grid(self, index):
|
def grid(self, index):
|
||||||
"""Get Grid of a given index. Returns a rips Grid object
|
"""Get Grid of a given index
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
index (int): The grid index
|
index (int): The grid index
|
||||||
|
|
||||||
Returns: Grid object
|
Returns: :class:`rips.grid.Grid`
|
||||||
"""
|
"""
|
||||||
return Grid(index, self, self.channel())
|
return Grid(index, self, self.channel())
|
||||||
|
|
||||||
@add_method(Case)
|
@add_method(Case)
|
||||||
def grids(self):
|
def grids(self):
|
||||||
"""Get a list of all rips Grid objects in the case"""
|
"""Get a list of all rips Grid objects in the case
|
||||||
|
|
||||||
|
Returns: List of :class:`rips.grid.Grid`
|
||||||
|
"""
|
||||||
grid_list = []
|
grid_list = []
|
||||||
for i in range(0, self.__grid_count()):
|
for i in range(0, self.__grid_count()):
|
||||||
grid_list.append(Grid(i, self, self.channel()))
|
grid_list.append(Grid(i, self, self.channel()))
|
||||||
@@ -870,8 +873,8 @@ def import_formation_names(self, formation_files=None):
|
|||||||
elif isinstance(formation_files, str):
|
elif isinstance(formation_files, str):
|
||||||
formation_files = [formation_files]
|
formation_files = [formation_files]
|
||||||
|
|
||||||
res = self._execute_command(importFormationNames=Cmd.ImportFormationNamesRequest(formationFiles=formation_files,
|
self._execute_command(importFormationNames=Cmd.ImportFormationNamesRequest(formationFiles=formation_files,
|
||||||
applyToCaseId=self.id))
|
applyToCaseId=self.id))
|
||||||
|
|
||||||
@add_method(Case)
|
@add_method(Case)
|
||||||
def simulation_wells(self):
|
def simulation_wells(self):
|
||||||
|
|||||||
@@ -366,6 +366,9 @@ def _call_pdm_method(self, method_name, **kwargs):
|
|||||||
pb2_object = self._pdm_object_stub.CallPdmObjectMethod(request)
|
pb2_object = self._pdm_object_stub.CallPdmObjectMethod(request)
|
||||||
|
|
||||||
child_class_definition = class_from_keyword(pb2_object.class_keyword)
|
child_class_definition = class_from_keyword(pb2_object.class_keyword)
|
||||||
|
if child_class_definition is None:
|
||||||
|
return None
|
||||||
|
|
||||||
pdm_object = child_class_definition(pb2_object=pb2_object, channel=self.channel())
|
pdm_object = child_class_definition(pb2_object=pb2_object, channel=self.channel())
|
||||||
return pdm_object
|
return pdm_object
|
||||||
|
|
||||||
|
|||||||
@@ -341,5 +341,6 @@ def import_formation_names(self, formation_files=None):
|
|||||||
elif isinstance(formation_files, str):
|
elif isinstance(formation_files, str):
|
||||||
formation_files = [formation_files]
|
formation_files = [formation_files]
|
||||||
|
|
||||||
res = self._execute_command(importFormationNames=Cmd.ImportFormationNamesRequest(formationFiles=formation_files,
|
self._execute_command(importFormationNames=Cmd.ImportFormationNamesRequest(formationFiles=formation_files,
|
||||||
applyToCaseId=-1))
|
applyToCaseId=-1))
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
import sys
|
||||||
|
import os
|
||||||
|
import math
|
||||||
|
|
||||||
|
sys.path.insert(1, os.path.join(sys.path[0], '../../'))
|
||||||
|
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)
|
||||||
|
assert(summary_case.id == 1)
|
||||||
|
|
||||||
|
case_id = 234
|
||||||
|
found_summary_case = rips_instance.project.summary_case(case_id)
|
||||||
|
assert(found_summary_case is None)
|
||||||
|
|
||||||
|
correct_case_id = 1
|
||||||
|
found_summary_case = rips_instance.project.summary_case(correct_case_id)
|
||||||
|
assert(found_summary_case is not None)
|
||||||
|
|
||||||
|
rips_instance.project.close()
|
||||||
|
correct_case_id = 1
|
||||||
|
found_summary_case = rips_instance.project.summary_case(correct_case_id)
|
||||||
|
assert(found_summary_case is None)
|
||||||
|
|
||||||
|
|
||||||
|
def test_summary_data(rips_instance, initialize_test):
|
||||||
|
casePath = dataroot.PATH + "/flow_diagnostics_test/SIMPLE_SUMMARY2.SMSPEC"
|
||||||
|
summary_case = rips_instance.project.import_summary_case(casePath)
|
||||||
|
assert(summary_case.id == 1)
|
||||||
|
|
||||||
|
addresses = summary_case.available_addresses()
|
||||||
|
assert(len(addresses.values) == 343)
|
||||||
|
|
||||||
|
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)
|
||||||
|
assert(summary_case.id == 1)
|
||||||
|
|
||||||
|
summary_data_sampled = summary_case.resample_values("FOPT", "NONE")
|
||||||
|
assert(len(summary_data_sampled.values) == 60)
|
||||||
|
assert(len(summary_data_sampled.time_steps) == 60)
|
||||||
|
|
||||||
|
summary_data_sampled = summary_case.resample_values("FOPT", "DAY")
|
||||||
|
assert(len(summary_data_sampled.values) == 721)
|
||||||
|
assert(len(summary_data_sampled.time_steps) == 721)
|
||||||
|
|
||||||
|
summary_data_sampled = summary_case.resample_values("FOPT", "MONTH")
|
||||||
|
assert(len(summary_data_sampled.values) == 24)
|
||||||
|
assert(len(summary_data_sampled.time_steps) == 24)
|
||||||
|
|
||||||
|
summary_data_sampled = summary_case.resample_values("FOPT", "QUARTER")
|
||||||
|
assert(len(summary_data_sampled.values) == 8)
|
||||||
|
assert(len(summary_data_sampled.time_steps) == 8)
|
||||||
|
|
||||||
|
summary_data_sampled = summary_case.resample_values("FOPT", "YEAR")
|
||||||
|
assert(len(summary_data_sampled.values) == 3)
|
||||||
|
assert(len(summary_data_sampled.time_steps) == 3)
|
||||||
@@ -538,6 +538,11 @@ grpc::Status RiaGrpcPdmObjectService::CallPdmObjectMethod( grpc::ServerContext*
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if ( method->isNullptrValidResult() )
|
||||||
|
{
|
||||||
|
return grpc::Status::OK;
|
||||||
|
}
|
||||||
|
|
||||||
return grpc::Status( grpc::NOT_FOUND, "No result returned from Method" );
|
return grpc::Status( grpc::NOT_FOUND, "No result returned from Method" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ set (SOURCE_GROUP_HEADER_FILES
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RimcSummaryPlotCollection.h
|
${CMAKE_CURRENT_LIST_DIR}/RimcSummaryPlotCollection.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimcSummaryCase.h
|
${CMAKE_CURRENT_LIST_DIR}/RimcSummaryCase.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimcSummaryResampleData.h
|
${CMAKE_CURRENT_LIST_DIR}/RimcSummaryResampleData.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RimcProject.h
|
||||||
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerDouble.h
|
${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerDouble.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerString.h
|
${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerString.h
|
||||||
@@ -13,6 +14,7 @@ set (SOURCE_GROUP_SOURCE_FILES
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RimcSummaryPlotCollection.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimcSummaryPlotCollection.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimcSummaryCase.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimcSummaryCase.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimcSummaryResampleData.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimcSummaryResampleData.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RimcProject.cpp
|
||||||
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerDouble.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerDouble.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerString.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerString.cpp
|
||||||
|
|||||||
141
ApplicationCode/ProjectDataModelCommands/RimcProject.cpp
Normal file
141
ApplicationCode/ProjectDataModelCommands/RimcProject.cpp
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2020- 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.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "RimcProject.h"
|
||||||
|
|
||||||
|
#include "RiaApplication.h"
|
||||||
|
#include "RicImportSummaryCasesFeature.h"
|
||||||
|
|
||||||
|
#include "RimFileSummaryCase.h"
|
||||||
|
#include "RimProject.h"
|
||||||
|
#include "RimSummaryCase.h"
|
||||||
|
#include "RiuPlotMainWindow.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimProject, RimProject_importSummaryCase, "importSummaryCase" );
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimProject_importSummaryCase::RimProject_importSummaryCase( caf::PdmObjectHandle* self )
|
||||||
|
: caf::PdmObjectMethod( self )
|
||||||
|
{
|
||||||
|
CAF_PDM_InitObject( "Import Summary Case", "", "", "Import Summary Case" );
|
||||||
|
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_fileName, "FileName", "", "", "", "" );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
caf::PdmObjectHandle* RimProject_importSummaryCase::execute()
|
||||||
|
{
|
||||||
|
QStringList summaryFileNames{m_fileName};
|
||||||
|
std::vector<RimSummaryCase*> newCases;
|
||||||
|
|
||||||
|
if ( RicImportSummaryCasesFeature::createSummaryCasesFromFiles( summaryFileNames, &newCases ) )
|
||||||
|
{
|
||||||
|
RicImportSummaryCasesFeature::addSummaryCases( newCases );
|
||||||
|
|
||||||
|
if ( RiaGuiApplication::isRunning() )
|
||||||
|
{
|
||||||
|
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
|
||||||
|
if ( mainPlotWindow && !newCases.empty() )
|
||||||
|
{
|
||||||
|
mainPlotWindow->updateSummaryPlotToolBar();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( newCases.size() == 1 )
|
||||||
|
{
|
||||||
|
return newCases[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimProject_importSummaryCase::resultIsPersistent() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::unique_ptr<caf::PdmObjectHandle> RimProject_importSummaryCase::defaultResult() const
|
||||||
|
{
|
||||||
|
return std::unique_ptr<caf::PdmObjectHandle>( new RimFileSummaryCase );
|
||||||
|
}
|
||||||
|
|
||||||
|
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimProject, RimProject_summaryCase, "summaryCase" );
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimProject_summaryCase::RimProject_summaryCase( caf::PdmObjectHandle* self )
|
||||||
|
: caf::PdmObjectMethod( self )
|
||||||
|
{
|
||||||
|
CAF_PDM_InitObject( "Find Summary Case", "", "", "Find Summary Case" );
|
||||||
|
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_caseId, "CaseId", "", "", "", "" );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
caf::PdmObjectHandle* RimProject_summaryCase::execute()
|
||||||
|
{
|
||||||
|
auto proj = RiaApplication::instance()->project();
|
||||||
|
auto sumCases = proj->allSummaryCases();
|
||||||
|
|
||||||
|
for ( auto s : sumCases )
|
||||||
|
{
|
||||||
|
if ( s->caseId() == m_caseId ) return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimProject_summaryCase::resultIsPersistent() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::unique_ptr<caf::PdmObjectHandle> RimProject_summaryCase::defaultResult() const
|
||||||
|
{
|
||||||
|
return std::unique_ptr<caf::PdmObjectHandle>( new RimFileSummaryCase );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimProject_summaryCase::isNullptrValidResult() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
64
ApplicationCode/ProjectDataModelCommands/RimcProject.h
Normal file
64
ApplicationCode/ProjectDataModelCommands/RimcProject.h
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2020- 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 "cafPdmField.h"
|
||||||
|
#include "cafPdmObjectHandle.h"
|
||||||
|
#include "cafPdmObjectMethod.h"
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RimProject_importSummaryCase : public caf::PdmObjectMethod
|
||||||
|
{
|
||||||
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
RimProject_importSummaryCase( caf::PdmObjectHandle* self );
|
||||||
|
|
||||||
|
caf::PdmObjectHandle* execute();
|
||||||
|
bool resultIsPersistent() const override;
|
||||||
|
std::unique_ptr<PdmObjectHandle> defaultResult() const override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
caf::PdmField<QString> m_fileName;
|
||||||
|
};
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RimProject_summaryCase : public caf::PdmObjectMethod
|
||||||
|
{
|
||||||
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
RimProject_summaryCase( caf::PdmObjectHandle* self );
|
||||||
|
|
||||||
|
caf::PdmObjectHandle* execute();
|
||||||
|
bool resultIsPersistent() const override;
|
||||||
|
std::unique_ptr<PdmObjectHandle> defaultResult() const override;
|
||||||
|
bool isNullptrValidResult() const override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
caf::PdmField<int> m_caseId;
|
||||||
|
};
|
||||||
@@ -225,22 +225,31 @@ caf::PdmObjectHandle* RimSummaryCase_resampleValues::execute()
|
|||||||
QString periodString = m_resamplingPeriod().trimmed();
|
QString periodString = m_resamplingPeriod().trimmed();
|
||||||
RiaQDateTimeTools::DateTimePeriod period = RiaQDateTimeTools::DateTimePeriodEnum::fromText( periodString );
|
RiaQDateTimeTools::DateTimePeriod period = RiaQDateTimeTools::DateTimePeriodEnum::fromText( periodString );
|
||||||
|
|
||||||
RiaTimeHistoryCurveResampler resampler;
|
auto dataObject = new RimcSummaryResampleData();
|
||||||
resampler.setCurveData( values, timeValues );
|
|
||||||
|
|
||||||
if ( RiaSummaryTools::hasAccumulatedData( adr ) )
|
if ( period != RiaQDateTimeTools::DateTimePeriod::NONE )
|
||||||
{
|
{
|
||||||
resampler.resampleAndComputePeriodEndValues( period );
|
RiaTimeHistoryCurveResampler resampler;
|
||||||
|
resampler.setCurveData( values, timeValues );
|
||||||
|
|
||||||
|
if ( RiaSummaryTools::hasAccumulatedData( adr ) )
|
||||||
|
{
|
||||||
|
resampler.resampleAndComputePeriodEndValues( period );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
resampler.resampleAndComputeWeightedMeanValues( period );
|
||||||
|
}
|
||||||
|
|
||||||
|
dataObject->m_timeValues = resampler.resampledTimeSteps();
|
||||||
|
dataObject->m_doubleValues = resampler.resampledValues();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
resampler.resampleAndComputeWeightedMeanValues( period );
|
dataObject->m_timeValues = timeValues;
|
||||||
|
dataObject->m_doubleValues = values;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto dataObject = new RimcSummaryResampleData();
|
|
||||||
dataObject->m_timeValues = resampler.resampledTimeSteps();
|
|
||||||
dataObject->m_doubleValues = resampler.resampledValues();
|
|
||||||
|
|
||||||
return dataObject;
|
return dataObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,9 +61,15 @@ class PdmObjectMethod : public PdmObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
PdmObjectMethod( PdmObjectHandle* self );
|
PdmObjectMethod( PdmObjectHandle* self );
|
||||||
|
|
||||||
// The returned object contains the results of the method and is the responsibility of the caller.
|
// The returned object contains the results of the method and is the responsibility of the caller.
|
||||||
virtual PdmObjectHandle* execute() = 0;
|
virtual PdmObjectHandle* execute() = 0;
|
||||||
virtual QString selfClassKeyword() const { return m_self->xmlCapability()->classKeyword(); }
|
|
||||||
|
// Some execute() methods can return a null pointer as a valid return value.
|
||||||
|
// Return true here to allow this
|
||||||
|
virtual bool isNullptrValidResult() const { return false; }
|
||||||
|
|
||||||
|
virtual QString selfClassKeyword() const { return m_self->xmlCapability()->classKeyword(); }
|
||||||
|
|
||||||
// True if object is a persistent project tree item. False if the object is to be deleted on completion.
|
// True if object is a persistent project tree item. False if the object is to be deleted on completion.
|
||||||
virtual bool resultIsPersistent() const = 0;
|
virtual bool resultIsPersistent() const = 0;
|
||||||
|
|||||||
@@ -5,6 +5,22 @@
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
Module containing the Case class
|
Module containing the Case class
|
||||||
|
|
||||||
|
ResInsight Case class
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
id (int): Case Id corresponding to case Id in ResInsight project.
|
||||||
|
name (str): Case name
|
||||||
|
group_id (int): Case Group id
|
||||||
|
chunkSize(int): The size of each chunk during value streaming.
|
||||||
|
A good chunk size is 64KiB = 65536B.
|
||||||
|
Meaning the ideal number of doubles would be 8192.
|
||||||
|
However we need overhead space, so the default is 8160.
|
||||||
|
This leaves 256B for overhead.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import builtins
|
import builtins
|
||||||
@@ -29,22 +45,6 @@ from rips.view import View
|
|||||||
from rips.generated.pdm_objects import WellBoreStabilityPlot, WbsParameters
|
from rips.generated.pdm_objects import WellBoreStabilityPlot, WbsParameters
|
||||||
from rips.simulation_well import SimulationWell
|
from rips.simulation_well import SimulationWell
|
||||||
|
|
||||||
"""ResInsight case class
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
Attributes:
|
|
||||||
id (int): Case Id corresponding to case Id in ResInsight project.
|
|
||||||
name (str): Case name
|
|
||||||
group_id (int): Case Group id
|
|
||||||
chunkSize(int): The size of each chunk during value streaming.
|
|
||||||
A good chunk size is 64KiB = 65536B.
|
|
||||||
Meaning the ideal number of doubles would be 8192.
|
|
||||||
However we need overhead space, so the default is 8160.
|
|
||||||
This leaves 256B for overhead.
|
|
||||||
"""
|
|
||||||
@add_method(Case)
|
@add_method(Case)
|
||||||
def __custom_init__(self, pb2_object, channel):
|
def __custom_init__(self, pb2_object, channel):
|
||||||
self.__case_stub = Case_pb2_grpc.CaseStub(self._channel)
|
self.__case_stub = Case_pb2_grpc.CaseStub(self._channel)
|
||||||
@@ -102,18 +102,21 @@ def __generate_property_input_chunks(self, array, parameters):
|
|||||||
|
|
||||||
@add_method(Case)
|
@add_method(Case)
|
||||||
def grid(self, index):
|
def grid(self, index):
|
||||||
"""Get Grid of a given index. Returns a rips Grid object
|
"""Get Grid of a given index
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
index (int): The grid index
|
index (int): The grid index
|
||||||
|
|
||||||
Returns: Grid object
|
Returns: :class:`rips.grid.Grid`
|
||||||
"""
|
"""
|
||||||
return Grid(index, self, self.channel())
|
return Grid(index, self, self.channel())
|
||||||
|
|
||||||
@add_method(Case)
|
@add_method(Case)
|
||||||
def grids(self):
|
def grids(self):
|
||||||
"""Get a list of all rips Grid objects in the case"""
|
"""Get a list of all rips Grid objects in the case
|
||||||
|
|
||||||
|
Returns: List of :class:`rips.grid.Grid`
|
||||||
|
"""
|
||||||
grid_list = []
|
grid_list = []
|
||||||
for i in range(0, self.__grid_count()):
|
for i in range(0, self.__grid_count()):
|
||||||
grid_list.append(Grid(i, self, self.channel()))
|
grid_list.append(Grid(i, self, self.channel()))
|
||||||
@@ -870,8 +873,8 @@ def import_formation_names(self, formation_files=None):
|
|||||||
elif isinstance(formation_files, str):
|
elif isinstance(formation_files, str):
|
||||||
formation_files = [formation_files]
|
formation_files = [formation_files]
|
||||||
|
|
||||||
res = self._execute_command(importFormationNames=Cmd.ImportFormationNamesRequest(formationFiles=formation_files,
|
self._execute_command(importFormationNames=Cmd.ImportFormationNamesRequest(formationFiles=formation_files,
|
||||||
applyToCaseId=self.id))
|
applyToCaseId=self.id))
|
||||||
|
|
||||||
@add_method(Case)
|
@add_method(Case)
|
||||||
def simulation_wells(self):
|
def simulation_wells(self):
|
||||||
|
|||||||
@@ -5,6 +5,45 @@ class PdmObject:
|
|||||||
if PdmObject.__custom_init__ is not None:
|
if PdmObject.__custom_init__ is not None:
|
||||||
PdmObject.__custom_init__(self, pb2_object=pb2_object, channel=channel)
|
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__
|
||||||
|
|
||||||
|
def __init__(self, pb2_object=None, channel=None):
|
||||||
|
self.values = []
|
||||||
|
PdmObject.__init__(self, pb2_object, channel)
|
||||||
|
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__
|
||||||
|
|
||||||
|
def __init__(self, pb2_object=None, channel=None):
|
||||||
|
self.values = []
|
||||||
|
PdmObject.__init__(self, pb2_object, channel)
|
||||||
|
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__
|
||||||
|
|
||||||
|
def __init__(self, pb2_object=None, channel=None):
|
||||||
|
self.values = []
|
||||||
|
PdmObject.__init__(self, pb2_object, channel)
|
||||||
|
if DataContainerTime.__custom_init__ is not None:
|
||||||
|
DataContainerTime.__custom_init__(self, pb2_object=pb2_object, channel=channel)
|
||||||
|
|
||||||
class Case(PdmObject):
|
class Case(PdmObject):
|
||||||
"""
|
"""
|
||||||
The ResInsight base class for Cases
|
The ResInsight base class for Cases
|
||||||
@@ -62,6 +101,7 @@ class SummaryCase(PdmObject):
|
|||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
auto_shorty_name (str): Use Auto Display Name
|
auto_shorty_name (str): Use Auto Display Name
|
||||||
|
id (int): Case ID
|
||||||
short_name (str): Display Name
|
short_name (str): Display Name
|
||||||
summary_header_filename (str): Summary Header File
|
summary_header_filename (str): Summary Header File
|
||||||
"""
|
"""
|
||||||
@@ -69,12 +109,58 @@ class SummaryCase(PdmObject):
|
|||||||
|
|
||||||
def __init__(self, pb2_object=None, channel=None):
|
def __init__(self, pb2_object=None, channel=None):
|
||||||
self.auto_shorty_name = False
|
self.auto_shorty_name = False
|
||||||
|
self.id = -1
|
||||||
self.short_name = "Display Name"
|
self.short_name = "Display Name"
|
||||||
self.summary_header_filename = ""
|
self.summary_header_filename = ""
|
||||||
PdmObject.__init__(self, pb2_object, channel)
|
PdmObject.__init__(self, pb2_object, channel)
|
||||||
if SummaryCase.__custom_init__ is not None:
|
if SummaryCase.__custom_init__ is not None:
|
||||||
SummaryCase.__custom_init__(self, pb2_object=pb2_object, channel=channel)
|
SummaryCase.__custom_init__(self, pb2_object=pb2_object, channel=channel)
|
||||||
|
|
||||||
|
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
|
||||||
|
Returns:
|
||||||
|
ResampleData
|
||||||
|
"""
|
||||||
|
return self._call_pdm_method("resampleValues", address=address, resampling_period=resampling_period)
|
||||||
|
|
||||||
|
|
||||||
|
def summary_vector_values(self, address=None):
|
||||||
|
"""
|
||||||
|
Create a new Summary Plot
|
||||||
|
Arguments:
|
||||||
|
address (str): Formatted address specifying the summary vector
|
||||||
|
Returns:
|
||||||
|
DataContainerFloat
|
||||||
|
"""
|
||||||
|
return self._call_pdm_method("summaryVectorValues", address=address)
|
||||||
|
|
||||||
|
|
||||||
class FileSummaryCase(SummaryCase):
|
class FileSummaryCase(SummaryCase):
|
||||||
"""
|
"""
|
||||||
A Summary Case based on SMSPEC files
|
A Summary Case based on SMSPEC files
|
||||||
@@ -212,6 +298,43 @@ class Project(PdmObject):
|
|||||||
if Project.__custom_init__ is not None:
|
if Project.__custom_init__ is not None:
|
||||||
Project.__custom_init__(self, pb2_object=pb2_object, channel=channel)
|
Project.__custom_init__(self, pb2_object=pb2_object, channel=channel)
|
||||||
|
|
||||||
|
def import_summary_case(self, file_name=None):
|
||||||
|
"""
|
||||||
|
Import Summary Case
|
||||||
|
Arguments:
|
||||||
|
file_name (str):
|
||||||
|
Returns:
|
||||||
|
FileSummaryCase
|
||||||
|
"""
|
||||||
|
return self._call_pdm_method("importSummaryCase", file_name=file_name)
|
||||||
|
|
||||||
|
|
||||||
|
def summary_case(self, case_id=None):
|
||||||
|
"""
|
||||||
|
Find Summary Case
|
||||||
|
Arguments:
|
||||||
|
case_id (int):
|
||||||
|
Returns:
|
||||||
|
FileSummaryCase
|
||||||
|
"""
|
||||||
|
return self._call_pdm_method("summaryCase", case_id=case_id)
|
||||||
|
|
||||||
|
|
||||||
|
class ResampleData(PdmObject):
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
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__
|
||||||
|
|
||||||
|
def __init__(self, pb2_object=None, channel=None):
|
||||||
|
self.time_steps = []
|
||||||
|
self.values = []
|
||||||
|
PdmObject.__init__(self, pb2_object, channel)
|
||||||
|
if ResampleData.__custom_init__ is not None:
|
||||||
|
ResampleData.__custom_init__(self, pb2_object=pb2_object, channel=channel)
|
||||||
|
|
||||||
class EclipseView(View):
|
class EclipseView(View):
|
||||||
"""
|
"""
|
||||||
The Eclipse 3d Reservoir View
|
The Eclipse 3d Reservoir View
|
||||||
@@ -259,9 +382,9 @@ class EclipseResult(PdmObject):
|
|||||||
porosity_model_type (str): Porosity
|
porosity_model_type (str): Porosity
|
||||||
result_type (str): Type
|
result_type (str): Type
|
||||||
result_variable (str): Variable
|
result_variable (str): Variable
|
||||||
selected_injector_tracers (str): Injector Tracers
|
selected_injector_tracers (List of str): Injector Tracers
|
||||||
selected_producer_tracers (str): Producer Tracers
|
selected_producer_tracers (List of str): Producer Tracers
|
||||||
selected_souring_tracers (str): 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__
|
||||||
|
|
||||||
@@ -331,6 +454,25 @@ class GridCaseGroup(PdmObject):
|
|||||||
if GridCaseGroup.__custom_init__ is not None:
|
if GridCaseGroup.__custom_init__ is not None:
|
||||||
GridCaseGroup.__custom_init__(self, pb2_object=pb2_object, channel=channel)
|
GridCaseGroup.__custom_init__(self, pb2_object=pb2_object, channel=channel)
|
||||||
|
|
||||||
|
class SummaryCaseSubCollection(PdmObject):
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
id (int): Ensemble ID
|
||||||
|
is_ensemble (str): Is Ensemble
|
||||||
|
name_count (str): Name
|
||||||
|
summary_collection_name (str): Name
|
||||||
|
"""
|
||||||
|
__custom_init__ = None #: Assign a custom init routine to be run at __init__
|
||||||
|
|
||||||
|
def __init__(self, pb2_object=None, channel=None):
|
||||||
|
self.id = -1
|
||||||
|
self.is_ensemble = False
|
||||||
|
self.name_count = "Group"
|
||||||
|
self.summary_collection_name = "Group"
|
||||||
|
PdmObject.__init__(self, pb2_object, channel)
|
||||||
|
if SummaryCaseSubCollection.__custom_init__ is not None:
|
||||||
|
SummaryCaseSubCollection.__custom_init__(self, pb2_object=pb2_object, channel=channel)
|
||||||
|
|
||||||
class PlotWindow(ViewWindow):
|
class PlotWindow(ViewWindow):
|
||||||
"""
|
"""
|
||||||
The Abstract base class for all MDI Windows in the Plot Window
|
The Abstract base class for all MDI Windows in the Plot Window
|
||||||
@@ -438,7 +580,7 @@ class WbsParameters(PdmObject):
|
|||||||
self.user_k0_fg = 0.75
|
self.user_k0_fg = 0.75
|
||||||
self.user_k0_sh = 0.65
|
self.user_k0_sh = 0.65
|
||||||
self.user_poisson_ratio = 0.35
|
self.user_poisson_ratio = 0.35
|
||||||
self.user_pp_non_reservoir = 1.05
|
self.user_pp_non_reservoir = 1
|
||||||
self.user_ucs = 100
|
self.user_ucs = 100
|
||||||
self.water_density = 1.03
|
self.water_density = 1.03
|
||||||
PdmObject.__init__(self, pb2_object, channel)
|
PdmObject.__init__(self, pb2_object, channel)
|
||||||
@@ -524,6 +666,9 @@ def class_dict():
|
|||||||
classes = {}
|
classes = {}
|
||||||
classes['Case'] = Case
|
classes['Case'] = Case
|
||||||
classes['CellColors'] = CellColors
|
classes['CellColors'] = CellColors
|
||||||
|
classes['DataContainerFloat'] = DataContainerFloat
|
||||||
|
classes['DataContainerString'] = DataContainerString
|
||||||
|
classes['DataContainerTime'] = DataContainerTime
|
||||||
classes['EclipseCase'] = EclipseCase
|
classes['EclipseCase'] = EclipseCase
|
||||||
classes['EclipseContourMap'] = EclipseContourMap
|
classes['EclipseContourMap'] = EclipseContourMap
|
||||||
classes['EclipseResult'] = EclipseResult
|
classes['EclipseResult'] = EclipseResult
|
||||||
@@ -540,9 +685,11 @@ def class_dict():
|
|||||||
classes['Plot'] = Plot
|
classes['Plot'] = Plot
|
||||||
classes['PlotWindow'] = PlotWindow
|
classes['PlotWindow'] = PlotWindow
|
||||||
classes['Project'] = Project
|
classes['Project'] = Project
|
||||||
|
classes['ResampleData'] = ResampleData
|
||||||
classes['Reservoir'] = Reservoir
|
classes['Reservoir'] = Reservoir
|
||||||
classes['SimulationWell'] = SimulationWell
|
classes['SimulationWell'] = SimulationWell
|
||||||
classes['SummaryCase'] = SummaryCase
|
classes['SummaryCase'] = SummaryCase
|
||||||
|
classes['SummaryCaseSubCollection'] = SummaryCaseSubCollection
|
||||||
classes['SummaryPlot'] = SummaryPlot
|
classes['SummaryPlot'] = SummaryPlot
|
||||||
classes['SummaryPlotCollection'] = SummaryPlotCollection
|
classes['SummaryPlotCollection'] = SummaryPlotCollection
|
||||||
classes['View'] = View
|
classes['View'] = View
|
||||||
|
|||||||
@@ -362,7 +362,15 @@ def _call_pdm_method(self, method_name, **kwargs):
|
|||||||
for key, value in kwargs.items():
|
for key, value in kwargs.items():
|
||||||
pb2_params.parameters[snake_to_camel(key)] = self.__convert_to_grpc_value(value)
|
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)
|
||||||
return self._pdm_object_stub.CallPdmObjectMethod(request)
|
|
||||||
|
pb2_object = self._pdm_object_stub.CallPdmObjectMethod(request)
|
||||||
|
|
||||||
|
child_class_definition = class_from_keyword(pb2_object.class_keyword)
|
||||||
|
if child_class_definition is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
pdm_object = child_class_definition(pb2_object=pb2_object, channel=self.channel())
|
||||||
|
return pdm_object
|
||||||
|
|
||||||
@add_method(PdmObject)
|
@add_method(PdmObject)
|
||||||
def update(self):
|
def update(self):
|
||||||
|
|||||||
@@ -341,5 +341,6 @@ def import_formation_names(self, formation_files=None):
|
|||||||
elif isinstance(formation_files, str):
|
elif isinstance(formation_files, str):
|
||||||
formation_files = [formation_files]
|
formation_files = [formation_files]
|
||||||
|
|
||||||
res = self._execute_command(importFormationNames=Cmd.ImportFormationNamesRequest(formationFiles=formation_files,
|
self._execute_command(importFormationNames=Cmd.ImportFormationNamesRequest(formationFiles=formation_files,
|
||||||
applyToCaseId=-1))
|
applyToCaseId=-1))
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ script writer does not have to look here, but the documentation is included for
|
|||||||
|
|
||||||
.. automodule:: rips.generated.pdm_objects
|
.. automodule:: rips.generated.pdm_objects
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
:inherited-members:
|
|
||||||
|
|
||||||
.. autoattribute:: rips.generated.pdm_objects
|
.. autoattribute:: rips.generated.pdm_objects
|
||||||
Reference in New Issue
Block a user