AsFault icon indicating copy to clipboard operation
AsFault copied to clipboard

write_scenario_prefab does not create the scenarios folder and this causes a problem

Open nbro opened this issue 5 years ago • 5 comments

In the function write_scenario_prefab (in the file beamer.py) does not create the folder that will contain the scenarios, but this causes a problem when attempting to render the template at the line

prefab = TEMPLATE_ENV.get_template(PREFAB_FILE).render(...)

given that write_scenario_prefab is called before write_scenario_description, which, on the other hand, attempts to create the folder scenarios (under the user directory) using

    if not os.path.exists(scenarios_dir):
        os.makedirs(scenarios_dir)

nbro avatar Jul 11 '19 15:07 nbro

In the function write_scenario_prefab (in the file beamer.py) does not create the folder that will contain the scenarios, but this causes a problem when attempting to render the template at the line

prefab = TEMPLATE_ENV.get_template(PREFAB_FILE).render(...)

given that write_scenario_prefab is called before write_scenario_description, which, on the other hand, attempts to create the folder scenarios (under the user directory) using

    if not os.path.exists(scenarios_dir):
        os.makedirs(scenarios_dir)

I met the same problem ,did you solve it? could you give me some advice on it?

sheepwxy avatar Aug 02 '19 07:08 sheepwxy

@sheepwxy Maybe later I will be pushing a fix to the code. Meanwhile, you can manually create a folder that will contain the scenario. Have a look at how the other scenarios and levels (in BeamNG) are created.

nbro avatar Aug 02 '19 09:08 nbro

@sheepwxy Maybe later I will be pushing a fix to the code. Meanwhile, you can manually create a folder that will contain the scenario. Have a look at how the other scenarios and levels (in BeamNG) are created.

thanks for your reply!

sheepwxy avatar Aug 05 '19 11:08 sheepwxy

Maybe the same question. 2019-08-23 15:48:34,774 ERROR [Errno 2] No such file or directory: 'C:\Users\15707\Documents/BeamNG.research\levels/asfault\scenarios\asfault.prefab' Traceback (most recent call last): File "c:\users\15707\asfault\src\asfault\evolver.py", line 334, in run_test execution = runner.run() File "c:\users\15707\asfault\src\asfault\beamer.py", line 825, in run prefab_file = write_scenario_prefab(self.test_dir, self.test) File "c:\users\15707\asfault\src\asfault\beamer.py", line 540, in write_scenario_prefab with open(prefab_file, 'w') as out:

Could you please explain how to fix this error manually?

Many Thanks!

zhangx1923 avatar Aug 23 '19 19:08 zhangx1923

Dear All, sorry for the belated response. We are setting up a new way for installing AsFault and its dependencies. It will be pushed as soon as we test it :D

To solve the error above manually creating a folder named "scenarios" under <BeamNG.research>/levels/asfault should solve it.

alessiogambi avatar Sep 10 '19 12:09 alessiogambi