From e21e4f5008fecc8aad51d4e545befb4d33fb8550 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 25 Oct 2019 11:20:27 +0200 Subject: [PATCH] Documentation : Updates for Python documentation --- .../GrpcInterface/CMakeLists.cmake | 1 + .../Python/doc/source/PythonExamples.rst | 56 +++++++++++-------- .../GrpcInterface/Python/doc/source/rips.rst | 14 +++-- .../GrpcInterface/Python/rips/case.py | 7 ++- .../GrpcInterface/Python/rips/contour_map.py | 1 + 5 files changed, 50 insertions(+), 29 deletions(-) diff --git a/ApplicationCode/GrpcInterface/CMakeLists.cmake b/ApplicationCode/GrpcInterface/CMakeLists.cmake index a6d08c1719..d467b67587 100644 --- a/ApplicationCode/GrpcInterface/CMakeLists.cmake +++ b/ApplicationCode/GrpcInterface/CMakeLists.cmake @@ -163,6 +163,7 @@ if (RESINSIGHT_GRPC_PYTHON_EXECUTABLE) "rips/generated/RiaVersionInfo.py" "rips/__init__.py" "rips/case.py" + "rips/contour_map.py" "rips/grid.py" "rips/gridcasegroup.py" "rips/project.py" diff --git a/ApplicationCode/GrpcInterface/Python/doc/source/PythonExamples.rst b/ApplicationCode/GrpcInterface/Python/doc/source/PythonExamples.rst index a7b83b5caa..4d2ab34133 100644 --- a/ApplicationCode/GrpcInterface/Python/doc/source/PythonExamples.rst +++ b/ApplicationCode/GrpcInterface/Python/doc/source/PythonExamples.rst @@ -11,84 +11,92 @@ This pages is created based on the content in the **PythonExamples** folder loca AllCases -------- -.. literalinclude:: ../../rips/PythonExamples/AllCases.py - -AppInfo -------- -.. literalinclude:: ../../rips/PythonExamples/AppInfo.py +.. literalinclude:: ../../rips/PythonExamples/all_cases.py CaseGridGroup ------------- -.. literalinclude:: ../../rips/PythonExamples/CaseGridGroup.py +.. literalinclude:: ../../rips/PythonExamples/case_grid_group.py CaseInfoStreamingExample ------------------------ -.. literalinclude:: ../../rips/PythonExamples/CaseInfoStreamingExample.py +.. literalinclude:: ../../rips/PythonExamples/case_info_streaming_example.py CommandExample -------------- -.. literalinclude:: ../../rips/PythonExamples/CommandExample.py +.. literalinclude:: ../../rips/PythonExamples/command_example.py + +Create WBS Plot +--------------- +.. literalinclude:: ../../rips/PythonExamples/create_wbs_plot.py ErrorHandling ------------- -.. literalinclude:: ../../rips/PythonExamples/ErrorHandling.py +.. literalinclude:: ../../rips/PythonExamples/error_handling.py + +ExportPlots +----------- +.. literalinclude:: ../../rips/PythonExamples/export_plots.py ExportSnapshots --------------- -.. literalinclude:: ../../rips/PythonExamples/ExportSnapshots.py +.. literalinclude:: ../../rips/PythonExamples/export_snapshots.py GridInformation --------------- -.. literalinclude:: ../../rips/PythonExamples/GridInformation.py +.. literalinclude:: ../../rips/PythonExamples/grid_information.py + +Import Well Paths +----------------- +.. literalinclude:: ../../rips/PythonExamples/import_well_paths_and_logs.py InputPropTestAsync ------------------ -.. literalinclude:: ../../rips/PythonExamples/InputPropTestAsync.py +.. literalinclude:: ../../rips/PythonExamples/input_prop_test_async.py InputPropTestSync ----------------- -.. literalinclude:: ../../rips/PythonExamples/InputPropTestSync.py +.. literalinclude:: ../../rips/PythonExamples/input_prop_test_sync.py InstanceExample --------------- -.. literalinclude:: ../../rips/PythonExamples/InstanceExample.py +.. literalinclude:: ../../rips/PythonExamples/instance_example.py LaunchWithCommandLineOptions ---------------------------- -.. literalinclude:: ../../rips/PythonExamples/LaunchWithCommandLineOptions.py +.. literalinclude:: ../../rips/PythonExamples/launch_with_commandline_options.py SelectedCases ------------- -.. literalinclude:: ../../rips/PythonExamples/SelectedCases.py +.. literalinclude:: ../../rips/PythonExamples/selected_cases.py SetCellResult ------------- -.. literalinclude:: ../../rips/PythonExamples/SetCellResult.py +.. literalinclude:: ../../rips/PythonExamples/set_cell_result.py SetFlowDiagnosticsResult ------------------------ -.. literalinclude:: ../../rips/PythonExamples/SetFlowDiagnosticsResult.py +.. literalinclude:: ../../rips/PythonExamples/set_flow_diagnostics_result.py SetGridProperties ----------------- -.. literalinclude:: ../../rips/PythonExamples/SetGridProperties.py +.. literalinclude:: ../../rips/PythonExamples/set_grid_properties.py SoilAverageAsync ---------------- -.. literalinclude:: ../../rips/PythonExamples/SoilAverageAsync.py +.. literalinclude:: ../../rips/PythonExamples/soil_average_async.py SoilAverageSync --------------- -.. literalinclude:: ../../rips/PythonExamples/SoilAverageSync.py +.. literalinclude:: ../../rips/PythonExamples/soil_average_sync.py SoilPorvAsync ------------- -.. literalinclude:: ../../rips/PythonExamples/SoilPorvAsync.py +.. literalinclude:: ../../rips/PythonExamples/soil_porv_async.py SoilPorvSync ------------ -.. literalinclude:: ../../rips/PythonExamples/SoilPorvSync.py +.. literalinclude:: ../../rips/PythonExamples/soil_porv_sync.py ViewExample ----------- -.. literalinclude:: ../../rips/PythonExamples/ViewExample.py +.. literalinclude:: ../../rips/PythonExamples/view_example.py diff --git a/ApplicationCode/GrpcInterface/Python/doc/source/rips.rst b/ApplicationCode/GrpcInterface/Python/doc/source/rips.rst index a10a3a0e68..2ec06be723 100644 --- a/ApplicationCode/GrpcInterface/Python/doc/source/rips.rst +++ b/ApplicationCode/GrpcInterface/Python/doc/source/rips.rst @@ -7,7 +7,7 @@ Instance Module Example ------- -.. literalinclude:: ../../rips/PythonExamples/InstanceExample.py +.. literalinclude:: ../../rips/PythonExamples/instance_example.py :language: python :lines: 5- :emphasize-lines: 3 @@ -20,11 +20,17 @@ Case Module Example ------- -.. literalinclude:: ../../rips/PythonExamples/AllCases.py +.. literalinclude:: ../../rips/PythonExamples/all_cases.py :language: python :lines: 5- :emphasize-lines: 5 +Contour Map Module +================== + +.. autoclass:: rips.contour_map.ContourMap + :members: + Grid Module =========== @@ -70,7 +76,7 @@ Read two properties, multiply them together and push the results back to ResInsi This is slow and inefficient, but works. -.. literalinclude:: ../../rips/PythonExamples/InputPropTestSync.py +.. literalinclude:: ../../rips/PythonExamples/input_prop_test_async.py :language: python :lines: 5- @@ -80,7 +86,7 @@ Read two properties at the same time chunk by chunk, multiply each chunk togethe This is far more efficient. -.. literalinclude:: ../../rips/PythonExamples/InputPropTestAsync.py +.. literalinclude:: ../../rips/PythonExamples/input_prop_test_sync.py :language: python :lines: 5- diff --git a/ApplicationCode/GrpcInterface/Python/rips/case.py b/ApplicationCode/GrpcInterface/Python/rips/case.py index 1a3a105444..436022c767 100644 --- a/ApplicationCode/GrpcInterface/Python/rips/case.py +++ b/ApplicationCode/GrpcInterface/Python/rips/case.py @@ -251,7 +251,12 @@ class Case(PdmObject): caseId=self.case_id)).createViewResult.viewId) def contour_maps(self, map_type=ContourMapType.ECLIPSE): - """Get a list of all contour maps belonging to a project""" + """ Get a list of all contour maps belonging to a project + + Arguments: + map_type (enum): ContourMapType.ECLIPSE or ContourMapType.GEO_MECH + + """ pdm_objects = self.descendants(ContourMapType.get_identifier(map_type)) contour_maps = [] diff --git a/ApplicationCode/GrpcInterface/Python/rips/contour_map.py b/ApplicationCode/GrpcInterface/Python/rips/contour_map.py index 901b0de290..6190784d24 100644 --- a/ApplicationCode/GrpcInterface/Python/rips/contour_map.py +++ b/ApplicationCode/GrpcInterface/Python/rips/contour_map.py @@ -35,6 +35,7 @@ class ContourMap(View): def export_to_text(self, export_file_name='', export_local_coordinates=False, undefined_value_label="NaN", exclude_undefined_values=False): """ Export snapshot for the current view + Arguments: export_file_name(str): The file location to store results in. export_local_coordinates(bool): Should we export local coordinates, or UTM.