Skip to content

demo: use ControllerVector for temperature ramp sub-controllers#409

Open
coretl wants to merge 2 commits into
refactorfrom
refactor-issue-390
Open

demo: use ControllerVector for temperature ramp sub-controllers#409
coretl wants to merge 2 commits into
refactorfrom
refactor-issue-390

Conversation

@coretl

@coretl coretl commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Closes #390

Evolves src/fastcs/demo/controllers.py's composition example onto the documented ControllerVector pattern (see docs/explanations/controllers.md) instead of a manual list + add_sub_controller loop, and adds unit tests exercising cancel_all and the voltage-distributing @scan against a mocked IPConnection.

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:

  1. uv run pytest tests/demo/test_controllers.py -v
  2. Confirm the temperature controller demo still runs against the sim (python -m fastcs.demo run src/fastcs/demo/fastcs.yaml)

Checks for reviewer

  • Would the PR title make sense to a user on a set of release notes

Notes

  • Verified locally with uv run --locked tox -e pre-commit,type-checking,tests. pre-commit and type-checking pass. In the sandbox this ran in, the tests env's plain pytest collection also picks up docs/conf.py (needs outbound network) and tests/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/benchmarking passes 310/320 with only PVA (p4p) IOC tests failing on RuntimeError: Address family not supported by protocol — the same known sandbox limitation. Real CI covers these.

Generated by Claude Code

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
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bf3e1a07-a804-45ea-b95e-11aa7502ab8c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor-issue-390

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.25%. Comparing base (3da025f) to head (1932e5e).
⚠️ Report is 1 commits behind head on refactor.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/fastcs/demo/controllers.py Outdated
@coretl
coretl requested a review from shihab-dls July 23, 2026 12:07
Address review comment: pyright already infers ControllerVector[TemperatureRampController]
from the dict literal, so the explicit annotation was redundant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants