#4736 GridCaseGroup.py renames

This commit is contained in:
Gaute Lindkvist 2019-09-19 13:27:26 +02:00
parent 0657bd1f11
commit 8ff0c05760
2 changed files with 15 additions and 15 deletions

View File

@ -17,22 +17,22 @@ class GridCaseGroup (PdmObject):
id (int): Grid Case Group Id corresponding to case group Id in ResInsight project.
name (str): Case name
"""
def __init__(self, pdmObject):
self.groupId = pdmObject.getValue("GroupId")
PdmObject.__init__(self, pdmObject.pb2Object, pdmObject.channel)
def __init__(self, pdm_object):
self.groupId = pdm_object.getValue("GroupId")
PdmObject.__init__(self, pdm_object.pb2Object, pdm_object.channel)
def statisticsCases(self):
def statistics_cases(self):
"""Get a list of all statistics cases in the Grid Case Group"""
statCaseCollection = self.children("StatisticsCaseCollection")[0]
return statCaseCollection.children("Reservoirs")
stat_case_collection = self.children("StatisticsCaseCollection")[0]
return stat_case_collection.children("Reservoirs")
def views(self):
"""Get a list of views belonging to a grid case group"""
pbmObjects = self.descendants("ReservoirView")
viewList = []
for pbmObject in pbmObjects:
viewList.append(View(pbmObject))
return viewList
pbm_objects = self.descendants("ReservoirView")
view_list = []
for pbm_object in pbm_objects:
view_list.append(View(pbm_object))
return view_list
def view(self, id):
"""Get a particular view belonging to a case group by providing view id
@ -43,7 +43,7 @@ class GridCaseGroup (PdmObject):
"""
views = self.views()
for viewObject in views:
if viewObject.id == id:
return viewObject
for view_object in views:
if view_object.id == id:
return view_object
return None

View File

@ -13,7 +13,7 @@ caseGroup = resinsight.project.create_grid_case_group(casePaths=casePaths)
caseGroup.printObjectInfo()
#statCases = caseGroup.statisticsCases()
#statCases = caseGroup.statistics_cases()
#caseIds = []
#for statCase in statCases:
# statCase.setValue("DynamicPropertiesToCalculate", ["SWAT"])