Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot load an environment after "env.generate_classes()" on windows #311

Closed
BDonnot opened this issue Apr 29, 2022 · 0 comments · Fixed by #309
Closed

Cannot load an environment after "env.generate_classes()" on windows #311

BDonnot opened this issue Apr 29, 2022 · 0 comments · Fixed by #309
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@BDonnot
Copy link
Collaborator

BDonnot commented Apr 29, 2022

Environment

  • Grid2op version: 1.6.5
  • System: windows
  • Additional system information

Bug description

After you manage to save the classes to files (using the env.generate_classes() function) you cannot load it back because of \ character in windows path...

How to reproduce

Just execute:

Code snippet

import grid2op
from lightsim2grid import LightSimBackend

env_name = "l2rpn_icaps_2021_small"

if __name__ == "__main__":
    env_tmp = grid2op.make(env_name, backend=LightSimBackend())
    env_tmp.generate_classes()
    
    env_tmp2 = grid2op.make(env_name,
                            backend=LightSimBackend(),
                            experimental_read_from_local_dir=True)

Current output

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

Expected output

NO ERROR
@BDonnot BDonnot added bug Something isn't working good first issue Good for newcomers labels Apr 29, 2022
@BDonnot BDonnot linked a pull request Apr 29, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant