mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Python code linting changes detected by black (#11211)
Co-authored-by: jorgenherje <jorgenherje@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
9eec4e6d4b
commit
9d186051d2
@@ -14,8 +14,12 @@ from rips.generated.GridGeometryExtraction_pb2 import *
|
|||||||
rips_instance = Instance.find()
|
rips_instance = Instance.find()
|
||||||
grid_geometry_extraction_stub = GridGeometryExtractionStub(rips_instance.channel)
|
grid_geometry_extraction_stub = GridGeometryExtractionStub(rips_instance.channel)
|
||||||
|
|
||||||
get_grid_surface_request = GridGeometryExtraction__pb2.GetGridSurfaceRequest(gridFilename=None, ijkIndexFilter=None,cellIndexFilter=None,propertyFilter=None)
|
get_grid_surface_request = GridGeometryExtraction__pb2.GetGridSurfaceRequest(
|
||||||
get_grid_surface_response: GridGeometryExtraction__pb2.GetGridSurfaceResponse = grid_geometry_extraction_stub.GetGridSurface(get_grid_surface_request)
|
gridFilename=None, ijkIndexFilter=None, cellIndexFilter=None, propertyFilter=None
|
||||||
|
)
|
||||||
|
get_grid_surface_response: GridGeometryExtraction__pb2.GetGridSurfaceResponse = (
|
||||||
|
grid_geometry_extraction_stub.GetGridSurface(get_grid_surface_request)
|
||||||
|
)
|
||||||
|
|
||||||
get_grid_surface_response.gridDimensions
|
get_grid_surface_response.gridDimensions
|
||||||
vertex_array = get_grid_surface_response.vertexArray
|
vertex_array = get_grid_surface_response.vertexArray
|
||||||
@@ -23,7 +27,7 @@ quad_indices_array = get_grid_surface_response.quadIndicesArr
|
|||||||
|
|
||||||
num_vertex_coords = 3 # [x, y, z]
|
num_vertex_coords = 3 # [x, y, z]
|
||||||
num_vertices_per_quad = 4 # [v1, v2, v3, v4]
|
num_vertices_per_quad = 4 # [v1, v2, v3, v4]
|
||||||
num_quads = len(vertex_array) /(num_vertex_coords * num_vertices_per_quad)
|
num_quads = len(vertex_array) / (num_vertex_coords * num_vertices_per_quad)
|
||||||
|
|
||||||
x_array = []
|
x_array = []
|
||||||
y_array = []
|
y_array = []
|
||||||
@@ -32,8 +36,8 @@ z_array = []
|
|||||||
# Create x-, y-, and z-arrays
|
# Create x-, y-, and z-arrays
|
||||||
for i in range(0, len(vertex_array), num_vertex_coords):
|
for i in range(0, len(vertex_array), num_vertex_coords):
|
||||||
x_array.append(vertex_array[i])
|
x_array.append(vertex_array[i])
|
||||||
y_array.append(vertex_array[i+1])
|
y_array.append(vertex_array[i + 1])
|
||||||
z_array.append(vertex_array[i+2])
|
z_array.append(vertex_array[i + 2])
|
||||||
|
|
||||||
# Create triangular mesh
|
# Create triangular mesh
|
||||||
i_array = []
|
i_array = []
|
||||||
@@ -42,24 +46,26 @@ k_array = []
|
|||||||
for i in range(0, len(quad_indices_array), num_vertices_per_quad):
|
for i in range(0, len(quad_indices_array), num_vertices_per_quad):
|
||||||
# Set the indices of the vertices of the triangles
|
# Set the indices of the vertices of the triangles
|
||||||
i_array.extend([i, i])
|
i_array.extend([i, i])
|
||||||
j_array.extend([i+1, i+2])
|
j_array.extend([i + 1, i + 2])
|
||||||
k_array.extend([i+2, i+3])
|
k_array.extend([i + 2, i + 3])
|
||||||
|
|
||||||
|
|
||||||
|
fig = go.Figure(
|
||||||
fig = go.Figure(data=[go.Mesh3d(
|
data=[
|
||||||
|
go.Mesh3d(
|
||||||
x=x_array,
|
x=x_array,
|
||||||
y=y_array,
|
y=y_array,
|
||||||
z=z_array,
|
z=z_array,
|
||||||
i=i_array,
|
i=i_array,
|
||||||
j=j_array,
|
j=j_array,
|
||||||
k=k_array,
|
k=k_array,
|
||||||
intensity = np.linspace(-5, 5, 1000, endpoint=True),
|
intensity=np.linspace(-5, 5, 1000, endpoint=True),
|
||||||
showscale=True,
|
showscale=True,
|
||||||
colorscale=[[0, 'gold'],[0.5, 'mediumturquoise'],[1.0, 'magenta']]
|
colorscale=[[0, "gold"], [0.5, "mediumturquoise"], [1.0, "magenta"]],
|
||||||
)])
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
print(fig.data)
|
print(fig.data)
|
||||||
|
|
||||||
fig.show()
|
fig.show()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user