Skip to content
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

Add Network area model support #840

Merged
merged 22 commits into from
Oct 22, 2024
Merged

Add Network area model support #840

merged 22 commits into from
Oct 22, 2024

Conversation

jeandemanged
Copy link
Member

@jeandemanged jeandemanged commented Sep 22, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

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?

No area support

What is the new behavior (if this is a feature change)?
Add area support (starting from PowSyBl 2024.2.0 / powsybl-core 6.4.x), see:

Implementation followup:

  • areas
    • get -> network.get_areas()
    • update -> network.update_areas(...)
    • create -> network.create_areas(...)
    • remove -> network.remove_elements(...)
  • areas voltage levels
    • network.get_areas_voltage_levels(...)
    • network.create_areas_voltage_levels(...)
  • areas boundaries
    • network.get_areas_boundaries(...)
    • network.create_areas_boundaries(...)

Does this PR introduce a breaking change or deprecate an API?

  • No

Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
@jeandemanged jeandemanged changed the title [WIP] Add area model support [WIP] Add Network area model support Sep 23, 2024
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
@jeandemanged jeandemanged mentioned this pull request Sep 24, 2024
5 tasks
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
@jeandemanged
Copy link
Member Author

works but not so happy with having to always redefine all voltagelevels or boundaries on creation, will try to think about something better

Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
@jeandemanged jeandemanged changed the title [WIP] Add Network area model support Add Network area model support Oct 13, 2024
@jeandemanged jeandemanged self-assigned this Oct 13, 2024
Comment on lines 630 to 633
AREA_ADD_VOLTAGE_LEVELS,
AREA_REMOVE_VOLTAGE_LEVELS,
AREA_ADD_BOUNDARIES,
AREA_REMOVE_BOUNDARIES;
Copy link
Member Author

Choose a reason for hiding this comment

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

this is quite tweaking the ElementType concept ... please let me know if this is OK of if must be done differently...

Copy link
Member

Choose a reason for hiding this comment

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

Nok for me, this is really not the purpose of the dataframes. Dataframes contains some data, not operations, and this is the way we use data (though a creation, modif or read method) that we express the operation.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes it was a failed attempt at solving #840 (comment), but thinking about it, we don't redefine areas that often, so I reverted to something simpler

Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
# Conflicts:
#	java/src/main/java/com/powsybl/dataframe/network/adders/NetworkUtils.java
#	java/src/test/java/com/powsybl/dataframe/network/NetworkDataframesTest.java
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
# Conflicts:
#	java/src/test/java/com/powsybl/dataframe/network/NetworkDataframesTest.java
#	java/src/test/java/com/powsybl/dataframe/network/adders/NetworkElementAddersTest.java
def get_areas(self, all_attributes: bool = False, attributes: List[str] = None,
**kwargs: ArrayLike) -> DataFrame:
r"""
Get a dataframe of areas.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be a good idea to add something like : "To retrieve the voltage levels of the areas or their boundaries see get_areas_voltage_levels and get_areas_boundaries" to have an easier full picture when browsing the documentation

Copy link
Member Author

Choose a reason for hiding this comment

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

good point, done

Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
Copy link

Copy link

@HugoKulesza HugoKulesza merged commit 46a8cf5 into main Oct 22, 2024
8 checks passed
@HugoKulesza HugoKulesza deleted the area-support branch October 22, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants