-
Notifications
You must be signed in to change notification settings - Fork 17
Integrating powsybl-dependencies 2025.3.0 and powsybl-optimizer 0.16.0 #1134
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
Changes from 1 commit
056453f
b4654ac
561bf64
833ed9f
cc70421
7935634
87d47c4
084fee3
8482c36
048d21d
dcd64e9
d502dbd
b6cacd1
9147c2d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,6 @@ | |
| ComponentMode.__module__ = __name__ | ||
|
|
||
| import pypowsybl._pypowsybl | ||
| from pypowsybl.loadflow.impl.util import _convert_to_component_mode, _convert_to_connected_component_mode | ||
|
|
||
|
|
||
| class Parameters: # pylint: disable=too-few-public-methods | ||
|
|
@@ -125,8 +124,8 @@ def __init__(self, voltage_init_mode: Optional[VoltageInitMode] = None, | |
| if component_mode is not None: | ||
| self.component_mode = component_mode | ||
| if connected_component_mode is not None: | ||
| warnings.deprecated("connected_component_mode is deprecated, use component_mode parameter instead") | ||
| self.component_mode = _convert_to_component_mode(connected_component_mode) | ||
| warnings.warn("connected_component_mode is deprecated, use component_mode parameter instead", DeprecationWarning) | ||
| self._convert_to_component_mode(connected_component_mode) | ||
| if hvdc_ac_emulation is not None: | ||
| self.hvdc_ac_emulation = hvdc_ac_emulation | ||
| if dc_power_factor is not None: | ||
|
|
@@ -179,13 +178,28 @@ def _to_c_parameters(self) -> LoadFlowParameters: | |
|
|
||
| @property | ||
| def connected_component_mode(self) -> Optional[ConnectedComponentMode]: | ||
| warnings.deprecated("connected_component_mode is deprecated, use component_mode parameter instead") | ||
| return _convert_to_connected_component_mode(self.component_mode) | ||
| warnings.warn("connected_component_mode is deprecated, use component_mode parameter instead", DeprecationWarning) | ||
| return self._convert_to_connected_component_mode() | ||
|
|
||
| @connected_component_mode.setter | ||
| def connected_component_mode(self, connected_component_mode: ConnectedComponentMode) -> None: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have not found a good way to do it (the class is declared in the bindings in cpp not in python)...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK |
||
| warnings.deprecated("connected_component_mode is deprecated, use component_mode parameter instead") | ||
| self.component_mode = _convert_to_component_mode(connected_component_mode) | ||
| warnings.warn("connected_component_mode is deprecated, use component_mode parameter instead", DeprecationWarning) | ||
| self._convert_to_component_mode(connected_component_mode) | ||
|
|
||
| def _convert_to_component_mode(self, connected_component_mode: ConnectedComponentMode) -> ComponentMode: | ||
| if connected_component_mode == ConnectedComponentMode.MAIN: | ||
| self.component_mode = ComponentMode.MAIN_CONNECTED | ||
| else: | ||
| self.component_mode = ComponentMode.ALL_CONNECTED | ||
|
|
||
| @staticmethod | ||
| def _convert_to_connected_component_mode(self) -> Optional[ConnectedComponentMode]: | ||
| if self.component_mode == ComponentMode.MAIN_CONNECTED: | ||
| return ConnectedComponentMode.MAIN | ||
| elif self.component_mode == ComponentMode.ALL_CONNECTED: | ||
| return ConnectedComponentMode.ALL | ||
| else: | ||
| return None | ||
|
|
||
| @staticmethod | ||
| def from_json(json_str: str) -> "Parameters": | ||
|
|
||
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.
Maybe an exception if we set both of them ?