Skip to content

Conversation

@YacineAbd
Copy link

No description provided.

@BDonnot BDonnot changed the base branch from master to dev_1.11.0 March 5, 2025 15:09
@BDonnot
Copy link
Collaborator

BDonnot commented Mar 5, 2025

Hello,

Thanks for this.

Can you please :

  • sign your commit (see some details on the dco bot)
  • change the title to include "[WIP]" in it (to prevent accidental merge before all tests pass for example)

Thanks 😊

@YacineAbd YacineAbd changed the title Dev 1.11.1 [WIP] Create Protection and ThermalLimits classes to delegate calculations from the backend Mar 6, 2025
Copy link
Collaborator

@BDonnot BDonnot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot merge it in the correct branch.

And there are some other tests that need to be made, especially for the soft overflow but also for some corner cases (see my comments above)

from grid2op.Backend.thermalLimits import ThermalLimits
from grid2op.Backend.protectionScheme import DefaultProtection, NoProtection

class TestProtection(unittest.TestCase):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General comment: coding language of grid2op is english. Would it be possible to translate all French here please ? Thanks

self.default_protection._disconnect_lines(lines_to_disconnect, timestep=1)
self.mock_backend._disconnect_line.assert_called_once_with(1)

def test_next_grid_state(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the "normal" protection there are 3 cases:

  • no overflow with consequences: overflow counter is reset to 0, lines in this case are not disconnected
  • "hard overflow" (flow above HARD_OVERFLOW_THRESHOLD * limit for a line), line is instantly disconnected and cannod be reconnected
  • "soft overflow" : with two expected behaviour
    • either the line is on overflow for less than "NB_TIMESTEP_OVERFLOW_ALLOWED" (or a similar name not checked in the code) in this case the only consquence is that the overflow counter is increased by 1
    • or the line has been on overflow for more than "NB_TIMESTEP_OVERFLOW_ALLOWED" in this case the line is disconnected

If the line is disconnected, then another powerflow you be called.

The "overflow counter" should be increased by at most 1 for each powerline for a given call to "next_grid_state" (because a call to "next grid state" is supposed to happen instantly)

I am not sure all of the above are tested.

I don't see any test :

  • for the overflow counter, in all cases
  • for the soft overflow
  • for the fact that the overflow counter should be increased by more than one (this is tricky to test and i'm not sure if it's covered in grid2op)

@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 2, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants