QF-Error-Tracking / QFVD5

0 stars 0 forks source link

Drawsmoke system arguments #11

Closed ntutland closed 1 year ago

ntutland commented 1 year ago

The main function in drawsmoke doesn't seem to assign a value for gen_gif_in when len(sys.argv) == 1. @sbrambilla

if len(sys.argv) == 1:
        prj_folder_in = os.getcwd()
else:
        prj_folder_in = sys.argv[1]

if len(sys.argv) == 2:
        gen_gif_in = 0
else:
        gen_gif_in = int(sys.argv[2])

Thus if you enter the command python3 drawsmoke.py, prj_folder_in will be the current working directory, but gen_gif_in will look for sys.argv[2], which doesn't exist. Which I think means there is no way to let len(sys.argv) be 1 and not type in the project path. I used code below as a workaround, which seemed to work, but a different fix may be better.

if len(sys.argv) == 1:
        prj_folder_in = os.getcwd()
else:
        prj_folder_in = sys.argv[1]

if len(sys.argv) == 2:
        gen_gif_in = 0
elif len(sys.argv) == 3:
        gen_gif_in = int(sys.argv[2])
else:
        gen_gif_in = 0

Sorry if this isn't the right place to submit since it's not directly associated with quicfire

sbrambilla commented 1 year ago

I can make the change and handle all the options. I'm ok with reporting QSMOKE issues here too.

zacharycope0 commented 1 year ago

@sbrambilla. I'm closing issues that I believe to be resolved. Please reopen if the issue hasn't been addressed.