-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor for easier testing #897
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: petersalemink95 <peter.salemink95@gmail.com>
Signed-off-by: petersalemink95 <peter.salemink95@gmail.com>
Signed-off-by: petersalemink95 <peter.salemink95@gmail.com>
Signed-off-by: petersalemink95 <peter.salemink95@gmail.com>
..._grid_model_c/power_grid_model/include/power_grid_model/optimizer/tap_position_optimizer.hpp
Outdated
Show resolved
Hide resolved
void iterate_ranks(auto const& regulator_order, auto adjust_transformer_in_rank, bool& tap_changed, | ||
std::vector<IntS>& iterations_per_rank, Idx& rank_index) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think it makes more sense to make iterations_per_rank
and rank_index
member variables (private + public constexpr
getters for testability)? The adjust_transformer_in_rank
can then be provided into the constructor, and tap_changed
can be an output parameter (just like it is for adjust_transformer_in_rank
). That way, you can also really test per iteration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get why we would do that
..._grid_model_c/power_grid_model/include/power_grid_model/optimizer/tap_position_optimizer.hpp
Outdated
Show resolved
Hide resolved
..._grid_model_c/power_grid_model/include/power_grid_model/optimizer/tap_position_optimizer.hpp
Show resolved
Hide resolved
..._grid_model_c/power_grid_model/include/power_grid_model/optimizer/tap_position_optimizer.hpp
Outdated
Show resolved
Hide resolved
Signed-off-by: petersalemink95 <peter.salemink95@gmail.com>
Signed-off-by: petersalemink95 <peter.salemink95@gmail.com>
Signed-off-by: petersalemink95 <peter.salemink95@gmail.com>
Signed-off-by: petersalemink95 <peter.salemink95@gmail.com>
Signed-off-by: petersalemink95 <peter.salemink95@gmail.com>
|
Signed-off-by: petersalemink95 <peter.salemink95@gmail.com>
This PR will not change behavior: only includes a refactor + additional tests