-
Notifications
You must be signed in to change notification settings - Fork 11
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
Support for operator strategies in security analysis API #621
Conversation
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
b686e43
to
8314622
Compare
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
@EtienneLt Some of the actions support are still missing but what do you think of the global approach ? |
Yes the approach is quite good but I have some questions |
If you are talking about LoadAction it only support active and reactive power modifications. Generator action support active power modification but also regulation / targetV / targetQ. Like discussed in original issue I think we should add an API for each of these use cases. So in the end we should have :
|
Development was on hold on this feature, I'll try to finish implementing the last missing features and add some documentation shortly. |
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
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.
I didn't yet look deep in the code but just played with the API and look at results:
- get_table() has not been updated to show operator strategies:
>>> import pypowsybl as pp
>>> n = pp.network.create_eurostag_tutorial_example1_network()
>>> sa = pp.security.create_analysis()
>>> sa.add_single_element_contingency('NHV1_NHV2_1', 'Line contingency')
>>> sa.add_load_active_power_action('LoadAction1', 'LOAD', False, 750.0)
>>> sa.add_operator_strategy('OperatorStrategy1', 'Line contingency', ['LoadAction1'])
>>> sa_result = sa.run_ac(n)
>>> print(sa_result.get_table())
+------------------+-----------+--------------+----------------+--------------+-------+------------+---------------------+-----------------+--------+------+
| Contingency ID | Status | Equipment ID | Equipment name | Limit type | Limit | Limit name | Acceptable duration | Limit reduction | Value | Side |
+------------------+-----------+--------------+----------------+--------------+-------+------------+---------------------+-----------------+--------+------+
| Line contingency | CONVERGED | | | | | | | | | |
| | | NHV1_NHV2_2 | | HIGH_VOLTAGE | 500.0 | permanent | 2147483647 | 1.0 | 1047.8 | TWO |
| | | VLHV1 | | ??? | 400.0 | | 2147483647 | 1.0 | 398.3 | NONE |
+------------------+-----------+--------------+----------------+--------------+-------+------------+---------------------+-----------------+--------+------+
Also it looks like there is a bug (probably existing) in the limit type, the violation 'high voltage' seems to be a current violation and ??? is not nomal. @obrix could you have a look at it ?
- Operator strategy result is not printable as for contingency result:
>>> sa_result.find_post_contingency_result('Line contingency')
PostContingencyResult(contingency_id='Line contingency', status=CONVERGED, limit_violations=[2])
>>> sa_result.find_operator_strategy_results('OperatorStrategy1')
<pypowsybl._pypowsybl.OperatorStrategyResult object at 0x7f4fe93ad8b0>
- Existing problem too but limit_violations should be a list and not just an iterable to allow
>>> sa_result.find_post_contingency_result('Line contingency').limit_violations[0]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'pypowsybl._pypowsybl.LimitViolationArray' object is not subscriptable
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Add support for operator strategies in security analysis API.
#557
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
What kind of change does this PR introduce?
What is the current behavior?
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change or deprecate an API?
Other information: