Make Parameter cache.set_from_raw_value public - #8484
Open
Mikhail Astafev (astafan8) wants to merge 2 commits into
Open
Make Parameter cache.set_from_raw_value public#8484Mikhail Astafev (astafan8) wants to merge 2 commits into
Mikhail Astafev (astafan8) wants to merge 2 commits into
Conversation
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 Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
Mikhail Astafev (astafan8)
marked this pull request as ready for review
September 11, 2026 12:43
Mikhail Astafev (astafan8)
enabled auto-merge
September 11, 2026 14:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (applyingget_parser/scale/offset/val_mapping) — only existed as the private_set_from_raw_value, despite being driver-facing (the in-treeDynaCooldriver 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_valueas a backwards-compatible alias, updates in-tree callers, and adds tests + a newsfragment. No behaviour change.