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

View File

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