Skip to content

Commit

Permalink
ran black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sandstromviktor committed Mar 14, 2024
1 parent 748dd80 commit 7491ec3
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 11 deletions.
3 changes: 2 additions & 1 deletion examples/dash/airplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@


def make_airplane(
n_booms, wing_span,
n_booms,
wing_span,
):
# n_booms = 3

Expand Down
42 changes: 35 additions & 7 deletions examples/dash/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@
max=3,
step=1,
value=3,
marks={1: "1", 2: "2", 3: "3",},
marks={
1: "1",
2: "2",
3: "3",
},
),
html.P("Wing Span [m]:"),
dcc.Input(id="wing_span", value=43, type="number"),
Expand Down Expand Up @@ -87,7 +91,10 @@
html.Div(
[
html.H5("Aerodynamic Performance"),
dbc.Spinner(html.P(id="output"), color="primary",),
dbc.Spinner(
html.P(id="output"),
color="primary",
),
]
),
],
Expand Down Expand Up @@ -141,10 +148,19 @@ def make_table(dataframe):
Input("run_ll_analysis", "n_clicks_timestamp"),
Input("run_vlm_analysis", "n_clicks_timestamp"),
],
[State("n_booms", "value"), State("wing_span", "value"), State("alpha", "value"),],
[
State("n_booms", "value"),
State("wing_span", "value"),
State("alpha", "value"),
],
)
def display_geometry(
display_geometry, run_ll_analysis, run_vlm_analysis, n_booms, wing_span, alpha,
display_geometry,
run_ll_analysis,
run_vlm_analysis,
n_booms,
wing_span,
alpha,
):
### Figure out which button was clicked
try:
Expand All @@ -162,8 +178,15 @@ def display_geometry(
button_pressed = 0

### Make the airplane
airplane = make_airplane(n_booms=n_booms, wing_span=wing_span,)
op_point = asb.OperatingPoint(density=0.10, velocity=20, alpha=alpha,)
airplane = make_airplane(
n_booms=n_booms,
wing_span=wing_span,
)
op_point = asb.OperatingPoint(
density=0.10,
velocity=20,
alpha=alpha,
)
if button_pressed == 0:
# Display the geometry
figure = airplane.draw(show=False, colorbar_title=None)
Expand Down Expand Up @@ -242,7 +265,12 @@ def display_geometry(
autosize=True,
# width=1000,
# height=700,
margin=dict(l=0, r=0, b=0, t=0,),
margin=dict(
l=0,
r=0,
b=0,
t=0,
),
)

return (figure, output)
Expand Down
12 changes: 9 additions & 3 deletions examples/dash/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@
wing_span = 40
alpha = 5

airplane = make_airplane(n_booms=n_booms, wing_span=wing_span,)
op_point = asb.OperatingPoint(density=0.10, velocity=20, alpha=alpha,)
airplane = make_airplane(
n_booms=n_booms,
wing_span=wing_span,
)
op_point = asb.OperatingPoint(
density=0.10,
velocity=20,
alpha=alpha,
)

### LL
# Run an analysis
Expand All @@ -28,4 +35,3 @@
# Postprocess
# ap.substitute_solution(sol)
ap.draw(show=False).show()

0 comments on commit 7491ec3

Please sign in to comment.