Commit Graph
100 Commits
Author SHA1 Message Date
kschappell b7663d5a31 Add idle auto-shutdown for self-hosted deployment
- 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
2026-01-29 21:08:17 +00:00
kschappell 6830b3158c Fix mypy type errors in reporting module 2026-01-29 18:06:13 +00:00
kschappell c016320b71 Update CHANGELOG with report generation feature 2026-01-29 18:03:39 +00:00
kschappell a5a2cf2473 Add report generation integration test 2026-01-29 18:03:23 +00:00
kschappell 13a4fd16b3 Add reporting unit tests 2026-01-29 18:02:47 +00:00
kschappell 349663b4e1 Add PDF download button to dashboard 2026-01-29 18:01:22 +00:00
kschappell 2b92865745 Add export-report CLI command 2026-01-29 18:01:01 +00:00
kschappell 022223af76 Add list-runs CLI command 2026-01-29 18:00:37 +00:00
kschappell bff13cd616 Add reporting configuration to default.yaml 2026-01-29 18:00:19 +00:00
kschappell 59a5bc1124 Add ReportingConfig to application config 2026-01-29 18:00:04 +00:00
kschappell 32daff69be Update reporting module public API 2026-01-29 17:59:45 +00:00
kschappell d76e610070 Implement ReportGenerator class 2026-01-29 17:59:27 +00:00
kschappell 50432eaa3d Implement matplotlib chart generator 2026-01-29 17:59:01 +00:00
kschappell 3b136dca69 Implement PDF renderer with WeasyPrint 2026-01-29 17:58:23 +00:00
kschappell 5405ceec7f Implement HTML renderer with Jinja2 2026-01-29 17:58:02 +00:00
kschappell 01d8295512 Add test report HTML template 2026-01-29 17:57:36 +00:00
kschappell 3a8e6becf1 Add base HTML report template 2026-01-29 17:57:15 +00:00
kschappell af3116a025 Add professional CSS stylesheet for reports 2026-01-29 17:57:04 +00:00
kschappell f7f2839e65 Add reporting exception classes 2026-01-29 17:56:29 +00:00
kschappell 5fdb1e6eaf Add report data models 2026-01-29 17:56:15 +00:00
kschappell ca7655704e Add matplotlib to reports dependencies 2026-01-29 17:55:55 +00:00
kschappell ba2ab9d5d8 Release v0.1.0
CI / Release (push) Has been cancelled
CI / Lint (push) Successful in 4s
CI / Type Check (push) Successful in 19s
CI / Test (push) Successful in 37s
2025-12-04 13:18:17 +00:00
kschappell 64be5dacbf Fix Windows file locking in repository tests 2025-11-16 20:13:43 +00:00
kschappell a28752fc5b Polish dashboard UX and update README
- 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
2025-11-15 13:18:38 +00:00
kschappell 5152f85c8e Fix dashboard: connect instruments on startup, remove broken reset, apply controls properly 2025-11-09 15:56:06 +00:00
kschappell bd0071e88f Fix: auto-start charts and remove ScriptRunContext warning from background thread 2025-11-07 22:06:56 +00:00
kschappell 400f97e9fb Fix server initialization race condition with proper event signaling 2025-11-06 09:52:35 +00:00
kschappell cae52c1fa8 Improve dashboard UX: connect instruments before tests, clarify simulation controls, show error messages 2025-11-01 19:51:41 +00:00
kschappell 7c89cebf0b Fix dashboard database initialization using temp file instead of in-memory 2025-10-27 17:34:45 +00:00
kschappell 5d185815d0 Add end-to-end integration test 2025-10-23 21:23:18 +00:00
kschappell 9cf42112a6 Add results viewer dashboard page 2025-10-22 13:22:56 +00:00
kschappell ed5362e712 Add test execution dashboard page 2025-10-17 11:13:32 +00:00
kschappell d1170b7db7 Update dashboard to use HAL 2025-10-14 09:39:36 +00:00
kschappell 42356efce2 Fix TempCo integration tests with thread-based async server
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.
2025-10-12 17:59:48 +00:00
kschappell 3fdaba500d Fix SCPI server response handling and add TEMP:RAMP command
- 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.
2025-10-09 15:25:08 +00:00
kschappell a0d096512f WIP: Use thread pool executor for integration tests
Move synchronous test execution to thread pool executor to avoid
blocking the async event loop. This prevents deadlocks when sync
client code tries to communicate with async server in same loop.

