marota / ExpertOp4Grid

Expert System agent to operate a power grid
https://expertop4grid.readthedocs.io/en/latest
Mozilla Public License 2.0
7 stars 2 forks source link

Chronic parameter value as a string #11

Closed marota closed 4 years ago

marota commented 4 years ago

Chronic names are not necessarily integers, but rather strings. It should be possible to refer to a chronic with a name when launching alphadeesp

marota commented 4 years ago

@mjothy @NMegel

NMegel commented 4 years ago

In Grid2op API, we could only find

env.setid(id = chronicnumber) env.reset()

to move from one chronic scenario to another. Is there a way to identify chronic folders with names?

Tezirg commented 4 years ago
import grid2op
import os

env = grid2op.make("l2rpn_neurips_2020_track1_small")

for id, sp in enumerate(env.chronics_handler.real_data.subpaths):
    env.set_id(id)
    env.reset()
    current_name = os.path.basename(env.chronics_handler.get_id())
    assert current_name == os.path.basename(sp)
marota commented 4 years ago

this is enough to find the name, no need to set_id and reset environment

scenarios={}
for id, sp in enumerate(env.chronics_handler.real_data.subpaths):
    scenarios[os.path.basename(sp)] = id
marota commented 4 years ago

@mjothy @NMegel a revoir

NMegel commented 4 years ago

Done in commit 64b46604f2de7f260ca74f7fb42c7b5efc4ca61a

marota commented 4 years ago

Tested ok, Closing