Skip to content

Commit 212a046

Browse files
authored
fix(gui): fix serve (#43)
1 parent f17a083 commit 212a046

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/biem_helmholtz_sphere/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from biem_helmholtz_sphere import BIEMResultCalculator, biem, plane_wave
1212
from biem_helmholtz_sphere.bempp_cl_sphere import bempp_cl_sphere
1313

14-
from .gui import serve as serve_plot
14+
from .gui import servable
1515

1616
app = typer.Typer()
1717
LOG = getLogger(__name__)
@@ -25,7 +25,7 @@ def _main(verbose: bool = typer.Option(False, "--verbose", "-v")) -> None:
2525
@app.command()
2626
def serve() -> None:
2727
"""Serve panel app."""
28-
serve_plot()
28+
servable().show(port=7860, websocket_origin="*")
2929

3030

3131
@app.command()

src/biem_helmholtz_sphere/gui.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
LOG = getLogger(__name__)
2222

2323

24-
def serve() -> None:
25-
"""Serve panel app."""
24+
def servable() -> pmui.Page:
25+
"""Get servable panel app."""
2626
pn.extension("katex", "mathjax", "plotly")
2727
res: BIEMResultCalculator[Any, Any] | None = None
2828
rescountw = pn.widgets.IntInput(name="Result count", value=0)
@@ -408,7 +408,7 @@ def exception_handler(ex: Any) -> None:
408408
if pn.state.notifications is not None:
409409
pn.state.notifications.error(f"{ex}")
410410

411-
pmui.Page(
411+
return pmui.Page(
412412
dark_theme=True,
413413
title="Acoustic Scattering by Multiple Spheres",
414414
main=[update_plot],
@@ -432,4 +432,4 @@ def exception_handler(ex: Any) -> None:
432432
)
433433
],
434434
sidebar_width=510,
435-
).show()
435+
).servable()

0 commit comments

Comments
 (0)