Added "definition" to the root directory at definitions/paths.py for easy access all over the source code
Added function to decorate a file name with the path to root directory at src/util/paths.py
Refactored code to open files based on the root directory not the directory of the executable (main.py)
While I was developing unit tests to test behaviors for the redesign I ran into a problem: all the files were being opened based where the python executable was located. Since main.py is at the root directory this was not a problem for the simulator, but the unit test was unable to open any file, even by changing parameters.
One possible simple solution I found was to simply change the working directory in the unit test. But the problem could emerge again in the future. This way its easier to access files for us and maybe for API users in the future.
Added "definition" to the root directory at definitions/paths.py for easy access all over the source code
Added function to decorate a file name with the path to root directory at src/util/paths.py
Refactored code to open files based on the root directory not the directory of the executable (main.py)
While I was developing unit tests to test behaviors for the redesign I ran into a problem: all the files were being opened based where the python executable was located. Since main.py is at the root directory this was not a problem for the simulator, but the unit test was unable to open any file, even by changing parameters.
One possible simple solution I found was to simply change the working directory in the unit test. But the problem could emerge again in the future. This way its easier to access files for us and maybe for API users in the future.