Note: Integration tests still experiencing timeouts - needs further
investigation. Unit tests and TCP server communication are working.
2025-10-08 16:16:13 +00:00
kschappell 1f42098b6e Fix TCP server response handling and add pandas-stubs
- 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.
2025-10-01 17:37:36 +00:00
kschappell 7093446783 Fix CI errors: linting, type checking, and tests
- Fix import sorting in test_instruments.py (ruff I001)
- Install pandas-stubs for mypy type checking
- Add garbage collection cleanup to repository test fixtures
- Prevent Windows file locking errors in tempfile cleanup

All CI checks now passing: lint, type check, and all 244 tests.
2025-09-29 18:02:39 +00:00
kschappell 22be547e47 Add instrument CLI commands 2025-09-26 17:56:36 +00:00
kschappell 825af0b3bd Add test execution CLI commands 2025-09-22 13:32:05 +00:00
kschappell 2e62a10550 Release v0.1.0-beta.2
CI / Lint (push) Failing after 4s
CI / Type Check (push) Successful in 18s
CI / Test (push) Failing after 20s
CI / Release (push) Has been cancelled
2025-09-22 11:04:43 +00:00
kschappell d07e6e3f1a Add TempCo integration tests 2025-09-16 11:20:03 +00:00
kschappell 96eb83cec4 Implement TempCo characterisation test 2025-09-15 18:32:58 +00:00
kschappell 027fd71505 Add DVT test base class 2025-09-10 16:03:37 +00:00
kschappell 3310e86fae Implement test runner 2025-09-09 19:31:09 +00:00
kschappell e42de212f2 Implement limit checker 2025-09-05 15:44:46 +00:00
kschappell ee8d148eb7 Implement test logger 2025-08-31 17:24:16 +00:00
kschappell e379b7e432 Add test framework models 2025-08-28 21:57:03 +00:00
kschappell eaa1843ee1 Add data persistence tests 2025-08-25 14:31:30 +00:00
kschappell 7429f6433c Add Parquet measurement storage 2025-08-20 23:59:48 +00:00
kschappell 7cfd36f02b Implement SQLite repository 2025-08-17 20:54:35 +00:00
kschappell f5600efd76 Add data persistence models 2025-08-17 11:34:53 +00:00
kschappell 0615eb7e07 Add configuration tests 2025-08-14 15:59:04 +00:00
kschappell b981182b71 Add default configuration file 2025-08-11 13:11:17 +00:00
kschappell 8c0d68e722 Implement configuration loader 2025-08-05 15:12:34 +00:00
kschappell 4e14222522 Add configuration Pydantic models 2025-08-01 17:46:03 +00:00
kschappell afa52e7ee2 Release v0.1.0-beta.1
CI / Lint (push) Failing after 4s
CI / Type Check (push) Successful in 18s
CI / Test (push) Successful in 10s
CI / Release (push) Has been cancelled
2025-08-01 11:46:21 +00:00
kschappell a951413a62 Add instrument interface tests 2025-07-26 20:12:06 +00:00
kschappell 0b58f7e863 Add instrument factory 2025-07-26 19:22:27 +00:00
kschappell a8bd132269 Implement instrument interfaces in drivers 2025-07-24 18:15:50 +00:00
kschappell 0a8d7e5c69 Add instrument interface protocols 2025-07-19 14:08:46 +00:00
kschappell ece1803c10 Fix linting: use builtin OSError and TimeoutError instead of socket aliases 2025-07-15 11:15:17 +00:00
kschappell 76d81b21e6 Add driver unit tests 2025-07-10 15:57:02 +00:00
kschappell 4db50421b3 Add PSU and DMM drivers 2025-07-08 09:45:40 +00:00
kschappell 10e1da198e Add thermal chamber driver 2025-07-04 18:14:37 +00:00
kschappell 8fe97047d1 Add driver base class 2025-06-30 15:04:21 +00:00
kschappell 1f00210b63 Refactor DUTModel from Protocol to ABC for explicit interface implementation 2025-06-29 17:33:28 +00:00
kschappell 95961cd26f Refactor Transport from Protocol to ABC for explicit interface implementation 2025-06-25 19:25:42 +00:00
kschappell fe208b0c04 Update specification to mandate ABC over Protocol for maximum type safety 2025-06-24 23:59:34 +00:00
kschappell d38c40d52d Add transport layer tests 2025-06-19 15:55:38 +00:00
kschappell 936ed5a279 Implement TCP transport 2025-06-16 13:30:35 +00:00
kschappell 284793df69 Add transport protocol definition 2025-06-14 20:48:34 +00:00
kschappell e38f514153 Fix linting and type errors for CI
- Use X | None syntax instead of Optional[X] (UP045)
- Sort imports in dashboard app (I001)
- Remove unnecessary UTF-8 encoding argument (UP012)
- Add 'from err' to exception re-raises (B904)
- Remove unused imports in integration tests (F401)
- Fix useless expression in test (B018)
- Cast **1.5 result to float in LDO model (mypy no-any-return)
- Use functools.partial instead of lambda in server (mypy misc)
2025-06-12 22:05:46 +00:00
kschappell cfe8dab7a8 Move InstrumentServer to instruments/transport
InstrumentServer is a general-purpose SCPI-over-TCP server that can
host any device implementing the SCPIDevice protocol (process method).
Moving it from simulation/ to instruments/transport/ reflects this:
- simulation package now depends on instruments package
- InstrumentServer can host both virtual and real instrument adapters
- Added SCPIDevice Protocol for type-safe device registration
2025-06-07 15:15:56 +00:00
kschappell 9e9c0ae0e5 Release v0.1.0-alpha.3
CI / Lint (push) Failing after 4s
CI / Type Check (push) Failing after 17s
CI / Test (push) Successful in 9s
CI / Release (push) Has been cancelled
2025-06-02 22:56:53 +00:00
kschappell a742d57a6f Add TCP server integration tests
Test connection handling, multiple clients, instrument access across
all three virtual instruments, physics engine integration, and error
handling. Update pytest-asyncio config for v1.x compatibility.
2025-05-30 22:59:33 +00:00
kschappell 2d358062f4 Add simulation server entry point
Create SimulationServer that wires physics engine to all virtual
instruments and exposes them over TCP. Add 'serve' CLI command to
start the server with configurable ports and physics rate.
2025-05-30 19:31:01 +00:00
kschappell 1a489b9106 Implement TCP client handling
Add async client connection handling with:
- Multiple concurrent connections per port
- Line-based SCPI protocol (newline terminated)
- start(), stop(), and serve_forever() methods
- Proper connection lifecycle and error handling
2025-05-24 13:48:10 +00:00
kschappell f9e59da32b Add async TCP server foundation
Create InstrumentServer class with asyncio for hosting virtual SCPI
instruments over TCP. Supports registering instruments on specific
ports with port-to-instrument mapping.
2025-05-22 21:32:38 +00:00
kschappell a4c01c856d Add multimeter simulator tests
Comprehensive test coverage for MultimeterSim including MEAS:VOLT:DC,
MEAS:CURR:DC, CONF, and READ commands. Tests both standalone operation
and physics engine integration including temperature-dependent measurements.
2025-05-21 22:55:40 +00:00
kschappell 144e80f87a Add multimeter simulator
Implement SCPI-based virtual DMM with DC voltage and current measurement.
Supports MEAS, CONF, and READ commands. Integrates with physics engine
for DUT output measurements.
2025-05-16 23:48:11 +00:00
kschappell e811b21082 Add power supply simulator tests
Comprehensive test coverage for PowerSupplySim including VOLT, CURR,
OUTP, and MEAS commands. Tests both standalone operation and physics
engine integration.
2025-05-12 17:29:00 +00:00
kschappell 9a88a35cc5 Add power supply simulator
Implement SCPI-based virtual power supply with voltage/current control
and output enable commands. Integrates with physics engine for DUT
input voltage simulation.
2025-05-09 20:21:07 +00:00
kschappell b31324a42a Add thermal chamber simulator tests
Tests for ThermalChamberSim SCPI command responses:
- Basic IEEE 488.2 commands (*IDN?, *RST, *OPC?)
- TEMP:SETPOINT set/query
- TEMP:ACTUAL? query
- TEMP:STAB? stability query
- Physics engine integration tests
2025-05-05 21:00:43 +00:00
kschappell 008134844d Implement thermal chamber SCPI commands
- TEMP:SETPOINT: Set/query target temperature
- TEMP:ACTUAL?: Query actual chamber temperature from physics engine
- TEMP:STAB?: Query temperature stability (within 0.5°C threshold)
2025-05-04 19:34:48 +00:00
kschappell ae85948539 Add thermal chamber simulator stub
Defines ThermalChamberSim class with stub SCPI command handlers for
TEMP:SETPOINT, TEMP:ACTUAL?, and TEMP:STAB? commands.
2025-05-02 23:33:16 +00:00
kschappell bccb8cc420 Add base instrument class
Provides SCPI command parsing and dispatch mechanism for virtual
instruments. Includes IEEE 488.2 common commands (*IDN?, *RST, *CLS,
*OPC) and abstract methods for instrument-specific implementations.
2025-04-28 19:24:24 +00:00
kschappell 510e1ba683 Add SCPI parser tests
Comprehensive test suite for SCPI command parsing:
- SCPICommand dataclass tests (creation, keyword property)
- Parser tests for queries, commands, arguments
- IEEE 488.2 common command tests (*IDN?, *RST, etc.)
- Edge cases (whitespace, empty strings)
- Instrument-specific command tests

