BDonnot / lightsim2grid

LightSim2grid implements a c++ backend targeting the Grid2Op (https://github.com/rte-france/grid2op) platform.
https://lightsim2grid.readthedocs.io/en/latest/
Mozilla Public License 2.0
49 stars 9 forks source link

Some warning messages with lightsim2grid version 0.5.0 and grid2op version 1.5.0 #23

Closed Mleyliabadi closed 3 years ago

Mleyliabadi commented 3 years ago

Environment

Bug description

When I try to make an environment using the LightSimBackend, I have some warning messages that I have never had before when using previous versions.

How to reproduce

Simply importing the libraries of grid2op and lightsim2grid and try to make an environment "l2rpn_case14_sandbox" using the LightSimBackend.

Code snippet

import grid2op
from lightsim2grid import LightSimBackend
grid2op.make(dataset="l2rpn_case14_sandbox",backend=LightSimBackend())

... # Some code 

Current output

C:\Users\milad.leyli-abadi\Anaconda3\envs\RTE\lib\site-packages\lightsim2grid\_aux_check_legit.py:49: UserWarning:

Pandapower network with sn_mva != 1 are not fully supported yet, especially in the conversion for some trafo (and probably somewhere else too)

C:\Users\milad.leyli-abadi\Anaconda3\envs\RTE\lib\site-packages\lightsim2grid\_aux_add_trafo.py:33: UserWarning:

There were some Nan in the pp_net.trafo["tap_neutral"], they have been replaced by 0

C:\Users\milad.leyli-abadi\Anaconda3\envs\RTE\lib\site-packages\lightsim2grid\_aux_add_trafo.py:41: UserWarning:

There were some Nan in the pp_net.trafo["tap_step_percent"], they have been replaced by 0

C:\Users\milad.leyli-abadi\Anaconda3\envs\RTE\lib\site-packages\lightsim2grid\_aux_add_trafo.py:46: UserWarning:

There were some Nan in the pp_net.trafo["tap_pos"], they have been replaced by 0

Expected output

No warning messages
BDonnot commented 3 years ago

Hello,

Warning messages are here to explicitely tell that during the import of the grid, lightsim2grid encounter some invalid values and these values are converted back to the default values.

This is a extremely important feature to debug : the loaded grid in memory will be different from the grid stored in the file. It is not a bug.

Warnings are here to warn that something has happened behind the hood. The previous behaviour was actually a bug (or rather "bug prone") as it was able to load "ill formated" grid without issuing anything.

Problem in this case is not lightsim2grid, but rather the grid2op powergrids, which came from the pandapower one.

Benjamin