-
Notifications
You must be signed in to change notification settings - Fork 12
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
[WIP] Fixed layout type for NAD #918
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Christian Biasuzzi <[email protected]>
Signed-off-by: Christian Biasuzzi <[email protected]>
…instead of using the constructor which already reached the maximum allowed number of parameters Signed-off-by: Christian Biasuzzi <[email protected]>
Quality Gate passed for 'pypowsybl'Issues Measures |
Quality Gate passed for 'pypowsybl'Issues Measures |
@@ -369,6 +369,7 @@ typedef struct nad_parameters_struct { | |||
int scaling_factor; | |||
double radius_factor; | |||
int edge_info_displayed; | |||
char* metadata; |
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.
we'd rather put a fixed_positions parameter in get_network_area_diagram, together with an extract_positions utility method which would link to DiagramMetadata::getFixedPositions and DiagramMetadata::getFixedTextPositions.
@@ -613,7 +613,8 @@ PYBIND11_MODULE(_pypowsybl, m) { | |||
|
|||
py::enum_<pypowsybl::NadLayoutType>(m, "NadLayoutType") | |||
.value("FORCE_LAYOUT", pypowsybl::NadLayoutType::FORCE_LAYOUT) | |||
.value("GEOGRAPHICAL", pypowsybl::NadLayoutType::GEOGRAPHICAL); | |||
.value("GEOGRAPHICAL", pypowsybl::NadLayoutType::GEOGRAPHICAL) | |||
.value("FIXED", pypowsybl::NadLayoutType::FIXED); |
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.
Not really fond of having a "fixed" layout, knowing that the voltage levels with no position would be layout based on the force layout.
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
no
What kind of change does this PR introduce?
feature
What is the current behavior?
What is the new behavior (if this is a feature change)?
Adds a FIXED type to the NadLayoutType list, to be able to generate a NAD with a fixed layout (through the powsybl-diagram's FixedLayout implementation). The NAD's fixed positions, encoded as JSON metadata (e.g., as a result of a previously computed NAD), can be specified in a new NadParameters' parameter 'metadata'. Diagram elements' positions that are not listed in the JSON metadata will be computed using the Force Layout.
Does this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
Other information:
Note that prerequisite to this PR is the powsybl-diagram's powsybl/powsybl-diagram#656Note that this PR uses powsybl-diagram's APIs available in v4.7.0: the pom.xml is changed temporarily to force that version.Note: comments to this PR suggested a different, scaled-down, approach. Please see PR #928