Some cleanup

This commit is contained in:
Jon Jenssen authored and JJ committed 2026-06-17 13:55:32 +02:00
1 parent 44488996f3
commit 18cf162ce0
14 files changed
+26 -51

No files matched your search

@@ -9,9 +9,6 @@ import rips
resinsight = rips.Instance.find()
cases = resinsight.project.cases()
# Set main window size
# resinsight.set_main_window_size(width=1280, height=900)
n = 5 # every n-th time_step for snapshot
property_list = ["SOIL", "PRESSURE"] # list of parameter for snapshot
@@ -1,5 +1,5 @@
###############################################################################
# This example will show setting time step, window size and export snapshots and properties
# This example will show setting time step and export snapshots and properties
###############################################################################
import os
import tempfile
@@ -8,11 +8,6 @@ import rips
# Load instance
resinsight = rips.Instance.find()
# Set window sizes
resinsight.set_main_window_size(width=800, height=500)
resinsight.set_plot_window_size(width=1000, height=1000)
# Retrieve first case
case = resinsight.project.cases()[0]
@@ -30,7 +25,6 @@ view1.apply_cell_result(
result_type=rips.PropertyType.DYNAMIC_NATIVE, result_variable="SOIL"
)
# 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
with tempfile.TemporaryDirectory(prefix="rips") as tmpdirname:
@@ -41,7 +35,7 @@ with tempfile.TemporaryDirectory(prefix="rips") as tmpdirname:
resinsight.set_export_folder(export_type="PROPERTIES", path=tmpdirname)
# Export all snapshots
resinsight.project.export_snapshots()
resinsight.project.export_snapshots(width=1024, height=768)
assert len(os.listdir(tmpdirname)) > 0
+3 -1
View File
@@ -283,7 +283,7 @@ def export_multi_case_snapshots(self, grid_list_file):
@add_method(Project)
def export_snapshots(self, snapshot_type="ALL", prefix="", plot_format="PNG"):
def export_snapshots(self, snapshot_type="ALL", prefix="", plot_format="PNG", width=-1, height=-1):
"""Export all snapshots of a given type
Arguments:
@@ -298,6 +298,8 @@ def export_snapshots(self, snapshot_type="ALL", prefix="", plot_format="PNG"):
caseId=-1,
viewId=-1,
plotOutputFormat=plot_format,
width=width,
height=height
)
)