ChristopherMayes / lume-astra

Python wrapper for Astra (A Space Charge Tracking Algorithm, DESY) for eventual use in LUME https://christophermayes.github.io/lume-astra/
https://christophermayes.github.io/lume-astra/
Apache License 2.0
14 stars 9 forks source link

FIX: Adjustments for Windows #3

Closed hhslepicka closed 3 years ago

hhslepicka commented 3 years ago

Closes #2

This Pull Request addresses the issue reported at #2 that happened due to the fact that execution of Astra on Windows requires that users "Press return to continue". Without passing stdin to subprocess.Popen that causes an exit code 24 which means "socket write failed".

After adding stdin the execution would get stuck waiting for the key press. That is addressed via writing to stdin the required key.

Another issue addressed here is that for Windows 10 and higher there are special requirements to allow users to create symlinks. See note section here: https://docs.python.org/3/library/os.html#os.symlink. In order to not impose system changes or Administrator permission on users this PR forces the make_symlinks flag to False when running on Windows.