Cleanup main model: Clean all includes and make some components to be forward declared#1142
Cleanup main model: Clean all includes and make some components to be forward declared#1142nitbharambe wants to merge 29 commits intomainfrom
Conversation
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
|
I like the cleanup. Now I wonder, should we move In addition, can we also include |
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
|
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
figueroa1395
left a comment
There was a problem hiding this comment.
One additional thing is that perhaps #1142 (comment) is still relevant. Also, maybe triggering Copilot for review might be useful since missing things for a human due to the nature of this PR is very easy.
Rest looks good, just minor questions.
power_grid_model_c/power_grid_model/include/power_grid_model/common/three_phase_tensor.hpp
Show resolved
Hide resolved
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
tests/cpp_unit_tests/test_node.cpp
Outdated
| #include "power_grid_model/auxiliary/update.hpp" | ||
| #include <power_grid_model/common/common.hpp> | ||
| #include <power_grid_model/common/enum.hpp> | ||
| #include <power_grid_model/component/component.hpp> |
| #include "power_grid_model/auxiliary/input.hpp" | ||
| #include "power_grid_model/auxiliary/output.hpp" | ||
| #include "power_grid_model/auxiliary/update.hpp" | ||
| #include <power_grid_model/calculation_parameters.hpp> |
There was a problem hiding this comment.
consistency between "" and <> (please check all files)
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
|
figueroa1395
left a comment
There was a problem hiding this comment.
I'm a fan of this! I just left a couple remarks.
| #include "meta_data.hpp" | ||
|
|
||
| #include "../common/common.hpp" | ||
| #include "../common/counting_iterator.hpp" |
There was a problem hiding this comment.
As pointed out by the CI, add this via Jinja instead of directly editing here.
|
|
||
| #include "../common/common.hpp" | ||
| #include "../common/enum.hpp" |
| #include "power_grid_model_cpp/basics.hpp" | ||
| #include "power_grid_model_cpp/buffer.hpp" | ||
| #include "power_grid_model_cpp/dataset.hpp" | ||
| #include "power_grid_model_cpp/handle.hpp" | ||
| #include "power_grid_model_cpp/model.hpp" | ||
| #include "power_grid_model_cpp/serialization.hpp" |
|
|
||
| #include <doctest/doctest.h> | ||
|
|
||
| // NOLINTBEGIN(misc-include-cleaner) |
There was a problem hiding this comment.
I see many of these, probably related to nlohmann/json. Shouldn't we instead exclude it via misc-include-cleaner.IgnoreHeaders as we did with Eigen?
| ] | ||
| } | ||
| })json"s; | ||
| })json"s; // NOLINT(misc-include-cleaner) https://github.com/llvm/llvm-project/issues/98122 |
There was a problem hiding this comment.
These are annoying but I guess there is nothing else to do about them...
| auto const& attribute_name = MetaData::attribute_name(attribute_meta); | ||
| // TODO need a way for common angle: u angle skipped for now | ||
| if (attribute_name == "u_angle"s) { | ||
| if (attribute_name == "u_angle"s) { // NOLINT(misc-include-cleaner) |
There was a problem hiding this comment.
Missed adding github issue name there. Same as others. Its with operator s
| auto const& node = meta_map.get_component("node"); | ||
| auto const& node_attr = node.attributes; | ||
| CHECK(node_attr[0].name == "id"s); | ||
| CHECK(node_attr[0].name == "id"s); // NOLINT(misc-include-cleaner) |
There was a problem hiding this comment.
Why are these a problem here?
| #include <power_grid_model/common/exception.hpp> | ||
| #include <power_grid_model/common/grouped_index_vector.hpp> | ||
| #include <power_grid_model/common/three_phase_tensor.hpp> | ||
| #include <power_grid_model/math_solver/short_circuit_solver.hpp> // NOLINT(misc-include-cleaner) |
There was a problem hiding this comment.
Is it asking to directly import things called in the short circuit module? Or what's the issue?
| // SPDX-License-Identifier: MPL-2.0 | ||
|
|
||
| #include "test_math_solver_pf.hpp" | ||
| #include "test_math_solver_pf.hpp" // NOLINT(misc-include-cleaner) |
There was a problem hiding this comment.
I'm on board with this one and the other similar ones that are used in the template testing.
| #2: source: u_ref = 1.10, sym_load_3: -200 kW | ||
| */ | ||
|
|
||
| // NOLINTBEGIN(misc-include-cleaner) |
There was a problem hiding this comment.
There is no // NOLINTEND(misc-include-cleaner). Also, shouldn't we also be explicit like with the CPP API here? Why no lint here?
There was a problem hiding this comment.
Ahh, I put the end at the bottom. This file is completely ignored as it as an example.



Idea is to make components forward declared to reduce coupling.
This draft PR is created for gathering thoughts and requirements as of now.
Changes proposed in this PR include: