#6320 Rename generated/pdm_objects.py to generated/resinsight_classes.py

* This is to avoid confusion with pdmobject.py
This commit is contained in:
Gaute Lindkvist
2020-08-21 09:57:48 +02:00
committed by Kristian Bendiksen
parent 454e7f17a0
commit 30fa232c25
11 changed files with 72 additions and 68 deletions

View File

@@ -17,7 +17,7 @@ from Definitions_pb2 import Empty
import Project_pb2_grpc
import Project_pb2
import PdmObject_pb2
from pdm_objects import Project, PlotWindow, WellPath
from resinsight_classes import Project, PlotWindow, WellPath
@add_method(Project)
@@ -68,7 +68,7 @@ def load_case(self, path):
Arguments:
path(str): file path to case
Returns:
:class:`rips.generated.pdm_objects.Case`
:class:`rips.generated.resinsight_classes.Case`
"""
command_reply = self._execute_command(loadCase=Commands_pb2.FilePathRequest(
path=path))
@@ -80,7 +80,7 @@ def selected_cases(self):
"""Get a list of all cases selected in the project tree
Returns:
A list of :class:`rips.generated.pdm_objects.Case`
A list of :class:`rips.generated.resinsight_classes.Case`
"""
case_infos = self._project_stub.GetSelectedCases(Empty())
cases = []
@@ -94,7 +94,7 @@ def cases(self):
"""Get a list of all cases in the project
Returns:
A list of :class:`rips.generated.pdm_objects.Case`
A list of :class:`rips.generated.resinsight_classes.Case`
"""
return self.descendants(Case)
@@ -106,7 +106,7 @@ def case(self, case_id):
Arguments:
id(int): case id
Returns:
:class:`rips.generated.pdm_objects.Case`
:class:`rips.generated.resinsight_classes.Case`
"""
allCases = self.cases()
for case in allCases:
@@ -135,7 +135,7 @@ def create_grid_case_group(self, case_paths):
Arguments:
case_paths (list): list of file path strings
Returns:
:class:`rips.generated.pdm_objects.GridCaseGroup`
:class:`rips.generated.resinsight_classes.GridCaseGroup`
"""
command_reply = self._execute_command(
createGridCaseGroup=Commands_pb2.CreateGridCaseGroupRequest(
@@ -157,7 +157,7 @@ def view(self, view_id):
Arguments:
view_id(int): view id
Returns:
:class:`rips.generated.pdm_objects.View`
:class:`rips.generated.resinsight_classes.View`
"""
views = self.views()
for view_object in views:
@@ -171,11 +171,11 @@ def plots(self):
"""Get a list of all plots belonging to a project
Returns:
List of :class:`rips.generated.pdm_objects.Plot`
List of :class:`rips.generated.resinsight_classes.Plot`
"""
pdm_objects = self.descendants(PlotWindow)
resinsight_classes = self.descendants(PlotWindow)
plot_list = []
for pdm_object in pdm_objects:
for pdm_object in resinsight_classes:
if pdm_object.id != -1:
plot_list.append(pdm_object)
return plot_list
@@ -189,7 +189,7 @@ def plot(self, view_id):
view_id(int): view id
Returns:
:class:`rips.generated.pdm_objects.Plot`
:class:`rips.generated.resinsight_classes.Plot`
"""
plots = self.plots()
for plot_object in plots:
@@ -203,7 +203,7 @@ def grid_case_groups(self):
"""Get a list of all grid case groups in the project
Returns:
List of :class:`rips.generated.pdm_objects.GridCaseGroup`
List of :class:`rips.generated.resinsight_classes.GridCaseGroup`
"""
case_groups = self.descendants(GridCaseGroup)
@@ -218,7 +218,7 @@ def grid_case_group(self, group_id):
groupId(int): group id
Returns:
:class:`rips.generated.pdm_objects.GridCaseGroup`
:class:`rips.generated.resinsight_classes.GridCaseGroup`
"""
case_groups = self.grid_case_groups()
for case_group in case_groups:
@@ -313,13 +313,13 @@ def import_well_paths(self, well_path_files=None, well_path_folder=''):
well_path_folder(str): A folder path containing files to import
Returns:
List of :class:`rips.generated.pdm_objects.WellPath`
List of :class:`rips.generated.resinsight_classes.WellPath`
"""
if well_path_files is None:
well_path_files = []
res = self._execute_command(importWellPaths=Commands_pb2.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))
@@ -331,7 +331,7 @@ def well_paths(self):
"""Get a list of all well paths in the project
Returns:
List of :class:`rips.generated.pdm_objects.WellPath`
List of :class:`rips.generated.resinsight_classes.WellPath`
"""
return self.descendants(WellPath)
@@ -341,7 +341,7 @@ def well_path_by_name(self, well_path_name):
"""Get a specific well path by name from the project
Returns:
:class:`rips.generated.pdm_objects.WellPath`
:class:`rips.generated.resinsight_classes.WellPath`
"""
all_well_paths = self.well_paths()
for well_path in all_well_paths:
@@ -365,7 +365,7 @@ 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=Commands_pb2.ImportWellLogFilesRequest(wellLogFolder=well_log_folder,
wellLogFiles=well_log_files))
wellLogFiles=well_log_files))
return res.importWellLogFilesResult.wellPathNames
@@ -383,5 +383,4 @@ def import_formation_names(self, formation_files=None):
formation_files = [formation_files]
self._execute_command(importFormationNames=Commands_pb2.ImportFormationNamesRequest(formationFiles=formation_files,
applyToCaseId=-1))
applyToCaseId=-1))