Closed BDonnot closed 1 year ago
Ce test peut être fait directement avec l'environnement de lightsim2grid ici https://github.com/BDonnot/lightsim2grid/tree/bd-dev/lightsim2grid/tests/case_14_storage_iidm qui est une copie des données utilisées par grid2op lorsque la "test suite" est lancée.
Un exemple d'usage est fourni ici:
https://github.com/BDonnot/lightsim2grid/blob/cda64f663b01eaf1f5e993f80e29ef7892e0dd5d/lightsim2grid/tests/test_backend_pypowsybl.py#L68
(ligne 68 à 84, bien sur il faudra veiller à changer le chemin et pas utiliser simplement dir_path = os.path.dirname(os.path.realpath(__file__))
Describe the current behavior
Currently, from our previous conversation, I noted that it was hard to "make sense" of the errors in grid2op tests for the backend.
This is why I made a clearer and more explicit test suite that tests only the backend API and nothing else and that can help debugging when creating a backend. All tests there should pass for a good integration with grid2op.
Describe the expected behavior
To run the tests, you need to install the developer / editable mode of grid2op 1.9.6 from github (see Extra Information paragraph for more information)
Then, you create a script (named eg "basic_test.py") with:
Describe the motivation
I made this function with a "test driven development" kind of method in mind. Tests are made in "increasing difficulty" (somewhat) with explicit error message when there are some issues.
Extra Information
Grid2op documentation is not up to date yet.
Grid2op needs to be installed from source from the github for this to work: