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

Flow decomposition: Add max current overload rescaler #845

Merged
merged 4 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cpp/powsybl-cpp/powsybl-cpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ class SensitivityAnalysisParameters {
enum class RescaleMode {
NONE = 0,
ACER_METHODOLOGY,
PROPORTIONAL
PROPORTIONAL,
MAX_CURRENT_OVERLOAD
};

class FlowDecompositionParameters {
Expand Down
5 changes: 3 additions & 2 deletions cpp/pypowsybl-cpp/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void voltageInitializerBinding(py::module_& m) {
m.def("voltage_initializer_set_low_active_power_default_limit", &pypowsybl::voltageInitializerSetLowActivePowerDefaultLimit, py::arg("params_handle"), py::arg("low_active_power_default_limit"));
m.def("voltage_initializer_set_default_minimal_qp_range", &pypowsybl::voltageInitializerSetDefaultMinimalQPRange, py::arg("params_handle"), py::arg("default_minimal_qp_range"));
m.def("voltage_initializer_set_default_qmax_pmax_ratio", &pypowsybl::voltageInitializerSetDefaultQmaxPmaxRatio, py::arg("params_handle"), py::arg("default_qmax_pmax_ratio"));

m.def("voltage_initializer_apply_all_modifications", &pypowsybl::voltageInitializerApplyAllModifications, py::arg("result_handle"), py::arg("network_handle"));
m.def("voltage_initializer_get_status", &pypowsybl::voltageInitializerGetStatus, py::arg("result_handle"));
m.def("voltage_initializer_get_indicators", &pypowsybl::voltageInitializerGetIndicators, py::arg("result_handle"));
Expand Down Expand Up @@ -966,7 +966,8 @@ PYBIND11_MODULE(_pypowsybl, m) {
py::enum_<pypowsybl::RescaleMode>(m, "RescaleMode")
.value("NONE", pypowsybl::RescaleMode::NONE)
.value("ACER_METHODOLOGY", pypowsybl::RescaleMode::ACER_METHODOLOGY)
.value("PROPORTIONAL", pypowsybl::RescaleMode::PROPORTIONAL);
.value("PROPORTIONAL", pypowsybl::RescaleMode::PROPORTIONAL)
.value("MAX_CURRENT_OVERLOAD", pypowsybl::RescaleMode::MAX_CURRENT_OVERLOAD);

py::class_<pypowsybl::FlowDecompositionParameters>(m, "FlowDecompositionParameters")
.def(py::init(&pypowsybl::createFlowDecompositionParameters))
Expand Down
1 change: 1 addition & 0 deletions pypowsybl/_pypowsybl.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ class RescaleMode:
NONE: ClassVar[RescaleMode] = ...
ACER_METHODOLOGY: ClassVar[RescaleMode] = ...
PROPORTIONAL: ClassVar[RescaleMode] = ...
MAX_CURRENT_OVERLOAD: ClassVar[RescaleMode] = ...
def __init__(self, arg0: int) -> None: ...
def __eq__(self, arg0: object) -> bool: ...
def __getstate__(self) -> int: ...
Expand Down
2 changes: 1 addition & 1 deletion tests/test_flow_decomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def test_flow_decomposition_parameters():
'enable_losses_compensation': [True, False],
'losses_compensation_epsilon': [-1, 1e-3, 1e-5],
'sensitivity_epsilon': [-1, 1e-3, 1e-5],
'rescale_mode': [pp.flowdecomposition.RescaleMode.NONE, pp.flowdecomposition.RescaleMode.PROPORTIONAL, pp.flowdecomposition.RescaleMode.ACER_METHODOLOGY],
'rescale_mode': [pp.flowdecomposition.RescaleMode.NONE, pp.flowdecomposition.RescaleMode.PROPORTIONAL, pp.flowdecomposition.RescaleMode.ACER_METHODOLOGY, pp.flowdecomposition.RescaleMode.MAX_CURRENT_OVERLOAD],
'dc_fallback_enabled_after_ac_divergence': [True, False],
'sensitivity_variable_batch_size' : [100, 1000, 5000, 15000]
}
Expand Down
Loading