rte-france / l2rpn-baselines

L2RPN Baselines a repository to host baselines for l2rpn competitions.
https://l2rpn-baselines.readthedocs.io/en/stable/
Mozilla Public License 2.0
81 stars 45 forks source link

Fix a bug in OptimCVXPY #39

Closed EBoguslawski closed 2 years ago

EBoguslawski commented 2 years ago

When using OptimCVXPY, we sometimes obtained the following bug:

l2rpn_baselines/OptimCVXPY/optimCVXPY.py:526: RuntimeWarning: invalid value encountered in sqrt
  self._th_lim_mw.value[:] = np.sqrt(self._th_lim_mw.value)

The modification puts 1 in the sqrt function if the value inside is too small (<=1). We chose 1 because sqrt(1)=1, consequently the transition remains smooth.