When Streamlit refreshes/reruns, session state is lost but the old
simulation server thread keeps running on ports 5001-5003. This caused
"address already in use" errors when trying to start a new server.
Solution: Use a module-level singleton for the simulation server that
persists across Streamlit reruns. The get_or_create_server() function
checks if a server is already running before creating a new one.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Physics pauses after IDLE_PAUSE_SECONDS (default 30s) of inactivity
- Resumes instantly when someone views the dashboard
- No container restart needed - just pauses the simulation loop
- CPU usage drops to ~0% when paused
- IDLE_TIMEOUT_MINUTES env var to configure shutdown after inactivity
- Background thread monitors activity and exits when timeout reached
- Activity tracked via simulation_display fragment (runs while page open)
- Set to 0 (default) to disable auto-shutdown
- Wrap simulation controls in form to prevent page reruns on change
- Fix TempCo test configs to use 2+ temperature points
- Add Installation, Quick Start, and usage examples to README
Redesign integration test architecture to eliminate async/sync deadlock:
- Run SimulationServer in dedicated background thread with own event loop
- Rewrite TempCo tests as fully synchronous (no @pytest.mark.asyncio)
- Add ServerThread fixture in tests/integration/conftest.py
- Fix Unicode encoding errors (replace deg, mu, +/- with ASCII)
- Optimize temperature points for faster settling (23C, 25C, 27C)
All 3 TempCo integration tests now passing in ~5 minutes total.
- Revert server to only send responses for non-empty strings
Per SCPI protocol: successful commands with no output send nothing
- Add TEMP:RAMP command support to thermal chamber simulator
- Fixes test_multiple_commands and test_physics_engine_integration
TCP server integration tests now passing (8/8).
TempCo integration tests still need work due to async/sync mixing.
- Always send a response (even empty) to prevent client timeouts
- Add pandas-stubs to dev dependencies for mypy type checking
- Server now sends newline-terminated response for all commands
This fixes the mypy CI failure. Integration test failures still need
investigation - likely due to event loop blocking when mixing sync/async.