Skip to content

Commit af4463d

Browse files
author
xhlulu
committed
apply black
Former-commit-id: 6c1678f
1 parent 65abf87 commit af4463d

File tree

1 file changed

+20
-23
lines changed
  • apps/dash-vehicle-geometry

1 file changed

+20
-23
lines changed

apps/dash-vehicle-geometry/app.py

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ def _load_vtp(filepath, fieldname=None, point_arrays=[], cell_arrays=[]):
3232
# GUI setup
3333
# -----------------------------------------------------------------------------
3434

35-
app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP], suppress_callback_exceptions=True)
35+
app = dash.Dash(
36+
__name__,
37+
external_stylesheets=[dbc.themes.BOOTSTRAP],
38+
suppress_callback_exceptions=True,
39+
)
3640
server = app.server
3741

3842
# -----------------------------------------------------------------------------
@@ -53,7 +57,7 @@ def _load_vtp(filepath, fieldname=None, point_arrays=[], cell_arrays=[]):
5357
colorDataRange=[0, 100],
5458
actor={"visibility": 1},
5559
mapper={"scalarVisibility": False},
56-
children=[dash_vtk.Mesh(id=f"{part_name}-mesh", state=mesh,)],
60+
children=[dash_vtk.Mesh(id=f"{part_name}-mesh", state=mesh)],
5761
# children=[dash_vtk.Mesh(id=f"{part_name}-mesh")],
5862
)
5963
vehicle_vtk.append(child)
@@ -74,7 +78,7 @@ def _load_vtp(filepath, fieldname=None, point_arrays=[], cell_arrays=[]):
7478
id=f"{surf_name}-rep",
7579
property={"color": [1, 0, 0]},
7680
actor={"visibility": 0},
77-
children=[dash_vtk.Mesh(id=f"{surf_name}-mesh", state=mesh,)],
81+
children=[dash_vtk.Mesh(id=f"{surf_name}-mesh", state=mesh)],
7882
# children=[dash_vtk.Mesh(id=f"{surf_name}-mesh")],
7983
)
8084

@@ -111,7 +115,7 @@ def _load_vtp(filepath, fieldname=None, point_arrays=[], cell_arrays=[]):
111115
],
112116
labelStyle={"display": "block"},
113117
value=["body", "drive-train", "front-wing", "rear-wing"],
114-
),
118+
)
115119
]
116120
),
117121
]
@@ -130,7 +134,7 @@ def _load_vtp(filepath, fieldname=None, point_arrays=[], cell_arrays=[]):
130134
{"label": "p", "value": "p"},
131135
],
132136
value="solid",
133-
),
137+
)
134138
]
135139
),
136140
]
@@ -146,7 +150,7 @@ def _load_vtp(filepath, fieldname=None, point_arrays=[], cell_arrays=[]):
146150
options=[{"label": " Cp", "value": "cp"}],
147151
labelStyle={"display": "block"},
148152
value=[],
149-
),
153+
)
150154
]
151155
),
152156
]
@@ -172,14 +176,16 @@ def _load_vtp(filepath, fieldname=None, point_arrays=[], cell_arrays=[]):
172176
dbc.Spinner(
173177
html.Div(
174178
id="vtk-view-container",
175-
style={"height": "calc(100vh - 230px)", "width": "100%"}
179+
style={
180+
"height": "calc(100vh - 230px)",
181+
"width": "100%",
182+
},
176183
),
177-
color='light'
184+
color="light",
178185
),
179-
style={'background-color': '#334c66'}
186+
style={"background-color": "#334c66"},
180187
)
181188
],
182-
183189
),
184190
],
185191
style={"margin-top": "15px", "height": "calc(100vh - 230px)"},
@@ -191,25 +197,16 @@ def _load_vtp(filepath, fieldname=None, point_arrays=[], cell_arrays=[]):
191197
# This Handle controls
192198
# -----------------------------------------------------------------------------
193199

194-
COLOR_RANGES = {
195-
"solid": [0, 1],
196-
"U": [0, 100],
197-
"p": [-4464, 1700],
198-
}
199-
200+
COLOR_RANGES = {"solid": [0, 1], "U": [0, 100], "p": [-4464, 1700]}
200201

201202

202-
@app.callback(
203-
Output('vtk-view-container', 'children'),
204-
[Input('geometry', 'value')]
205-
)
203+
@app.callback(Output("vtk-view-container", "children"), [Input("geometry", "value")])
206204
def initial_loading(geometry):
207205
triggered = dash.callback_context.triggered
208206
if triggered:
209207
return dash.no_update
210-
211-
return dash_vtk.View(id="vtk-view", children=vehicle_vtk + isosurfs_vtk)
212208

209+
return dash_vtk.View(id="vtk-view", children=vehicle_vtk + isosurfs_vtk)
213210

214211

215212
@app.callback(
@@ -223,7 +220,7 @@ def initial_loading(geometry):
223220
Input("isosurfaces", "value"),
224221
Input("surfcolor", "value"),
225222
],
226-
prevent_initial_call=True
223+
prevent_initial_call=True,
227224
)
228225
def update_scene(geometry, isosurfaces, surfcolor):
229226
triggered = dash.callback_context.triggered

0 commit comments

Comments
 (0)