Skip to content

Commit

Permalink
try to debug windows
Browse files Browse the repository at this point in the history
  • Loading branch information
BDonnot committed Jul 22, 2024
1 parent 246021e commit a9b4d1c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
31 changes: 16 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ jobs:
git submodule update
make
CC=gcc python setup.py build
python -m pip install .[test]
python -m pip install .[test] gymnasium
- run:
name: "Show package versions"
command: |
Expand Down Expand Up @@ -307,7 +307,7 @@ jobs:
git submodule update
make
CC=clang python setup.py build
CC=clang python -m pip install -U .
CC=clang python -m pip install -U .
compile_clang14:
executor: clang14
resource_class: small
Expand Down Expand Up @@ -387,7 +387,7 @@ jobs:
git submodule update
make
CC=clang python setup.py build
CC=clang python -m pip install -e .[test]
CC=clang python -m pip install -e .[test] gymnasium
- run:
name: "Show package versions"
command: |
Expand All @@ -411,7 +411,7 @@ jobs:
- run: C:\Python310\python -m pip install virtualenv
- run: C:\Python310\python -m virtualenv venv_test
- run:
name: "Chekc python / pip version in venv"
name: "Check python / pip version in venv"
command: |
.\venv_test\Scripts\activate
python --version
Expand All @@ -421,7 +421,7 @@ jobs:
command: |
.\venv_test\Scripts\activate
git clone https://github.com/rte-france/grid2op.git _grid2op
pip install -e _grid2op
pip install -e _grid2op gymnasium
- run:
name: "Install lightsim2grid"
command: |
Expand All @@ -437,25 +437,26 @@ jobs:
command: |
.\venv_test\Scripts\activate
cd lightsim2grid\tests
python -m unittest discover -v
python -m unittest test_n1contingencyrewards
# python -m unittest discover -v
workflows:
version: 2.1
compile:
jobs:
- compile_gcc8
# - compile_gcc8 # kept
# - compile_gcc10
# - compile_gcc11
- compile_gcc12
- compile_gcc13
# - compile_gcc12
# - compile_gcc13 # kept
# - compile_clang10 # does not work I don't know why, too lazy to check
- compile_clang11
# - compile_clang11 # kept
# - compile_clang13
# - compile_clang14
# - compile_clang15
- compile_clang16
- compile_clang17
# - compile_clang16
# - compile_clang17 # kept
- compile_windows
# - test_legacy_grid2op
# - compile_clang18
# - compile_gcc14
# - test_legacy_grid2op # added
# - compile_clang18 # added
# - compile_gcc14 # added
6 changes: 3 additions & 3 deletions lightsim2grid/rewards/n1ContingencyReward.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ def initialize(self, env: "grid2op.Environment.Environment"):

if not isinstance(env.backend, (PandaPowerBackend, LightSimBackend)):
raise RuntimeError("Impossible to use the `N1ContingencyReward` with "
"a environment with a backend that is not "
"an environment with a backend that is not "
"``PandaPowerBackend` nor `LightSimBackend`."
)
if isinstance(env.backend, LightSimBackend):
self._backend : LightSimBackend = env.backend.copy()
self._backend_ls :bool = True
self._backend_ls : bool = True
elif isinstance(env.backend, PandaPowerBackend):
self._backend = LightSimBackend.init_grid(type(env.backend))()
self._backend.init_from_loaded_pandapower(env.backend)
Expand Down Expand Up @@ -154,7 +154,7 @@ def __call__(self, action, env, has_error, is_done, is_illegal, is_ambiguous):
p_sq[p_sq <= 0.] = 0.
limits = np.sqrt(p_sq)
else:
tmp_res = tmp[1]
tmp_res = 1. * tmp[1]
limits = th_lim_a
res = ((tmp_res > self._threshold_margin * limits) | (~np.isfinite(tmp_res))).any(axis=1) # whether one powerline is above its limit, per cont
res |= (np.abs(tmp_res) <= self._tol).all(axis=1) # other type of divergence: all 0.
Expand Down

0 comments on commit a9b4d1c

Please sign in to comment.