feat: add StemAtlas Streamlit app, explorer, Docker deployment, blog charts

This commit is contained in:
2026-03-22 22:38:17 +01:00
parent daa22c5e2b
commit 2891e9ee70
20 changed files with 2576 additions and 84 deletions
+14
View File
@@ -0,0 +1,14 @@
"""Smoke test: explorer module is importable without DB or heavy computation."""
import importlib
def test_explorer_importable():
mod = importlib.import_module("explorer")
assert hasattr(mod, "run_app")
assert callable(mod.run_app)
assert hasattr(mod, "load_positions")
assert hasattr(mod, "load_motions_df")
assert hasattr(mod, "query_similar")
assert hasattr(mod, "build_compass_tab")
assert hasattr(mod, "build_search_tab")
+38
View File
@@ -0,0 +1,38 @@
"""Smoke test: Home module is importable without DB or heavy computation."""
import importlib
import sys
def test_home_importable():
# Streamlit cannot run set_page_config outside of a server context,
# so we only verify the file can be parsed/compiled, not fully executed.
import ast
import os
home_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "Home.py")
with open(home_path) as f:
source = f.read()
# Verify the file parses as valid Python
tree = ast.parse(source)
# Verify st.set_page_config is called at module level (first Streamlit command)
calls = [
node
for node in ast.walk(tree)
if isinstance(node, ast.Call)
and isinstance(node.func, ast.Attribute)
and node.func.attr == "set_page_config"
]
assert calls, "Home.py must call st.set_page_config()"
# Verify page links exist (st.page_link calls)
page_links = [
node
for node in ast.walk(tree)
if isinstance(node, ast.Call)
and isinstance(node.func, ast.Attribute)
and node.func.attr == "page_link"
]
assert len(page_links) >= 2, "Home.py must have at least 2 st.page_link() calls"