File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010
1111import networkx as nx
1212import numpy as np
13- import plotly .graph_objects as go
1413import streamlit as st
1514
1615import qqa
1716
17+ try :
18+ import plotly .graph_objects as go
19+ except ModuleNotFoundError as exc : # pragma: no cover - surface a friendlier error
20+ st .error (
21+ "The `plotly` package is required for the dashboard. "
22+ "Add it to `requirements.txt` (or run `pip install plotly`)."
23+ )
24+ st .stop ()
25+ raise SystemExit from exc
26+
1827# Default snippet shown in the Custom-problem editor. It implements a simple
1928# Sherrington–Kirkpatrick-style spin glass that the user can adapt freely.
2029DEFAULT_CUSTOM_SNIPPET = '''import torch
Original file line number Diff line number Diff line change 1111# only consumed by pip-based deploy targets (Streamlit Community Cloud,
1212# Hugging Face Spaces, Render, etc.).
1313
14+ # CPU-only PyTorch wheel (avoids the 900MB CUDA build that would blow
15+ # through the 1GB Streamlit Community Cloud image budget).
1416--extra-index-url https://download.pytorch.org/whl/cpu
15- torch == 2.4.1+cpu
17+ torch >= 2.2 , < 2.8
1618
17- numpy >= 1.24
19+ numpy >= 1.24 , < 3
1820networkx >= 3.1
1921scipy >= 1.11
2022matplotlib >= 3.8
2123tqdm >= 4.66
2224
23- # Interactive plots + GUI
25+ # Interactive plots + GUI (REQUIRED by app/_common.py at import time).
2426plotly >= 5.17
2527pandas >= 2.0
2628streamlit >= 1.30
2729
28- # Install this repository (reads pyproject.toml)
30+ # Install this repository so ``import qqa`` works inside the app.
2931.
Original file line number Diff line number Diff line change 1+ python-3.11
You can’t perform that action at this time.
0 commit comments