Visdom: Python client + Tornado server + React frontend for live data visualization.
Version 0.2.4 · Python >= 3.12 · Apache 2.0
- Install Python:
pip install -e . && pip install -r test-requirements.txt - Build frontend:
yarn && yarn run build - Install hooks:
pip install pre-commit && pre-commit install
- Format Python:
black py(v23.1.0, CI-enforced) - Lint JS:
npm run lint - Format JS/CSS/JSON: Prettier (v2.6.2)
- Add Apache License headers to all new files (see
context/backend.md)
- Edit files in
py/visdom/static/— auto-built by CI - Edit legacy Lua/Torch code in
th/ - Commit secrets, credentials, or
COOKIE_SECRET - Push directly to
master - Skip pre-commit hooks (
--no-verify)
- Handlers in
web_handlers.pycopy app attributes ininitialize()— do not refactor toself.app - Always decorate handler methods with
@check_auth— omitting it creates an auth bypass - Every socket feature must work in both WebSocket and polling modes
- Do not "fix" direct state mutation in
main.js(storeData.layout = layout) — intentional TextPane.jsusesinnerHTMLby design — do not expose server without auth- Sanitize environment names via
escape_eid(), verify paths stay withinenv_path
- Python unit tests:
pytest -m "not server"(config inpyproject.toml, suite inpy/tests/) - Fast loop:
pytest -m unit— CI runs this as a gate, so mark every new file with a module-levelpytestmark; seecontext/testing.mdfor which marker and where the file goes - Start server (for Cypress):
visdom -port 8098 -env_path /tmp - Baseline:
npm run test:init - Run E2E tests:
npm run test - Pre-commit:
pre-commit run --all-files
- Branch from
master; addpytesttests inpy/tests/for Python code and Cypress tests for frontend behavior - New test file: put it in
py/tests/unit/orpy/tests/integration/, and give it the matchingpytestmark— CI runs-m unitas a gate, so an unmarked file is in neither job - Update
READMEfor API changes,__init__.pyifor interface changes - Run linters, do not commit
py/visdom/static/
- Changing API endpoints, message protocol, or auth
- Adding Python or Node.js dependencies
- Large cross-component refactors
context/— architecture, backend, frontend, testingskills/— adding-pane, websocket-flow, cypress-testing, release-process