mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4736 Commands.py renames
This commit is contained in:
@@ -8,11 +8,11 @@ import tempfile
|
||||
import rips
|
||||
|
||||
# Load instance
|
||||
resInsight = rips.Instance.find()
|
||||
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.set_time_step(case_id=0, time_step=3)
|
||||
resinsight.commands.set_main_window_size(width=800, height=500)
|
||||
|
||||
# Create a temporary directory which will disappear at the end of this script
|
||||
# If you want to keep the files, provide a good path name instead of tmpdirname
|
||||
@@ -20,20 +20,20 @@ with tempfile.TemporaryDirectory(prefix="rips") as tmpdirname:
|
||||
print("Temporary folder: ", tmpdirname)
|
||||
|
||||
# Set export folder for snapshots and properties
|
||||
resInsight.commands.setExportFolder(type='SNAPSHOTS', path=tmpdirname)
|
||||
resInsight.commands.setExportFolder(type='PROPERTIES', path=tmpdirname)
|
||||
resinsight.commands.set_export_folder(type='SNAPSHOTS', path=tmpdirname)
|
||||
resinsight.commands.set_export_folder(type='PROPERTIES', path=tmpdirname)
|
||||
|
||||
# Export snapshots
|
||||
resInsight.commands.exportSnapshots()
|
||||
resinsight.commands.export_snapshots()
|
||||
|
||||
# Print contents of temporary folder
|
||||
print(os.listdir(tmpdirname))
|
||||
|
||||
assert(len(os.listdir(tmpdirname)) > 0)
|
||||
case = resInsight.project.case(id=0)
|
||||
case = resinsight.project.case(id=0)
|
||||
|
||||
# Export properties in the view
|
||||
resInsight.commands.exportPropertyInViews(0, "3D View", 0)
|
||||
resinsight.commands.export_property_in_views(0, "3D View", 0)
|
||||
|
||||
# Check that the exported file exists
|
||||
expectedFileName = case.name + "-" + str("3D_View") + "-" + "T3" + "-SOIL"
|
||||
|
||||
Reference in New Issue
Block a user