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

Regex match in train_val_split_random() #172

Closed
jmontalvo94 opened this issue Mar 17, 2021 · 2 comments
Closed

Regex match in train_val_split_random() #172

jmontalvo94 opened this issue Mar 17, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@jmontalvo94
Copy link

Environment

  • Grid2op version: 1.4.0
  • System: WSL Ubuntu 20.04.2 LTS

Bug description

When using train_val_split_random() an error is raised with any input.

How to reproduce

import grid2op
env = grid2op.make("l2rpn_case14_sandbox")
nm_env_train, nm_env_val = env.train_val_split_random()

Current output

Regex matches any input, so it fails given the condition statement.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jorge/code/bdonnot/Grid2Op/grid2op/Environment/Environment.py", line 1081, in train_val_split_random
    raise EnvError("The suffixes you can use for training data (add_for_train) "
grid2op.Exceptions.EnvExceptions.EnvError: Grid2OpException EnvError "The suffixes you can use for training data (add_for_train) should match the regex "^[a-zA-Z0-9]*$""

Expected output

Splitted dataset.

@BDonnot
Copy link
Collaborator

BDonnot commented Mar 17, 2021

Hello,

Thanks for this issue. Really well explained and can be reproduced easily !

I added the fix you proposed but committed myself because i also modified other part of the code.

I'll close the issue when new version will be out :-)

Benjamin

@BDonnot
Copy link
Collaborator

BDonnot commented Mar 31, 2021

Fixed in release 1.5.0

@BDonnot BDonnot closed this as completed Mar 31, 2021
BDonnot added a commit that referenced this issue Mar 16, 2023
`obs.get_elements_graph` + doc on graph
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants