mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
* #4603 Python: add case Id to exportSnapshots * Fixup after review
This commit is contained in:
@@ -118,16 +118,18 @@ class Commands:
|
||||
"""
|
||||
return self.__execute(exportMultiCaseSnapshot=Cmd.ExportMultiCaseRequest(gridListFile=gridListFile))
|
||||
|
||||
def exportSnapshots(self, type = 'ALL', prefix=''):
|
||||
def exportSnapshots(self, type = 'ALL', prefix='', caseId = -1):
|
||||
""" Export snapshots of a given type
|
||||
|
||||
Arguments:
|
||||
type (str): Enum string ('ALL', 'VIEWS' or 'PLOTS')
|
||||
prefix (str): Exported file name prefix
|
||||
caseId (int): the case Id to export for. The default of -1 will export all cases
|
||||
|
||||
"""
|
||||
return self.__execute(exportSnapshots=Cmd.ExportSnapshotsRequest(type=type,
|
||||
prefix=prefix))
|
||||
prefix=prefix,
|
||||
caseId=caseId))
|
||||
|
||||
def exportProperty(self, caseId, timeStep, property, eclipseKeyword=property, undefinedValue=0.0, exportFile=property):
|
||||
""" Export an Eclipse property
|
||||
|
||||
@@ -35,9 +35,9 @@ for case in cases:
|
||||
print(case.name, case.id, 'Number of timesteps: ' + str(len(timeSteps)))
|
||||
print('Number of timesteps for snapshoting: ' + str(len(tss_snapshot)))
|
||||
|
||||
view = case.view(id = 0)
|
||||
view = case.views()[0]
|
||||
for property in property_list:
|
||||
view.applyCellResult(resultType='DYNAMIC_NATIVE', resultVariable=property)
|
||||
for ts_snapshot in tss_snapshot:
|
||||
resInsight.commands.setTimeStep(caseId = case.id, timeStep = ts_snapshot)
|
||||
resInsight.commands.exportSnapshots('VIEWS') # ‘ALL’, ‘VIEWS’ or ‘PLOTS’ default is 'ALL'
|
||||
resInsight.commands.exportSnapshots(type='VIEWS', caseId=case.id) # ‘ALL’, ‘VIEWS’ or ‘PLOTS’ default is 'ALL'
|
||||
|
||||
Reference in New Issue
Block a user