From b526bb791662373ec5138a7c630385221ea92828 Mon Sep 17 00:00:00 2001 From: HeliCorgi <269209176+HeliCorgi@users.noreply.github.com> Date: Wed, 1 Jul 2026 02:37:30 +0900 Subject: [PATCH] Make the app deployable on Streamlit Community Cloud (deploy prep) Add the repo-root files Streamlit Community Cloud needs; no code or core-output changes (the app already resolved examples/ via __file__ and never imports yupi). - requirements.txt: `-e .[gui]` -- installs the package + its gui extra (numpy, scipy, matplotlib, streamlit + kernel_viewer/stateflow) the way the cloud does (`pip install -r requirements.txt`). Verified in a FRESH venv: installs cleanly, imports OK, and app.analyze runs end-to-end with the example dropdown finding examples/*.npz. yupi is intentionally excluded (the deployed app loads committed npz, never generates). The explicit non-editable fallback list is documented in a comment in case a cloud image rejects the editable install. - runtime.txt: python-3.12 (>= the package's requires-python). - Verified import hygiene: app imports in ~0.3s with no heavy top-level work and with yupi import blocked; example paths resolve from __file__, CWD-independent. - README: a short "Deploy (Streamlit Community Cloud)" note (point a new app at app/streamlit_app.py on main). Core install stays numpy+scipy+matplotlib; both suites green; classify output byte-identical. No version bump (config-only, no functional change). Co-Authored-By: Claude Opus 4.8 (1M context) --- README.md | 9 +++++++++ requirements.txt | 18 ++++++++++++++++++ runtime.txt | 1 + 3 files changed, 28 insertions(+) create mode 100644 requirements.txt create mode 100644 runtime.txt diff --git a/README.md b/README.md index 6df0aad..6b91306 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,15 @@ core test suite. *Planned (not in v0.8): Plotly interactivity, a `K(r, t)` time-slider animation, and multi-file comparison — see [`app/README.md`](app/README.md).* +### Deploy (Streamlit Community Cloud) + +The app deploys on [Streamlit Community Cloud](https://share.streamlit.io) with +no extra setup: point a new app at **`app/streamlit_app.py`** on the **`main`** +branch. Dependencies install from the repo-root **`requirements.txt`** (the +package + its `gui` extra; `runtime.txt` pins Python 3.12). The app resolves the +bundled `examples/*.npz` from its own file location, so the example dropdown +works in the cloud sandbox. Every push to `main` triggers an automatic redeploy. + ## 2D kernels 2D input `K(x, y, t)` is handled by **radial reduction with full-2D moments**: diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e4daa6a --- /dev/null +++ b/requirements.txt @@ -0,0 +1,18 @@ +# Streamlit Community Cloud installs the app's dependencies from this file. +# +# Install the package itself with its `gui` extra, from the repo root. This +# pulls the runtime deps (numpy, scipy, matplotlib) + streamlit, plus the +# kernel_viewer / stateflow packages, in one line. +# +# yupi is intentionally NOT listed: it is only the `examples` extra used by the +# offline data generator (examples/generate_yupi_examples.py). The deployed app +# loads the committed examples/*.npz and never imports yupi. +# +# If a Streamlit Cloud image rejects the editable install, replace the line +# below with the explicit, non-editable form: +# numpy>=1.24 +# scipy>=1.10 +# matplotlib>=3.7 +# streamlit>=1.30 +# . +-e .[gui] diff --git a/runtime.txt b/runtime.txt new file mode 100644 index 0000000..d2aca3a --- /dev/null +++ b/runtime.txt @@ -0,0 +1 @@ +python-3.12