NREL / hercules

Hercules
https://nrel.github.io/hercules/
Apache License 2.0
3 stars 7 forks source link

[BUGFIX] Create outputs folder in examples to avoid error when output file does not exist #93

Closed misi9170 closed 5 months ago

misi9170 commented 5 months ago

A bug was introduced in #84 that means that the AMRWindStandin examples need to be run twice to work.

The issue is that the

logging.basicConfig(
    level=logging.DEBUG,
    format="%(asctime)s %(name)-12s %(levelname)-8s %(message)s",
    datefmt="%Y-%m-%d %H:%M",
    filename="outputs/log_test_client.log",
    filemode="w",
)
logger = logging.getLogger("amr_wind_standin")

at the top of amr_wind_standin.py assumes that the folder outputs/ already exists; however, it is not created until AMRWindStandin is instantiated.

To resolve the issue, we've added the creation of the outputs folder above this code, as well as added it to emulator.py in case the emulator is run without the AMRWindStandin. Additionally, the .gitignore is updated to ignore an log files beginning with loghercules, logstandin, or logfloris.

misi9170 commented 5 months ago

@genevievestarke Done :)