Also fixed bug where is_query was determined from command string
ending rather than header ending (handles queries with arguments).
2025-04-21 13:10:50 +00:00
kschappell 5e69085875 Implement SCPI parser
Adds SCPIParser class with parse() method that handles:
- IEEE 488.2 common commands (*IDN?, *RST, etc.)
- Query commands (ending with '?')
- Commands with comma-separated arguments
- Whitespace stripping
2025-04-21 12:03:55 +00:00
kschappell 5053399851 Add SCPI command dataclass
Defines SCPICommand dataclass for parsed SCPI commands with:
- header: command header (e.g., "TEMP:SETPOINT")
- arguments: list of command arguments
- is_query: whether command is a query
- keyword property: header without trailing '?'
2025-04-16 23:08:32 +00:00
kschappell d54ada18b2 Remove fragment from sidebar controls (not supported)
Sidebar controls cannot be in a fragment. Brief blank on
slider change is a Streamlit limitation.
2025-04-15 21:25:23 +00:00
kschappell 252c329562 Put sidebar controls in fragment to prevent page blanking
Both controls and display are now fragments, so slider
changes don't trigger full page reruns.
2025-04-13 18:47:37 +00:00
kschappell 6e7da7f382 Use st.fragment for smooth dashboard updates
Replace st.rerun() with @st.fragment decorator to prevent
full page reloads and eliminate UI greying out.
2025-04-08 13:08:15 +00:00
kschappell 75e0a1cc25 Fix dashboard simulation speed with time multiplier
- Add time multiplier control (1× to 100× speed)
- Calculate steps based on real elapsed time
- Add 50ms delay to prevent UI thrashing
- Display current speed in Sim Time metric
2025-04-05 17:58:41 +00:00
kschappell 1c0d2ead54 Release v0.1.0-alpha.2
CI / Test (push) Successful in 9s
CI / Release (push) Has been cancelled
CI / Lint (push) Failing after 4s
CI / Type Check (push) Failing after 17s
2025-04-03 21:20:13 +00:00
kschappell 2b78a75f51 Add self-heating visualisation 2025-03-29 17:04:13 +00:00
kschappell 15c9033153 Add interactive physics controls 2025-03-24 15:02:51 +00:00
kschappell 0ab1181ec4 Add physics visualisation panel 2025-03-24 14:20:53 +00:00
kschappell bb3129e69b Add Streamlit dashboard skeleton 2025-03-18 14:24:17 +00:00
kschappell 14858a087c Release v0.1.0-alpha.1
CI / Release (push) Has been cancelled
CI / Lint (push) Failing after 4s
CI / Type Check (push) Failing after 7s
CI / Test (push) Successful in 8s
Physics engine working milestone:
- Thermal-electrical coupling simulation
- LDO DUT model with temperature dependence
- Comprehensive test suite
2025-03-14 19:10:34 +00:00