Improve parameter scaling / offset - #8451
Merged
Jens Hedegaard Nielsen (jenshnielsen) merged 4 commits intoAug 27, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8451 +/- ##
==========================================
+ Coverage 71.14% 71.15% +0.01%
==========================================
Files 305 305
Lines 31960 31976 +16
==========================================
+ Hits 22737 22753 +16
Misses 9223 9223 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Multiplying a sequence by a number repeats it rather than scaling its elements, so setting a parameter to a list with a scalar scale silently set a repeated raw value, and a scalar offset raised a TypeError. The get path already falls back on element wise arithmetic; do the same on the set path so that sequences round trip. See microsoft#8450 for the remaining silent truncation on length mismatch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e8c5964a-6418-4d35-b69c-bb44dd727a3c
Zipping the value with an iterable scale or offset silently dropped the extra elements when their lengths differed. Apply the conversions via a shared helper that zips strictly and reports the two lengths, so that a mismatch is an error rather than a shorter value. Closes microsoft#8450 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e8c5964a-6418-4d35-b69c-bb44dd727a3c
Jens Hedegaard Nielsen (jenshnielsen)
force-pushed
the
parameter_list_testing
branch
from
August 27, 2026 08:34
077bae3 to
50b073a
Compare
Both the scalar scale/offset sequence fix and the scale/offset length mismatch ValueError are potentially breaking, so combine them into one breaking newsfragment. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4dac2652-68f4-41a7-8e96-7c8130b845f0
Jens Hedegaard Nielsen (jenshnielsen)
marked this pull request as ready for review
August 27, 2026 09:15
Jens Hedegaard Nielsen (jenshnielsen)
requested a review
from a team
as a code owner
August 27, 2026 09:15
esben (esbenh4)
approved these changes
Aug 27, 2026
Rather than passing an explicit kind argument to _apply_elementwise, map the arithmetic operator to the name used in the error message. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 08b47f6f-0b50-41ff-842b-ff42bbef4a0f
Jens Hedegaard Nielsen (jenshnielsen)
enabled auto-merge
August 27, 2026 09:39
Jens Hedegaard Nielsen (jenshnielsen)
deleted the
parameter_list_testing
branch
August 27, 2026 10:50
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.
Closes #8450