Skip to content

Commit c8c1332

Browse files
authored
Merge pull request #228 from lucasimi/add-nicegui-app
Add nicegui app
2 parents 7e06f3c + 909e306 commit c8c1332

File tree

12 files changed

+1086
-128
lines changed

12 files changed

+1086
-128
lines changed

.github/workflows/test-bench.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949

5050
- name: Install dependencies
5151
run: |
52-
python -m pip install -e .[dev]
52+
python -m pip install -e .[dev,app]
5353
5454
- name: Run benchmarks
5555
run: |

.github/workflows/test-unit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949

5050
- name: Install dependencies
5151
run: |
52-
python -m pip install -e .[dev]
52+
python -m pip install -e .[dev,app]
5353
5454
- name: Run tests and code coverage
5555
run: |

README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ and in the
4545

4646
- **Interactive app**
4747

48-
Provides an interactive web-based interface (via Streamlit) for dynamic
49-
exploration of Mapper graph structures, offering real-time adjustments to
50-
parameters and visualizations.
48+
Provides an interactive web-based interface for dynamic exploration of
49+
Mapper graph structures, offering real-time adjustments to parameters and
50+
visualizations.
5151

5252
## Background
5353

@@ -138,21 +138,23 @@ More examples can be found in the
138138

139139
## Interactive App
140140

