turbo_moc.app module#
turbo_moc.app – interactive Dash app for MOC nozzle design.
Structured after turbodash’s app.py: one Dash app, a compute callback that calls a single engine function (here, turbo_moc.design_nozzle) and stores its result in a dcc.Store, and a second callback that fans that result out into plots. The one deliberate departure from turbodash’s pattern: the compute callback runs in the background (background=True + DiskcacheManager) with a live progress bar, since a solve here takes 5-30s+ (turbodash’s own algebraic core is sub-second, so it never needed this) – an explicit “Compute” button, not live recompute-on-slider-drag, is the intended UX.
Plots are displayed with turbo_moc.plotly (interactive dcc.Graph – zoom, pan,
hover, and a native download-as-PNG toolbar button, same as turbodash’s own
app.py). turbo_moc.plotly’s figures are styled (see
plotting_plotly._apply_journal_style) to read close to turbo_moc.mpl’s
boxed-axes/gridline look rather
than Plotly’s own default template, since visual consistency with
examples/plot_design.py’s output mattered too – same colors either way,
only the interactive vs. static trade-off differs. The “Download this
plot” button + format dropdown (PNG/SVG/PDF) is separate from Plotly’s own
toolbar button (PNG only): it re-renders the SAME figure with turbo_moc.mpl on
click, so an SVG/PDF download is a real vector file, not a rasterized PNG
relabeled – display and file-export are genuinely two different renders
of the same data, not one converted into the other.
Run locally:
conda activate turbo_moc_env
python -m turbo_moc.app
(or: turbo_moc-app-legacy, the console-script entry point from pyproject.toml)
then open the printed http://127.0.0.1:8050/ URL in a browser.