Python: Rename example directory to PythonExamples

* This is so that when we add the folder to the Script Path it will look more sensible to the user.
This commit is contained in:
Gaute Lindkvist
2019-08-15 08:07:43 +02:00
parent 4d8ce1e399
commit 824ec5cef6
20 changed files with 33 additions and 23 deletions

View File

@@ -0,0 +1,24 @@
import os
import tempfile
import rips
# Load instance
resInsight = rips.Instance.find()
# Run a couple of commands
resInsight.commands.setTimeStep(caseId=0, timeStep=3)
resInsight.commands.setMainWindowSize(width=800, height=500)
#resInsight.commands.exportWellPaths()
with tempfile.TemporaryDirectory(prefix="rips") as tmpdirname:
print("Temporary folder: ", tmpdirname)
resInsight.commands.setExportFolder(type='SNAPSHOTS', path=tmpdirname)
resInsight.commands.setExportFolder(type='PROPERTIES', path=tmpdirname)
resInsight.commands.exportSnapshots()
print(os.listdir(tmpdirname))
assert(len(os.listdir(tmpdirname)) > 0)
case = resInsight.project.case(id=0)
resInsight.commands.exportPropertyInViews(0, "3D View", 0)
expectedFileName = case.name + "-" + str("3D_View") + "-" + "T3" + "-SOIL"
fullPath = tmpdirname + "/" + expectedFileName
assert(os.path.exists(fullPath))