mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7200 Add important Python examples
This commit is contained in:
parent
78c4a1568e
commit
e1a6c4ef65
20
GrpcInterface/Python/rips/PythonExamples/load_case.py
Normal file
20
GrpcInterface/Python/rips/PythonExamples/load_case.py
Normal file
@ -0,0 +1,20 @@
|
||||
# Load ResInsight Processing Server Client Library
|
||||
import rips
|
||||
# Connect to ResInsight instance
|
||||
resinsight = rips.Instance.find()
|
||||
|
||||
# Load an example case. Needs to be replaced with a valid path!
|
||||
case = resinsight.project.load_case(
|
||||
"C:/Users/lindk/Projects/ResInsight/TestModels/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID")
|
||||
|
||||
# Print out lots of information from the case object
|
||||
print("Case id: " + str(case.id))
|
||||
print("Case name: " + case.name)
|
||||
print("Case type: " + case.__class__.__name__)
|
||||
print("Case file name: " + case.file_path)
|
||||
print("Case reservoir bounding box:", case.reservoir_boundingbox())
|
||||
|
||||
timesteps = case.time_steps()
|
||||
for t in timesteps:
|
||||
print("Year: " + str(t.year))
|
||||
print("Month: " + str(t.month))
|
8
GrpcInterface/Python/rips/PythonExamples/open_project.py
Normal file
8
GrpcInterface/Python/rips/PythonExamples/open_project.py
Normal file
@ -0,0 +1,8 @@
|
||||
# Load ResInsight Processing Server Client Library
|
||||
import rips
|
||||
# Connect to ResInsight instance
|
||||
resinsight = rips.Instance.find()
|
||||
|
||||
# Open a project
|
||||
resinsight.project.open(
|
||||
"C:/Users/lindk/Projects/ResInsight/TestModels/TEST10K_FLT_LGR_NNC/10KWithWellLog.rsp")
|
Loading…
Reference in New Issue
Block a user