gregorbj / Archive-VisionEval

VisionEval Model System and Framework (formerly RSPM Framework)
Apache License 2.0
28 stars 19 forks source link

Expected behavior of readModelState when ModelState_ls is not in environment? #209

Closed DavidOry closed 5 years ago

DavidOry commented 5 years ago

https://github.com/gregorbj/VisionEval/blob/c10bacba8e4edaf42a149b66af754264a5280eaa/sources/framework/visioneval/R/initialization.R#L148

What should happen here if ModelState_ls is not in the environment (i.e., not returned by ls())?

gregorbj commented 5 years ago

The function will return nothing, but it probably should return an error message. Actually the error should be triggered if the the model state file is not present. Then there would be no need to check whether ModelState_ls is present.

dflynn-volpe commented 5 years ago

I'm getting an error with exactly this situation when trying to run VEGUI, see comments at end of #207.

landisrm commented 5 years ago

I am getting this error also. On my machine it is occurring because FileName doesn't exist. The function should handle the situation if the file does not exist better. For instance, if file.exists(FileName) is FALSE, then the call to ls() should look in the global environment, not the function environment, e.g. via ls(name = .GlobalEnv).

landisrm commented 5 years ago

This problem seems to be Windows specific. I don't get this on a MacBook.

landisrm commented 5 years ago

The c76159f commit fixes this by looking for ModelState_ls in the global environment instead of the function environment.