Skip to content

Commit 12fa207

Browse files
author
Naledi EL CHEIKH
committed
fix bindings and changed Parameters name
Signed-off-by: Naledi EL CHEIKH <[email protected]>
1 parent 05c456f commit 12fa207

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+280
-96
lines changed

cpp/powsybl-cpp/powsybl-cpp.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,9 +1715,10 @@ void splitOrMergeTransformers(pypowsybl::JavaHandle network, const std::vector<s
17151715
pypowsybl::PowsyblCaller::get()->callJava(::splitOrMergeTransformers, network, transformerIdsPtr.get(), transformerIds.size(), merge, (reportNode == nullptr) ? nullptr : *reportNode);
17161716
}
17171717

1718-
int scaleProportional(pypowsybl::JavaHandle network, int asked, distribution_mode distributionMode, const std::vector<std::string>& injectionsIds, const int limitMin, const int limitMax, scaling_parameters scalingParameters) {
1718+
int scaleProportional(pypowsybl::JavaHandle network, int asked, distribution_mode distributionMode, const std::vector<std::string>& injectionsIds, const int limitMin, const int limitMax, const ScalingParameters& scalingParameters) {
17191719
ToCharPtrPtr injectionsIdsPtr(injectionsIds);
1720-
return pypowsybl::PowsyblCaller::get()->callJava<int>(::scaleProportional, network, asked, distributionMode, injectionsIdsPtr.get(), injectionsIds.size(), limitMin, limitMax, scalingParameters);
1720+
auto c_scaling_parameters = scalingParameters.to_c_struct();
1721+
return pypowsybl::PowsyblCaller::get()->callJava<int>(::scaleProportional, network, asked, distributionMode, injectionsIdsPtr.get(), injectionsIds.size(), limitMin, limitMax, c_scaling_parameters.get());
17211722
}
17221723

17231724
/*---------------------------------SHORT-CIRCUIT ANALYSIS---------------------------*/

cpp/pypowsybl-cpp/bindings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,10 +1218,10 @@ PYBIND11_MODULE(_pypowsybl, m) {
12181218
m.def("create_network_modification", ::createNetworkModificationBind, "Create and apply network modification", py::arg("network"), py::arg("dataframe"), py::arg("network_modification_type"), py::arg("raise_exception"), py::arg("report_node"));
12191219

12201220
m.def("split_or_merge_transformers", &pypowsybl::splitOrMergeTransformers, "Replace 3-windings transformers with 3 2-windings transformers",
1221-
py::arg("network"), py::arg("transformer_ids"), py::arg("merge"), py::arg(scaling_parameters"report_node"));
1221+
py::arg("network"), py::arg("transformer_ids"), py::arg("merge"));
12221222

12231223
m.def("scale_proportional", &pypowsybl::scaleProportional, "Scale the given network proportionally.",
1224-
py::arg("network"), py::arg("asked"), py::arg("distribution_mode"), py::arg("injections_ids"), py::arg("limit_min"), py::arg("limit_max"), py::arg(""));
1224+
py::arg("network"), py::arg("asked"), py::arg("distribution_mode"), py::arg("injections_ids"), py::arg("limit_min"), py::arg("limit_max"), py::arg("scaling_parameters"));
12251225

12261226
py::enum_<pypowsybl::InitialVoltageProfileMode>(m, "InitialVoltageProfileMode", "configure the voltage profile to use for the short-circuit study")
12271227
.value("NOMINAL", pypowsybl::InitialVoltageProfileMode::NOMINAL,

docs/reference/flowdecomposition.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ Some enum classes are used in the computer:
4949

5050
ContingencyContextType
5151

52-
Parameters
52+
ScalingParameters
5353
----------
5454

5555
The execution of the flowdecomposition can be customized using flowdecomposition parameters.
5656

5757
.. autosummary::
5858
:nosignatures:
5959

60-
Parameters
60+
ScalingParameters
6161

6262
.. include it in the toctree
6363
.. toctree::
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
pypowsybl.flowdecomposition.Parameters
1+
pypowsybl.flowdecomposition.ScalingParameters
22
======================================
33

44
.. currentmodule:: pypowsybl.flowdecomposition
55

6-
.. autoclass:: Parameters
6+
.. autoclass:: ScalingParameters

docs/reference/loadflow.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ Running a loadflow
2222
get_provider_parameters_names
2323
get_provider_parameters
2424

25-
Parameters
25+
ScalingParameters
2626
----------
2727

2828
The execution of the loadflow can be customized using loadflow parameters.
2929

3030
.. autosummary::
3131
:nosignatures:
3232

33-
Parameters
33+
ScalingParameters
3434
get_provider_parameters_names
3535
get_provider_parameters
3636

@@ -81,7 +81,7 @@ Some classes and enum classes are used in results:
8181

8282
ComponentStatus
8383

84-
Parameters to validate loadflow
84+
ScalingParameters to validate loadflow
8585
-------------------------------
8686

8787
The validation of a loadflow can be customized using loadflow validation parameters.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
pypowsybl.loadflow.Parameters
1+
pypowsybl.loadflow.ScalingParameters
22
=============================
33

44
.. currentmodule:: pypowsybl.loadflow
55

6-
.. autoclass:: Parameters
6+
.. autoclass:: ScalingParameters

docs/reference/rao.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You can run a RAO using the following methods:
1515
:toctree: api/
1616

1717

18-
Parameters
18+
ScalingParameters
1919
----------
2020

2121
The execution of the RAO can be customized using file parameters.
@@ -24,7 +24,7 @@ The execution of the RAO can be customized using file parameters.
2424
:nosignatures:
2525
:toctree: api/
2626

27-
Parameters
27+
ScalingParameters
2828

2929
Results
3030
-------

docs/reference/security.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ You can run a security analysis using the following methods:
2323
get_provider_names
2424

2525

26-
Parameters
26+
ScalingParameters
2727
----------
2828

2929
The execution of the security analysis can be customized using security analysis parameters.
@@ -32,7 +32,7 @@ The execution of the security analysis can be customized using security analysis
3232
:nosignatures:
3333
:toctree: api/
3434

35-
Parameters
35+
ScalingParameters
3636
IncreasedViolationsParameters
3737
get_provider_parameters_names
3838

docs/reference/sensitivity.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ You can run an AC or DC security analysis using the following methods:
2424
get_provider_names
2525

2626

27-
Parameters
27+
ScalingParameters
2828
----------
2929

3030
The execution of the sensitivity analysis can be customized using sensitivity analysis parameters.
@@ -33,7 +33,7 @@ The execution of the sensitivity analysis can be customized using sensitivity an
3333
:nosignatures:
3434
:toctree: api/
3535

36-
Parameters
36+
ScalingParameters
3737
get_provider_parameters_names
3838

3939

docs/reference/shortcircuit.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ You can run a short-circuit analysis using the following methods:
2020
get_provider_names
2121

2222

23-
Parameters
23+
ScalingParameters
2424
----------
2525

2626
The execution of the short-circuit analysis can be customized using short-circuit analysis parameters.
@@ -29,7 +29,7 @@ The execution of the short-circuit analysis can be customized using short-circui
2929
:nosignatures:
3030
:toctree: api/
3131

32-
Parameters
32+
ScalingParameters
3333

3434

3535
Create faults

0 commit comments

Comments
 (0)