141-
Use our Streamlit app to visualize and explore your data without writing code.
142-
You can run a live demo directly on
143-
[Streamlit Cloud](https://tda-mapper-app.streamlit.app/),
144-
or locally on your machine. The first time you run the app locally, you may
145-
need to install the required dependencies from the `requirements.txt` file by
146-
running
141+
Use our app to interactively visualize and explore your data without writing
142+
code. You can try it right away using
143+
[our live demo](https://tda-mapper-app.up.railway.app/),
144+
or run it locally on your machine.
147145

148-
```bash
149-
pip install -r app/requirements.txt
150-
```
146+
To run it locally:
151147

152-
then run the app locally with
148+
1. Install the app and its dependencies:
153149

154-
```bash
155-
streamlit run app/streamlit_app.py
156-
```
150+
```bash
151+
pip install tda-mapper[app]
152+
```
153+
154+
2. Launch the app:
155+
156+
```bash
157+
tda-mapper-app
158+
```
157159

158160
![tda-mapper-app](https://github.com/lucasimi/tda-mapper-python/raw/main/resources/tda-mapper-app.png)

app/streamlit_app.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,4 +959,14 @@ def main():
959959
st.markdown(FOOTER)
960960

961961

962-
main()
962+
def redirect():
963+
st.markdown(
964+
"""
965+
## 🚨 Notice: This app is no longer not maintained and will be removed soon.
966+
967+
### 👉 To continue using the service, please switch to the [new, updated version](https://tda-mapper-app.up.railway.app/).
968+
"""
969+
)
970+
971+
972+
redirect()

docs/source/index.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
:target: https://codecov.io/github/lucasimi/tda-mapper-python
1515
.. |DOI| image:: https://img.shields.io/badge/DOI-10.5281/zenodo.10642381-blue?logo=doi&logoColor=silver
1616
:target: https://doi.org/10.5281/zenodo.10642381
17-
.. |Streamlit App| image:: https://img.shields.io/badge/Streamlit-App-blue?logo=streamlit&logoColor=silver
18-
:target: https://tda-mapper-app.streamlit.app/
1917
.. |Step 1| image:: https://github.com/lucasimi/tda-mapper-python/raw/main/resources/mapper_1.png
2018
.. |Step 2| image:: https://github.com/lucasimi/tda-mapper-python/raw/main/resources/mapper_2.png
2119
.. |Step 3| image:: https://github.com/lucasimi/tda-mapper-python/raw/main/resources/mapper_3.png
@@ -68,9 +66,9 @@ Core features
6866

6967
- **Interactive app**
7068

71-
Provides an interactive web-based interface (via Streamlit) for dynamic
72-
exploration of Mapper graph structures, offering real-time adjustments to
73-
parameters and visualizations.
69+
Provides an interactive web-based interface for dynamic exploration of
70+
Mapper graph structures, offering real-time adjustments to parameters and
71+
visualizations.
7472

7573

7674
Background

docs/source/quickstart.rst

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,27 +92,24 @@ More examples can be found in the
9292
Interactive App
9393
---------------
9494

95-
Use our Streamlit app to visualize and explore your data without writing code.
96-
You can run a live demo directly on
97-
`Streamlit Cloud <https://tda-mapper-app.streamlit.app/>`__,
98-
or locally on your machine using the following:
99-
100-
Use our Streamlit app to visualize and explore your data without writing code.
101-
You can run a live demo directly on
102-
`Streamlit Cloud <https://tda-mapper-app.streamlit.app/>`__,
103-
or locally on your machine. The first time you run the app locally, you may
104-
need to install the required dependencies from the `requirements.txt` file by
105-
running
95+
Use our app to interactively visualize and explore your data without writing
96+
code. You can try it right away using
97+
`our live demo <https://tda-mapper-app.up.railway.app/>`__,
98+
or run it locally on your machine.
10699

107-
.. code:: bash
100+
To run it locally:
108101

109-
pip install -r app/requirements.txt
102+
1. Install the app and its dependencies:
110103

111-
then run the app locally with
104+
.. code:: bash
112105
113-
.. code:: bash
106+
pip install tda-mapper[app]
107+
108+
2. Launch the app:
109+
110+
.. code:: bash
114111
115-
streamlit run app/streamlit_app.py
112+
tda-mapper-app
116113
117114
|Interactive App|
118115

pyproject.toml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "tda-mapper"
7-
version = "0.11.2"
7+
version = "0.12.0"
88
description = "A simple and efficient Python implementation of Mapper algorithm for Topological Data Analysis"
99
readme = "README.md"
1010
authors = [{ name = "Luca Simi", email = "[email protected]" }]
@@ -44,14 +44,25 @@ requires-python = ">=3.8"
4444
[project.optional-dependencies]
4545
dev = [
4646
"coverage[toml]",
47-
"pandas",
47+
"pandas<3.0.0",
4848
"scikit-learn<1.6.0",
4949
"pytest",
50+
"pytest-asyncio",
5051
"black[jupyter]",
5152
"isort",
5253
"flake8",
54+
"kaleido",
5355
"nbformat>=4.2.0",
5456
]
57+
app = [
58+
"pandas<3.0.0",
59+
"scikit-learn<1.6.0",
60+
"umap-learn<0.6.0",
61+
"nicegui>=2.18.0,<3.0.0",
62+
]
63+
64+
[project.scripts]
65+
tda-mapper-app = "tdamapper._run_app:run"
5566

5667
[project.urls]
5768
Homepage = "https://github.com/lucasimi/tda-mapper-python"
@@ -88,3 +99,15 @@ include_trailing_comma = true
8899
force_grid_wrap = 0
89100
combine_as_imports = true
90101
skip = ["venv", ".venv", "build", "dist"]
102+
103+
[tool.pytest.ini_options]
104+
asyncio_mode = "auto"
105+
testpaths = ["tests"]
106+
asyncio_default_fixture_loop_scope = "function"
107+
filterwarnings = [
108+
'ignore::DeprecationWarning:_plotly_utils\.basevalidators',
109+
]
110+
111+
markers = [
112+
"module_under_test",
113+
]

resources/tda-mapper-app.png

172 KB
Loading

src/tdamapper/_run_app.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from tdamapper.app import main
2+
3+
4+
def run():
5+
main()
6+
7+
8+
if __name__ in {"__main__", "__mp_main__", "tdamapper._run_app"}:
9+
run()

0 commit comments

Comments
 (0)