Skip to content

Make Parameter cache.set_from_raw_value public - #8484

Open
Mikhail Astafev (astafan8) wants to merge 2 commits into
microsoft:mainfrom
astafan8:public-set-from-raw-value
Open

Make Parameter cache.set_from_raw_value public#8484
Mikhail Astafev (astafan8) wants to merge 2 commits into
microsoft:mainfrom
astafan8:public-set-from-raw-value

Conversation

@astafan8

@astafan8 Mikhail Astafev (astafan8) commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

cache.set(value) populates a parameter's cache from a user/scaled value. Its raw-side counterpart — setting the cache from a value as reported by the instrument (applying get_parser/scale/offset/val_mapping) — only existed as the private _set_from_raw_value, despite being driver-facing (the in-tree DynaCool driver already uses it, and it's handy for populating many caches from one bulk reply). I found no recorded reason for it being private.

This PR makes it public as Parameter.cache.set_from_raw_value(), keeps _set_from_raw_value as a backwards-compatible alias, updates in-tree callers, and adds tests + a newsfragment. No behaviour change.

Mikhail Astafev and others added 2 commits September 11, 2026 11:35
cache.set(value) sets the cache from a value on the user/scaled side of a parameter. The counterpart that sets the cache from a raw value as reported by the instrument (applying get_parser/scale/offset/val_mapping) only existed as the private _Cache._set_from_raw_value, even though it is a genuinely useful, driver-facing operation - it is already used by an in-tree driver (DynaCool) and is handy for drivers that populate many parameter caches from a single bulk status reply.

Promote it to a public set_from_raw_value method on _Cache, the _CacheProtocol and the DelegateParameter cache, with a docstring. Keep _set_from_raw_value as a thin backwards-compatible alias and update the in-tree callers (Parameter, GroupParameter, DynaCool) to the public name.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.16%. Comparing base (75b9f30) to head (e70cee7).

Files with missing lines Patch % Lines
...ent_drivers/QuantumDesign/DynaCoolPPMS/DynaCool.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8484   +/-   ##
=======================================
  Coverage   71.15%   71.16%           
=======================================
  Files         305      305           
  Lines       31976    31980    +4     
=======================================
+ Hits        22753    22757    +4     
  Misses       9223     9223           

☔ 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.

@astafan8
Mikhail Astafev (astafan8) marked this pull request as ready for review September 11, 2026 12:43
@astafan8
Mikhail Astafev (astafan8) requested a review from a team as a code owner September 11, 2026 12:43
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.

1 participant