Python doc : Add more doc and example for timestep class

This commit is contained in:
Magne Sjaastad 2019-09-02 11:44:17 +02:00
parent 236b0cb3d4
commit ca644ba477
2 changed files with 22 additions and 4 deletions

View File

@ -128,7 +128,21 @@ class Case (PdmObject):
return receivedActiveCells
def timeSteps(self):
"""Get a list containing time step strings for all time steps"""
"""Get a list containing all time steps
The time steps are defined by the class **TimeStepDate** :
Type | Name
--------- | ----------
int | year
int | month
int | day
int | hour
int | minute
int | second
"""
return self.stub.GetTimeSteps(self.request).dates
def daysSinceStart(self):

View File

@ -1,6 +1,6 @@
###################################################################################
# This example will connect to ResInsight, retrieve a list of cases and print info
# Also creates a new view for all cases
#
###################################################################################
# Import the ResInsight Processing Server Module
@ -16,7 +16,11 @@ if resInsight is not None:
for case in cases:
print("Case name: " + case.name)
print("Case grid path: " + case.gridPath())
# Create a new view
view = case.createView()
timesteps = case.timeSteps()
for t in timesteps:
print("Year: " + str(t.year))
print("Month: " + str(t.month))