Skip to content

[BugFix] fast_any_tap boundary handling boundary handling in binary search - #1632

Open
Jerry-Jinfeng-Guo wants to merge 1 commit into
mainfrom
pgm/bugfix/fast-any-tap-beyond-voltage-band-behavior
Open

Jerry-Jinfeng-Guo wants to merge 1 commit into
mainfrom
pgm/bugfix/fast-any-tap-beyond-voltage-band-behavior

Conversation

@Jerry-Jinfeng-Guo

Copy link
Copy Markdown
Member

Fixes #1215

The behaviour that lead to the original bug was due to us strictly limiting binary search to search between the upper bound and lower bounds. In cases where target voltage range lives outside such bounds, boundary taps should be considered.

Some other tests are also updated. Due to the nature of including a boundary, binary search will terminate at lower_bound == upper_bound and will not run all the way until max_iter reached. This will change the behaviour of the search wrt maximum iteration exceptions.

Arguably, if target range falls outside the achievable range, we return the closest tap without exception, the same should apply to small u_band.

Signed-off-by: Jerry Jinfeng Guo <jerry.jinfeng.guo@alliander.com>
@Jerry-Jinfeng-Guo Jerry-Jinfeng-Guo self-assigned this Oct 8, 2026
@Jerry-Jinfeng-Guo Jerry-Jinfeng-Guo added the bug Something isn't working label Oct 8, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pure binary search runs will not trigger max iteration error.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussion needed wrt behaviour.

@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] fast_any_tap incorrectly handles voltage bands outside the achievable voltage range

1 participant