7
7
from typing import Dict
8
8
9
9
from pypowsybl import _pypowsybl
10
- from pypowsybl ._pypowsybl import ShortCircuitStudyType
10
+ from pypowsybl ._pypowsybl import ShortCircuitStudyType , InitialVoltageProfileMode
11
11
12
12
ShortCircuitStudyType .__module__ = __name__
13
13
ShortCircuitStudyType .__name__ = 'ShortCircuitStudyType'
14
+ InitialVoltageProfileMode .__module__ = __name__
15
+ InitialVoltageProfileMode .__name__ = 'InitialVoltageProfileMode'
14
16
15
17
16
18
class Parameters : # pylint: disable=too-few-public-methods
@@ -35,6 +37,7 @@ class Parameters: # pylint: disable=too-few-public-methods
35
37
min_voltage_drop_proportional_threshold: specifies a threshold for filtering the voltage results.
36
38
Only nodes where the voltage drop due to the short circuit is greater than this property are retained.
37
39
study_type: specifies the type of short-circuit study. It can be SUB_TRANSIENT, TRANSIENT or STEADY_STATE.
40
+ initial_voltage_profile_mode: specify how the computation is initialized. It can be NOMINAL, CONFIGURED or PREVIOUS_VALUE
38
41
"""
39
42
40
43
def __init__ (self ,
@@ -44,7 +47,8 @@ def __init__(self,
44
47
min_voltage_drop_proportional_threshold : float = None ,
45
48
study_type : ShortCircuitStudyType = None ,
46
49
provider_parameters : Dict [str , str ] = None ,
47
- with_fortescue_result : bool = None ):
50
+ with_fortescue_result : bool = None ,
51
+ initial_voltage_profile_mode : InitialVoltageProfileMode = None ):
48
52
self ._init_with_default_values ()
49
53
if with_feeder_result is not None :
50
54
self .with_feeder_result = with_feeder_result
@@ -60,6 +64,8 @@ def __init__(self,
60
64
self .provider_parameters = provider_parameters
61
65
if with_fortescue_result is not None :
62
66
self .with_fortescue_result = with_fortescue_result
67
+ if initial_voltage_profile_mode is not None :
68
+ self .initial_voltage_profile_mode = initial_voltage_profile_mode
63
69
64
70
def _init_from_c (self , c_parameters : _pypowsybl .ShortCircuitAnalysisParameters ) -> None :
65
71
self .with_feeder_result = c_parameters .with_feeder_result
@@ -70,6 +76,7 @@ def _init_from_c(self, c_parameters: _pypowsybl.ShortCircuitAnalysisParameters)
70
76
self .provider_parameters = dict (
71
77
zip (c_parameters .provider_parameters_keys , c_parameters .provider_parameters_values ))
72
78
self .with_fortescue_result = c_parameters .with_fortescue_result
79
+ self .initial_voltage_profile_mode = c_parameters .initial_voltage_profile_mode
73
80
74
81
def _init_with_default_values (self ) -> None :
75
82
self ._init_from_c (_pypowsybl .ShortCircuitAnalysisParameters ())
@@ -79,6 +86,7 @@ def _init_with_default_values(self) -> None:
79
86
self .min_voltage_drop_proportional_threshold = 0
80
87
self .study_type = ShortCircuitStudyType .TRANSIENT
81
88
self .with_fortescue_result = False
89
+ self .initial_voltage_profile_mode = InitialVoltageProfileMode .NOMINAL
82
90
83
91
def _to_c_parameters (self ) -> _pypowsybl .ShortCircuitAnalysisParameters :
84
92
c_parameters = _pypowsybl .ShortCircuitAnalysisParameters ()
@@ -88,6 +96,7 @@ def _to_c_parameters(self) -> _pypowsybl.ShortCircuitAnalysisParameters:
88
96
c_parameters .study_type = self .study_type
89
97
c_parameters .with_fortescue_result = self .with_fortescue_result
90
98
c_parameters .min_voltage_drop_proportional_threshold = self .min_voltage_drop_proportional_threshold
99
+ c_parameters .initial_voltage_profile_mode = self .initial_voltage_profile_mode
91
100
c_parameters .provider_parameters_keys = []
92
101
c_parameters .provider_parameters_values = []
93
102
return c_parameters
@@ -100,4 +109,5 @@ def __repr__(self) -> str:
100
109
f", min_voltage_drop_proportional_threshold={ self .min_voltage_drop_proportional_threshold !r} " \
101
110
f", study_type={ self .study_type !r} " \
102
111
f", with_fortescue_result={ self .with_fortescue_result !r} " \
112
+ f", initial_voltage_profile_mode={ self .initial_voltage_profile_mode !r} " \
103
113
f")"
0 commit comments