Skip to content

Commit

Permalink
change lightsim2grid import, notebook works
Browse files Browse the repository at this point in the history
  • Loading branch information
BDonnot committed Jun 30, 2022
1 parent 8f732d9 commit 217590a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions chronix2grid/generation/dispatch/dispatch_loss_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ def run_grid2op_simulation_donothing(grid_path, agent_result_path, nb_core = 1,
print('Grid2op simulation for loss')

try:
from lightsim2grid.LightSimBackend import LightSimBackend
from lightsim2grid import LightSimBackend
backend = LightSimBackend()
except:
from grid2op.Backend import PandaPowerBackend
backend = PandaPowerBackend()
print("You might need to install the LightSimBackend (provisory name) to gain massive speed up")
print("You might need to install the LightSimBackend) to gain massive speed up")
# don't disconnect powerline on overflow, the thermal limit are not set for now, it would not make sens
param = Parameters()
param.init_from_dict({"NO_OVERFLOW_DISCONNECTION": True})
Expand Down
2 changes: 1 addition & 1 deletion getting_started/getting_started_api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.8.10 64-bit",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
4 changes: 2 additions & 2 deletions getting_started/running_chronics_grid2op.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@
"from grid2op.Chronics import Multifolder, GridStateFromFileWithForecasts\n",
"from grid2op.Parameters import Parameters\n",
"try:\n",
" from lightsim2grid.LightSimBackend import LightSimBackend\n",
" from lightsim2grid import LightSimBackend\n",
" backend = LightSimBackend()\n",
"except:\n",
" from grid2op.Backend import PandaPowerBackend\n",
" backend = PandaPowerBackend()\n",
" print(\"You might need to install the LightSimBackend (provisory name) to gain massive speed up\")\n",
" print(\"You might need to install the LightSimBackend to gain massive speed up\")\n",
"# don't disconnect powerline on overflow, the thermal limit are not set for now, it would not make sens\n",
"param = Parameters()\n",
"param.init_from_dict({\"NO_OVERFLOW_DISCONNECTION\": True})\n",
Expand Down
4 changes: 2 additions & 2 deletions getting_started/scripts/check_loss_adjustement.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
import os

try:
from lightsim2grid.LightSimBackend import LightSimBackend
from lightsim2grid import LightSimBackend
backend = LightSimBackend()
except:
from grid2op.Backend import PandaPowerBackend
backend = PandaPowerBackend()
print("You might need to install the LightSimBackend (provisory name) to gain massive speed up")
print("You might need to install the LightSimBackend to gain massive speed up")

#we will check that losses were properly adjusted by rerunning grid2op one more time on the chronic
#and checking that the slack production is not modified much more compare to original one
Expand Down
4 changes: 2 additions & 2 deletions getting_started/scripts/run_DoNothing_grid2op_onChronix.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
print('the number of cores used is: '+str(NB_CORE))
print('the number of scenarios we consider is: '+str(nb_episode))
try:
from lightsim2grid.LightSimBackend import LightSimBackend
from lightsim2grid import LightSimBackend
backend = LightSimBackend()
except:
from grid2op.Backend import PandaPowerBackend
backend = PandaPowerBackend()
print("You might need to install the LightSimBackend (provisory name) to gain massive speed up")
print("You might need to install the LightSimBackend to gain massive speed up")
# don't disconnect powerline on overflow, the thermal limit are not set for now, it would not make sens
param = Parameters()
param.init_from_dict({"NO_OVERFLOW_DISCONNECTION": True})
Expand Down

0 comments on commit 217590a

Please sign in to comment.