demo: use ControllerVector for temperature ramp sub-controllers#409
demo: use ControllerVector for temperature ramp sub-controllers#409coretl wants to merge 2 commits into
Conversation
Evolve the demo temperature controller composition example onto the documented ControllerVector pattern instead of a manual list + add_sub_controller loop, and add unit tests exercising cancel_all and the voltage-distributing scan against a mocked IPConnection. Closes #390
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #409 +/- ##
=========================================
Coverage 91.25% 91.25%
=========================================
Files 72 72
Lines 2892 2892
=========================================
Hits 2639 2639
Misses 253 253 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Address review comment: pyright already infers ControllerVector[TemperatureRampController] from the dict literal, so the explicit annotation was redundant.
Closes #390
Evolves
src/fastcs/demo/controllers.py's composition example onto the documentedControllerVectorpattern (seedocs/explanations/controllers.md) instead of a manuallist+add_sub_controllerloop, and adds unit tests exercisingcancel_alland the voltage-distributing@scanagainst a mockedIPConnection.This is the current-API baseline described in the issue (
Float(...),io_ref=...); the getter/setter cleanup lands separately when #392 lands.Instructions to reviewer on how to test:
uv run pytest tests/demo/test_controllers.py -vpython -m fastcs.demo run src/fastcs/demo/fastcs.yaml)Checks for reviewer
Notes
uv run --locked tox -e pre-commit,type-checking,tests.pre-commitandtype-checkingpass. In the sandbox this ran in, thetestsenv's plainpytestcollection also picks updocs/conf.py(needs outbound network) andtests/benchmarking(needs a PVA-capable socket family), both of which fail to even collect for reasons unrelated to this change. Excluding those two paths,pytest src tests --ignore=tests/benchmarkingpasses 310/320 with only PVA (p4p) IOC tests failing onRuntimeError: Address family not supported by protocol— the same known sandbox limitation. Real CI covers these.Generated by Claude Code