#8118 Python: rename new_stim_plan* and new_fracture* method names (#8175)

This commit is contained in:
Kristian Bendiksen 2021-10-24 09:13:42 +02:00 committed by GitHub
parent 9777112527
commit 8e0b69b3e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 66 additions and 63 deletions

View File

@ -31,13 +31,14 @@
#include "cafPdmFieldScriptingCapability.h"
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimFractureTemplateCollection,
RimcFractureTemplateCollection_newFractureTemplate,
"NewFractureTemplate" );
RimcFractureTemplateCollection_appendFractureTemplate,
"AppendFractureTemplate" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimcFractureTemplateCollection_newFractureTemplate::RimcFractureTemplateCollection_newFractureTemplate( caf::PdmObjectHandle* self )
RimcFractureTemplateCollection_appendFractureTemplate::RimcFractureTemplateCollection_appendFractureTemplate(
caf::PdmObjectHandle* self )
: caf::PdmObjectMethod( self )
{
CAF_PDM_InitObject( "Create Fracture Template", "", "", "Create a new StimPlan Fracture Template" );
@ -47,7 +48,7 @@ RimcFractureTemplateCollection_newFractureTemplate::RimcFractureTemplateCollecti
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmObjectHandle* RimcFractureTemplateCollection_newFractureTemplate::execute()
caf::PdmObjectHandle* RimcFractureTemplateCollection_appendFractureTemplate::execute()
{
RimFractureTemplateCollection* stimPlanModelTemplateCollection = self<RimFractureTemplateCollection>();
@ -65,7 +66,7 @@ caf::PdmObjectHandle* RimcFractureTemplateCollection_newFractureTemplate::execut
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimcFractureTemplateCollection_newFractureTemplate::resultIsPersistent() const
bool RimcFractureTemplateCollection_appendFractureTemplate::resultIsPersistent() const
{
return true;
}
@ -73,7 +74,7 @@ bool RimcFractureTemplateCollection_newFractureTemplate::resultIsPersistent() co
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::unique_ptr<caf::PdmObjectHandle> RimcFractureTemplateCollection_newFractureTemplate::defaultResult() const
std::unique_ptr<caf::PdmObjectHandle> RimcFractureTemplateCollection_appendFractureTemplate::defaultResult() const
{
return std::unique_ptr<caf::PdmObjectHandle>( new RimStimPlanFractureTemplate );
}

View File

@ -29,12 +29,12 @@
//==================================================================================================
///
//==================================================================================================
class RimcFractureTemplateCollection_newFractureTemplate : public caf::PdmObjectMethod
class RimcFractureTemplateCollection_appendFractureTemplate : public caf::PdmObjectMethod
{
CAF_PDM_HEADER_INIT;
public:
RimcFractureTemplateCollection_newFractureTemplate( caf::PdmObjectHandle* self );
RimcFractureTemplateCollection_appendFractureTemplate( caf::PdmObjectHandle* self );
caf::PdmObjectHandle* execute() override;
bool resultIsPersistent() const override;

View File

@ -32,13 +32,13 @@
#include "cafPdmFieldScriptingCapability.h"
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimStimPlanModelCollection,
RimcStimPlanModelCollection_newStimPlanModel,
"NewStimPlanModel" );
RimcStimPlanModelCollection_appendStimPlanModel,
"AppendStimPlanModel" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimcStimPlanModelCollection_newStimPlanModel::RimcStimPlanModelCollection_newStimPlanModel( caf::PdmObjectHandle* self )
RimcStimPlanModelCollection_appendStimPlanModel::RimcStimPlanModelCollection_appendStimPlanModel( caf::PdmObjectHandle* self )
: caf::PdmObjectMethod( self )
{
CAF_PDM_InitObject( "Create StimPlan Model", "", "", "Create a new StimPlan Model" );
@ -50,32 +50,32 @@ RimcStimPlanModelCollection_newStimPlanModel::RimcStimPlanModelCollection_newSti
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmObjectHandle* RimcStimPlanModelCollection_newStimPlanModel::execute()
caf::PdmObjectHandle* RimcStimPlanModelCollection_appendStimPlanModel::execute()
{
RimStimPlanModel* newStimPlanModel = nullptr;
RimStimPlanModel* stimPlanModel = nullptr;
RimStimPlanModelCollection* stimPlanModelCollection = self<RimStimPlanModelCollection>();
if ( m_wellPath )
{
RimWellPathCollection* wellPathCollection = nullptr;
stimPlanModelCollection->firstAncestorOrThisOfTypeAsserted( wellPathCollection );
newStimPlanModel = RicNewStimPlanModelFeature::addStimPlanModel( m_wellPath, wellPathCollection );
stimPlanModel = RicNewStimPlanModelFeature::addStimPlanModel( m_wellPath, wellPathCollection );
}
if ( newStimPlanModel )
if ( stimPlanModel )
{
newStimPlanModel->setMD( m_md() );
newStimPlanModel->setStimPlanModelTemplate( m_stimPlanModelTemplate() );
stimPlanModel->setMD( m_md() );
stimPlanModel->setStimPlanModelTemplate( m_stimPlanModelTemplate() );
stimPlanModelCollection->updateAllRequiredEditors();
}
return newStimPlanModel;
return stimPlanModel;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimcStimPlanModelCollection_newStimPlanModel::resultIsPersistent() const
bool RimcStimPlanModelCollection_appendStimPlanModel::resultIsPersistent() const
{
return true;
}
@ -83,7 +83,7 @@ bool RimcStimPlanModelCollection_newStimPlanModel::resultIsPersistent() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::unique_ptr<caf::PdmObjectHandle> RimcStimPlanModelCollection_newStimPlanModel::defaultResult() const
std::unique_ptr<caf::PdmObjectHandle> RimcStimPlanModelCollection_appendStimPlanModel::defaultResult() const
{
return std::unique_ptr<caf::PdmObjectHandle>( new RimStimPlanModel );
}

View File

@ -36,12 +36,12 @@ class RimEclipseCase;
//==================================================================================================
///
//==================================================================================================
class RimcStimPlanModelCollection_newStimPlanModel : public caf::PdmObjectMethod
class RimcStimPlanModelCollection_appendStimPlanModel : public caf::PdmObjectMethod
{
CAF_PDM_HEADER_INIT;
public:
RimcStimPlanModelCollection_newStimPlanModel( caf::PdmObjectHandle* self );
RimcStimPlanModelCollection_appendStimPlanModel( caf::PdmObjectHandle* self );
caf::PdmObjectHandle* execute() override;
bool resultIsPersistent() const override;

View File

@ -28,13 +28,13 @@
#include "cafPdmFieldScriptingCapability.h"
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimStimPlanModelPlotCollection,
RimcStimPlanModelPlotCollection_newStimPlanModelPlot,
"NewStimPlanModelPlot" );
RimcStimPlanModelPlotCollection_appendStimPlanModelPlot,
"AppendStimPlanModelPlot" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimcStimPlanModelPlotCollection_newStimPlanModelPlot::RimcStimPlanModelPlotCollection_newStimPlanModelPlot(
RimcStimPlanModelPlotCollection_appendStimPlanModelPlot::RimcStimPlanModelPlotCollection_appendStimPlanModelPlot(
caf::PdmObjectHandle* self )
: caf::PdmObjectMethod( self )
{
@ -45,23 +45,23 @@ RimcStimPlanModelPlotCollection_newStimPlanModelPlot::RimcStimPlanModelPlotColle
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmObjectHandle* RimcStimPlanModelPlotCollection_newStimPlanModelPlot::execute()
caf::PdmObjectHandle* RimcStimPlanModelPlotCollection_appendStimPlanModelPlot::execute()
{
RimStimPlanModelPlot* newStimPlanModelPlot = nullptr;
RimStimPlanModelPlot* stimPlanModelPlot = nullptr;
RimStimPlanModelPlotCollection* stimPlanModelPlotCollection = self<RimStimPlanModelPlotCollection>();
if ( m_stimPlanModel && stimPlanModelPlotCollection )
{
newStimPlanModelPlot = RicNewStimPlanModelPlotFeature::createPlot( m_stimPlanModel );
stimPlanModelPlot = RicNewStimPlanModelPlotFeature::createPlot( m_stimPlanModel );
}
return newStimPlanModelPlot;
return stimPlanModelPlot;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimcStimPlanModelPlotCollection_newStimPlanModelPlot::resultIsPersistent() const
bool RimcStimPlanModelPlotCollection_appendStimPlanModelPlot::resultIsPersistent() const
{
return true;
}
@ -69,7 +69,7 @@ bool RimcStimPlanModelPlotCollection_newStimPlanModelPlot::resultIsPersistent()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::unique_ptr<caf::PdmObjectHandle> RimcStimPlanModelPlotCollection_newStimPlanModelPlot::defaultResult() const
std::unique_ptr<caf::PdmObjectHandle> RimcStimPlanModelPlotCollection_appendStimPlanModelPlot::defaultResult() const
{
return std::unique_ptr<caf::PdmObjectHandle>( new RimStimPlanModelPlot );
}

View File

@ -31,12 +31,12 @@ class RimStimPlanModel;
//==================================================================================================
///
//==================================================================================================
class RimcStimPlanModelPlotCollection_newStimPlanModelPlot : public caf::PdmObjectMethod
class RimcStimPlanModelPlotCollection_appendStimPlanModelPlot : public caf::PdmObjectMethod
{
CAF_PDM_HEADER_INIT;
public:
RimcStimPlanModelPlotCollection_newStimPlanModelPlot( caf::PdmObjectHandle* self );
RimcStimPlanModelPlotCollection_appendStimPlanModelPlot( caf::PdmObjectHandle* self );
caf::PdmObjectHandle* execute() override;
bool resultIsPersistent() const override;

View File

@ -31,13 +31,13 @@
#include "cafPdmFieldScriptingCapability.h"
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimStimPlanModelTemplateCollection,
RimcStimPlanModelTemplateCollection_newStimPlanModelTemplate,
"NewStimPlanModelTemplate" );
RimcStimPlanModelTemplateCollection_appendStimPlanModelTemplate,
"AppendStimPlanModelTemplate" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimcStimPlanModelTemplateCollection_newStimPlanModelTemplate::RimcStimPlanModelTemplateCollection_newStimPlanModelTemplate(
RimcStimPlanModelTemplateCollection_appendStimPlanModelTemplate::RimcStimPlanModelTemplateCollection_appendStimPlanModelTemplate(
caf::PdmObjectHandle* self )
: caf::PdmObjectMethod( self )
{
@ -62,34 +62,34 @@ RimcStimPlanModelTemplateCollection_newStimPlanModelTemplate::RimcStimPlanModelT
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmObjectHandle* RimcStimPlanModelTemplateCollection_newStimPlanModelTemplate::execute()
caf::PdmObjectHandle* RimcStimPlanModelTemplateCollection_appendStimPlanModelTemplate::execute()
{
if ( !m_eclipseCase ) return nullptr;
RimStimPlanModelTemplate* newStimPlanModelTemplate = new RimStimPlanModelTemplate;
RimStimPlanModelTemplate* appendStimPlanModelTemplate = new RimStimPlanModelTemplate;
RimStimPlanModelTemplateCollection* stimPlanModelTemplateCollection = self<RimStimPlanModelTemplateCollection>();
newStimPlanModelTemplate->setName( RicFractureNameGenerator::nameForNewStimPlanModelTemplate() );
newStimPlanModelTemplate->setDynamicEclipseCase( m_eclipseCase );
newStimPlanModelTemplate->setTimeStep( m_timeStep );
newStimPlanModelTemplate->setInitialPressureEclipseCase( m_eclipseCase );
newStimPlanModelTemplate->setStaticEclipseCase( m_eclipseCase );
appendStimPlanModelTemplate->setName( RicFractureNameGenerator::nameForNewStimPlanModelTemplate() );
appendStimPlanModelTemplate->setDynamicEclipseCase( m_eclipseCase );
appendStimPlanModelTemplate->setTimeStep( m_timeStep );
appendStimPlanModelTemplate->setInitialPressureEclipseCase( m_eclipseCase );
appendStimPlanModelTemplate->setStaticEclipseCase( m_eclipseCase );
stimPlanModelTemplateCollection->addStimPlanModelTemplate( newStimPlanModelTemplate );
stimPlanModelTemplateCollection->addStimPlanModelTemplate( appendStimPlanModelTemplate );
RicElasticPropertiesImportTools::importElasticPropertiesFromFile( m_elasticPropertiesFilePath,
newStimPlanModelTemplate );
appendStimPlanModelTemplate );
RicFaciesPropertiesImportTools::importFaciesPropertiesFromFile( m_faciesPropertiesFilePath,
newStimPlanModelTemplate,
appendStimPlanModelTemplate,
true );
stimPlanModelTemplateCollection->updateAllRequiredEditors();
return newStimPlanModelTemplate;
return appendStimPlanModelTemplate;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimcStimPlanModelTemplateCollection_newStimPlanModelTemplate::resultIsPersistent() const
bool RimcStimPlanModelTemplateCollection_appendStimPlanModelTemplate::resultIsPersistent() const
{
return true;
}
@ -97,7 +97,7 @@ bool RimcStimPlanModelTemplateCollection_newStimPlanModelTemplate::resultIsPersi
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::unique_ptr<caf::PdmObjectHandle> RimcStimPlanModelTemplateCollection_newStimPlanModelTemplate::defaultResult() const
std::unique_ptr<caf::PdmObjectHandle> RimcStimPlanModelTemplateCollection_appendStimPlanModelTemplate::defaultResult() const
{
return std::unique_ptr<caf::PdmObjectHandle>( new RimStimPlanModelTemplate );
}

View File

@ -34,12 +34,12 @@ class RimEclipseCase;
//==================================================================================================
///
//==================================================================================================
class RimcStimPlanModelTemplateCollection_newStimPlanModelTemplate : public caf::PdmObjectMethod
class RimcStimPlanModelTemplateCollection_appendStimPlanModelTemplate : public caf::PdmObjectMethod
{
CAF_PDM_HEADER_INIT;
public:
RimcStimPlanModelTemplateCollection_newStimPlanModelTemplate( caf::PdmObjectHandle* self );
RimcStimPlanModelTemplateCollection_appendStimPlanModelTemplate( caf::PdmObjectHandle* self );
caf::PdmObjectHandle* execute() override;
bool resultIsPersistent() const override;

View File

@ -27,12 +27,12 @@
#include "cafPdmAbstractFieldScriptingCapability.h"
#include "cafPdmFieldScriptingCapability.h"
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimWellPath, RimcWellPath_newFracture, "NewFracture" );
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimWellPath, RimcWellPath_addFracture, "AddFracture" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimcWellPath_newFracture::RimcWellPath_newFracture( caf::PdmObjectHandle* self )
RimcWellPath_addFracture::RimcWellPath_addFracture( caf::PdmObjectHandle* self )
: caf::PdmObjectMethod( self )
{
CAF_PDM_InitObject( "Add StimPlan Fracture", "", "", "Add StimPlan Fracture" );
@ -49,7 +49,7 @@ RimcWellPath_newFracture::RimcWellPath_newFracture( caf::PdmObjectHandle* self )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmObjectHandle* RimcWellPath_newFracture::execute()
caf::PdmObjectHandle* RimcWellPath_addFracture::execute()
{
auto wellPath = self<RimWellPath>();
@ -63,7 +63,7 @@ caf::PdmObjectHandle* RimcWellPath_newFracture::execute()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimcWellPath_newFracture::resultIsPersistent() const
bool RimcWellPath_addFracture::resultIsPersistent() const
{
return true;
}
@ -71,7 +71,7 @@ bool RimcWellPath_newFracture::resultIsPersistent() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::unique_ptr<caf::PdmObjectHandle> RimcWellPath_newFracture::defaultResult() const
std::unique_ptr<caf::PdmObjectHandle> RimcWellPath_addFracture::defaultResult() const
{
return std::unique_ptr<caf::PdmObjectHandle>( new RimWellPathFracture );
}

View File

@ -30,12 +30,12 @@ class RimStimPlanFractureTemplate;
//==================================================================================================
///
//==================================================================================================
class RimcWellPath_newFracture : public caf::PdmObjectMethod
class RimcWellPath_addFracture : public caf::PdmObjectMethod
{
CAF_PDM_HEADER_INIT;
public:
RimcWellPath_newFracture( caf::PdmObjectHandle* self );
RimcWellPath_addFracture( caf::PdmObjectHandle* self );
caf::PdmObjectHandle* execute() override;
bool resultIsPersistent() const override;

View File

@ -28,7 +28,7 @@ time_step = time_steps[len(time_steps) - 1]
# Create stim plan model template
fmt_collection = project.descendants(rips.StimPlanModelTemplateCollection)[0]
stim_plan_model_template = fmt_collection.new_stim_plan_model_template(
stim_plan_model_template = fmt_collection.append_stim_plan_model_template(
eclipse_case=case,
time_step=time_step,
elastic_properties_file_path=elastic_properties_file_path,
@ -84,7 +84,7 @@ measured_depths = [3200.0, 3400.0, 3600.0]
for measured_depth in measured_depths:
# Create stim plan model at a give measured depth
stim_plan_model = stim_plan_model_collection.new_stim_plan_model(
stim_plan_model = stim_plan_model_collection.append_stim_plan_model(
well_path=well_path,
measured_depth=measured_depth,
stim_plan_model_template=stim_plan_model_template,
@ -107,7 +107,7 @@ for measured_depth in measured_depths:
stim_plan_model_plot_collection = project.descendants(
rips.StimPlanModelPlotCollection
)[0]
stim_plan_model_plot = stim_plan_model_plot_collection.new_stim_plan_model_plot(
stim_plan_model_plot = stim_plan_model_plot_collection.append_stim_plan_model_plot(
stim_plan_model=stim_plan_model
)

View File

@ -19,7 +19,9 @@ case = cases[0]
# Create stim plan template
fmt_collection = project.descendants(rips.FractureDefinitionCollection)[0]
fracture_template = fmt_collection.new_fracture_template(file_path=stim_plan_file_path)
fracture_template = fmt_collection.append_fracture_template(
file_path=stim_plan_file_path
)
well_name = "B-2 H"
@ -33,7 +35,7 @@ for measured_depth in measured_depths:
print("Placing fracture at {} depth (MD)".format(measured_depth))
# Create stim plan at a give measured depth
fracture = well_path.new_fracture(
fracture = well_path.add_fracture(
measured_depth=measured_depth,
stim_plan_fracture_template=fracture_template,
)