-
Couldn't load subscription status.
- Fork 44
Clean up main model: migrate out "prepare calculation" related stuff #1168
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Santiago Figueroa Manrique <[email protected]>
Signed-off-by: Santiago Figueroa Manrique <[email protected]>
Signed-off-by: Santiago Figueroa Manrique <[email protected]>
Signed-off-by: Santiago Figueroa Manrique <[email protected]>
Signed-off-by: Santiago Figueroa Manrique <[email protected]>
Signed-off-by: Santiago Figueroa Manrique <[email protected]>
power_grid_model_c/power_grid_model/include/power_grid_model/main_model_impl.hpp
Show resolved
Hide resolved
power_grid_model_c/power_grid_model/include/power_grid_model/main_model_impl.hpp
Outdated
Show resolved
Hide resolved
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.
This is a global review, not an in-depth one. Awesome cleanup!
power_grid_model_c/power_grid_model/include/power_grid_model/main_model_impl.hpp
Outdated
Show resolved
Hide resolved
| : system_frequency_{system_frequency}, | ||
| meta_data_{&input_data.meta_data()}, | ||
| math_solver_dispatcher_{&math_solver_dispatcher} { | ||
| solver_preparation_context_{.math_solver_dispatcher = &math_solver_dispatcher} { |
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.
This construction can IMO go to MainModel instead of MainModelImpl just like JobDispatcher
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 addressed this in 66e5449. There are now some additional dependencies to prepare_calculate.hpp which I'm not a fan of, but I suppose that should be fine because it's only temporal until we really get rid of MainModelImpl. Thoughts?
| namespace power_grid_model { | ||
| struct SolverPreparationContext { | ||
| main_core::MathState math_state; | ||
| Idx n_math_solvers{0}; |
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.
Is it required to keep n_math_solvers?
Is it ever not equivalent to math_state.topology.size()?
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 removed it (in 4f0d589) in favor of a helper function that does the calling from state.math_topology.size() indeed. It should be fine and
assert(n_math_solvers == static_cast<Idx>(main_core::get_y_bus<sym>(solver_context.math_state).size()));|
still remains as a sanity check.
Let me know what you think.
Signed-off-by: Santiago Figueroa Manrique <[email protected]>
Signed-off-by: Santiago Figueroa Manrique <[email protected]>
|



This is an experimentation PR aimed to remove all the stuff related to preparing the calculation/solvers out of the main model. This PR should be an enabler to unit test the touched logic more easily, keep trimming the main model, and get it ready to remove everything related to the calculation logic in a followup.
At this stage I'm gathering input. I will address and update accordingly.