diff --git a/GrpcInterface/Python/rips/PythonExamples/basic_operations/replace_case.py b/GrpcInterface/Python/rips/PythonExamples/basic_operations/replace_case.py index 14d9855a9d..d682c6df78 100644 --- a/GrpcInterface/Python/rips/PythonExamples/basic_operations/replace_case.py +++ b/GrpcInterface/Python/rips/PythonExamples/basic_operations/replace_case.py @@ -7,6 +7,10 @@ resinsight = rips.Instance.find() print("ResInsight version: " + resinsight.version_string()) case = resinsight.project.case(case_id=0) -case.replace( +case.replace_grid( new_grid_file="C:/Users/lindkvis/Projects/ResInsight/TestModels/Case_with_10_timesteps/Real0/BRUGGE_0000.EGRID" ) + +# The project is reloaded, so retrieve the case object again +case = resinsight.project.case(case_id=0) +print("New case name: " + case.name) diff --git a/GrpcInterface/Python/rips/PythonExamples/case_and_grid_operations/case_grid_group.py b/GrpcInterface/Python/rips/PythonExamples/case_and_grid_operations/case_grid_group.py index fa6b97f2cb..3d4e9ad956 100644 --- a/GrpcInterface/Python/rips/PythonExamples/case_and_grid_operations/case_grid_group.py +++ b/GrpcInterface/Python/rips/PythonExamples/case_and_grid_operations/case_grid_group.py @@ -18,7 +18,8 @@ for case_path in case_paths: case_group = resinsight.project.create_grid_case_group(case_paths=case_paths) -case_group.compute_statistics() +for statistics_case in case_group.statistics_cases(): + statistics_case.compute_statistics(update_views=True) view = case_group.views()[0] view.apply_cell_result(rips.PropertyType.DYNAMIC_NATIVE, "PRESSURE_DEV") diff --git a/GrpcInterface/Python/rips/PythonExamples/export_and_plotting/create_wbs_plot.py b/GrpcInterface/Python/rips/PythonExamples/export_and_plotting/create_wbs_plot.py index d3ca60484a..c24b8f0b9a 100644 --- a/GrpcInterface/Python/rips/PythonExamples/export_and_plotting/create_wbs_plot.py +++ b/GrpcInterface/Python/rips/PythonExamples/export_and_plotting/create_wbs_plot.py @@ -31,12 +31,14 @@ for case in cases: case_path = case.file_path folder_name = os.path.dirname(case_path) - # Import formation names - case.import_formation_names( + # Import formation names and assign them to this case + formation_names = resInsight.project.import_formation_names( formation_files=[ "D:/Projects/ResInsight-regression-test/ModelData/norne/Norne_ATW2013.lyr" - ] + ], + apply_to_all_cases=False, ) + case.set_formation_names(formation_names=formation_names) # create a folder to hold the snapshots dirname = os.path.join(folder_name, "snapshots") @@ -45,5 +47,5 @@ for case in cases: for well_path in well_paths[0:4]: # Loop through the first five well paths # Create plot with parameters wbsplot = case.create_well_bore_stability_plot( - well_path=well_path.name, time_step=0, parameters=params + well_path=well_path, time_step=0, parameters=params ) diff --git a/GrpcInterface/Python/rips/PythonExamples/export_and_plotting/export_plots.py b/GrpcInterface/Python/rips/PythonExamples/export_and_plotting/export_plots.py index 577069ae01..fd3541343b 100644 --- a/GrpcInterface/Python/rips/PythonExamples/export_and_plotting/export_plots.py +++ b/GrpcInterface/Python/rips/PythonExamples/export_and_plotting/export_plots.py @@ -16,7 +16,9 @@ print("Exporting to: " + export_folder) for plot in plots: plot.export_snapshot(export_folder=export_folder, width=1024, height=768) - plot.export_snapshot(export_folder=export_folder, output_format="PDF") + plot.export_snapshot( + export_folder=export_folder, file_format=rips.SnapshotFileFormat.PDF + ) if isinstance(plot, rips.WellLogPlot): plot.export_data_as_las(export_folder=export_folder) plot.export_data_as_ascii(export_folder=export_folder) diff --git a/GrpcInterface/Python/rips/PythonExamples/export_and_plotting/headless_plot_export.py b/GrpcInterface/Python/rips/PythonExamples/export_and_plotting/headless_plot_export.py index 4b3f366e4c..f9e47ab598 100644 --- a/GrpcInterface/Python/rips/PythonExamples/export_and_plotting/headless_plot_export.py +++ b/GrpcInterface/Python/rips/PythonExamples/export_and_plotting/headless_plot_export.py @@ -29,6 +29,6 @@ summary_plot_collection.new_summary_plot( plots = resinsight.project.plots() for plot in plots: plot.export_snapshot() - # plot.export_snapshot(output_format="PDF") + # plot.export_snapshot(file_format=rips.SnapshotFileFormat.PDF) resinsight.exit() diff --git a/GrpcInterface/Python/rips/PythonExamples/wells_and_fractures/export_well_path_completions.py b/GrpcInterface/Python/rips/PythonExamples/wells_and_fractures/export_well_path_completions.py index b85c441f2a..5986b241a9 100644 --- a/GrpcInterface/Python/rips/PythonExamples/wells_and_fractures/export_well_path_completions.py +++ b/GrpcInterface/Python/rips/PythonExamples/wells_and_fractures/export_well_path_completions.py @@ -8,15 +8,17 @@ import rips # Load instance resinsight = rips.Instance.find() cases = resinsight.project.cases() +well_path = resinsight.project.well_path_by_name("Well-1") for case in cases: print("Case name: ", case.name) print("Case id: ", case.id) - case.export_well_path_completions( + case.export_completions( + well_paths=[well_path], time_step=0, - well_path_names=["Well-1"], - file_split="UNIFIED_FILE", + export_folder="d:/scratch/well_path_export", + file_split=rips.CompletionExportSplit.UNIFIED_FILE, include_perforations=True, - custom_file_name="d:/scratch/well_path_export/myfile.myext", + custom_file_name="myfile.myext", ) diff --git a/GrpcInterface/Python/rips/PythonExamples/wells_and_fractures/fishbones_completion.py b/GrpcInterface/Python/rips/PythonExamples/wells_and_fractures/fishbones_completion.py index 99610f515f..1ff6b9ee28 100644 --- a/GrpcInterface/Python/rips/PythonExamples/wells_and_fractures/fishbones_completion.py +++ b/GrpcInterface/Python/rips/PythonExamples/wells_and_fractures/fishbones_completion.py @@ -66,10 +66,11 @@ for case in cases: print("Case name: ", case.name) print("Case id: ", case.id) - case.export_well_path_completions( + case.export_completions( + well_paths=[well_path], time_step=0, - well_path_names=["Test Well-1 Y1"], - file_split="UNIFIED_FILE", + export_folder="f:/scratch/2023-11-02", + file_split=rips.CompletionExportSplit.UNIFIED_FILE, include_perforations=True, - custom_file_name="f:/scratch/2023-11-02/myfile.myext", + custom_file_name="myfile.myext", ) diff --git a/GrpcInterface/Python/rips/PythonExamples/wells_and_fractures/modeled_well_path.py b/GrpcInterface/Python/rips/PythonExamples/wells_and_fractures/modeled_well_path.py index be269da07a..35037f0143 100644 --- a/GrpcInterface/Python/rips/PythonExamples/wells_and_fractures/modeled_well_path.py +++ b/GrpcInterface/Python/rips/PythonExamples/wells_and_fractures/modeled_well_path.py @@ -103,11 +103,12 @@ for case in cases: print("Case name: ", case.name) print("Case id: ", case.id) - case.export_well_path_completions( + case.export_completions( + well_paths=[well_path], time_step=0, - well_path_names=["Test Well-1 Y1"], - file_split="UNIFIED_FILE", - include_perforations=True, # Replace the following with a valid path - custom_file_name="f:/scratch/2023-11-02/myfile.myext", + export_folder="f:/scratch/2023-11-02", + file_split=rips.CompletionExportSplit.UNIFIED_FILE, + include_perforations=True, + custom_file_name="myfile.myext", )