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

Adding dangling line's generation part mapping #821

Merged
merged 19 commits into from
Nov 20, 2024
Merged

Conversation

HugoKulesza
Copy link
Collaborator

update when no generation created to do

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?

Fixing #793

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

  • Yes
  • No

update when no generation created to do

Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com>
Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com>
Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com>
@jeandemanged jeandemanged linked an issue Sep 23, 2024 that may be closed by this pull request
@HugoKulesza HugoKulesza changed the title Adding dangling line's generation part mapping to dangling line dataframe [WIP] Adding dangling line's generation part mapping to dangling line dataframe Sep 25, 2024
Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com>
This reverts commit a6a2dd0.

Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com>
Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com>
Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com>
Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com>
Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com>
Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com>
Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com>
HugoKulesza and others added 3 commits November 13, 2024 16:15
Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com>
Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com>
@HugoKulesza HugoKulesza changed the title [WIP] Adding dangling line's generation part mapping to dangling line dataframe Adding dangling line's generation part mapping Nov 13, 2024
@HugoKulesza HugoKulesza requested a review from geofjamg November 13, 2024 15:45
HugoKulesza and others added 2 commits November 14, 2024 09:23
Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com>
…/pypowsybl into dangling-line-generation

Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com>
@@ -28,6 +28,7 @@

import static com.powsybl.dataframe.MappingUtils.*;
import static com.powsybl.dataframe.network.PerUnitUtil.*;
import static java.lang.Double.NaN;
Copy link
Member

Choose a reason for hiding this comment

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

Could we avoid this useless change ?

@@ -1244,14 +1244,20 @@ def get_dangling_lines(self, all_attributes: bool = False, attributes: List[str]
- **ucte-xnode-code**: deprecated for pairing key.
- **paired**: if the dangling line is paired with a tie line
- **tie_line_id**: the ID of the tie line if the dangling line is paired
- **min_p** (optional): Minimum active power output of the dangling line's generation part
Copy link
Member

Choose a reason for hiding this comment

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

To revert ?

@@ -1293,6 +1299,35 @@ def get_dangling_lines(self, all_attributes: bool = False, attributes: List[str]
"""
return self.get_elements(ElementType.DANGLING_LINE, all_attributes, attributes, **kwargs)

def get_dangling_lines_generation(self, all_attributes: bool = False, attributes: List[str] = None,
Copy link
Member

Choose a reason for hiding this comment

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

what is the purpose of **kwargs ?

@@ -3939,17 +4007,18 @@ def create_batteries(self, df: DataFrame = None, **kwargs: ArrayLike) -> None:
"""
return self._create_elements(ElementType.BATTERY, [df], **kwargs)

def create_dangling_lines(self, df: DataFrame = None, **kwargs: ArrayLike) -> None:
def create_dangling_lines(self, df: DataFrame = None, generation_df: DataFrame = pd.DataFrame(), **kwargs: ArrayLike) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

Is **kwargs stil working for example to pass the dangling base attributes inline and the generation part with generation_df ?

n.create_dangling_line(id='X', r=3.4, ..., generation_df=...)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, the tests use create_dangling_lines this way to verify it still works.
On the other end, data for generation_df cannot be passed using kwargs

HugoKulesza and others added 2 commits November 20, 2024 10:51
Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com>
Copy link

sonarcloud bot commented Nov 20, 2024

Copy link

sonarcloud bot commented Nov 20, 2024

@geofjamg geofjamg merged commit 6d78722 into main Nov 20, 2024
8 checks passed
@geofjamg geofjamg deleted the dangling-line-generation branch November 20, 2024 16:08
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.

Optional dangling line generation part
2 participants