Skip to content

Commit

Permalink
docs(black): update example formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed May 27, 2024
1 parent 6c778fc commit 1e01732
Show file tree
Hide file tree
Showing 9 changed files with 685 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ def update_grid(nodes_file, elems_file, field_file, **kwargs):
df_elems.loc[df_elems.loc[:, 0] > 0, "cell_types"] = df_elems.loc[
df_elems.loc[:, 0] > 0, 1
].map(
lambda x: vtk_shape_id_map[x.strip()]
if x.strip() in vtk_shape_id_map.keys()
else np.nan
lambda x: (
vtk_shape_id_map[x.strip()]
if x.strip() in vtk_shape_id_map.keys()
else np.nan
)
)
df_elems = df_elems.dropna(subset=["cell_types"], axis=0)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,11 @@ def update_grid(nodes_file, elems_file, field_file, **kwargs):
df_elems.loc[df_elems.loc[:, 0] > 0, "cell_types"] = df_elems.loc[
df_elems.loc[:, 0] > 0, 1
].map(
lambda x: vtk_shape_id_map[x.strip()]
if x.strip() in vtk_shape_id_map.keys()
else np.nan
lambda x: (
vtk_shape_id_map[x.strip()]
if x.strip() in vtk_shape_id_map.keys()
else np.nan
)
)
df_elems = df_elems.dropna(subset=["cell_types"], axis=0)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,11 @@ def update_grid(nodes_file, elems_file, field_file, **kwargs):
df_elems.loc[df_elems.loc[:, 0] > 0, "cell_types"] = df_elems.loc[
df_elems.loc[:, 0] > 0, 1
].map(
lambda x: vtk_shape_id_map[x.strip()]
if x.strip() in vtk_shape_id_map.keys()
else np.nan
lambda x: (
vtk_shape_id_map[x.strip()]
if x.strip() in vtk_shape_id_map.keys()
else np.nan
)
)
df_elems = df_elems.dropna(subset=["cell_types"], axis=0)

Expand Down
1 change: 1 addition & 0 deletions examples/07_paraview/Wavelet/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Installation requirements:
pip install trame trame-vuetify trame-vtk trame-components trame-rca
"""

import paraview.web.venv
from paraview import simple
import asyncio
Expand Down
44 changes: 44 additions & 0 deletions examples/validation/discussion/374.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# export PYTHONPATH=/Applications/ParaView-5.12.0-RC1.app/Contents/Python/
# export DYLD_LIBRARY_PATH=/Applications/ParaView-5.12.0-RC1.app/Contents/Libraries/

from paraview import simple
from trame.app import get_server
from trame.ui.html import DivLayout
from trame.widgets import paraview, html

# create a new 'IOSS Reader'
disk_out_refex2 = simple.IOSSReader(
registrationName="disk_out_ref.ex2",
FileName=[
"/Applications/ParaView-5.12.0-RC1.app/Contents/examples/disk_out_ref.ex2"
],
)

# get active view
renderView1 = simple.GetActiveViewOrCreate("RenderView")

# show data in view
disk_out_refex2Display = simple.Show(
disk_out_refex2, renderView1, "UnstructuredGridRepresentation"
)

# trace defaults for the display properties.
disk_out_refex2Display.Representation = "Surface"


# update the view to ensure updated data information
renderView1.Update()

# change representation type
disk_out_refex2Display.SetRepresentationType("Surface LIC")


server = get_server(client_type="vue3")
with DivLayout(server) as layout:
layout.root.style = "width: 100vw; height: 100vh; margin: 0; padding: 0;"
reset_camera = paraview.VtkRemoteView(renderView1).reset_camera
html.Button(
"Reset", style="position: absolute; top: 10px; left: 10px;", click=reset_camera
)

server.start()
Loading

0 comments on commit 1e01732

Please sign in to comment.