Fix windows specific issues
Closes #80 (closed) and #81 (closed)
Add
- Support
~path for kernels and metakernels inputs and substitutions inTourConfig/MetaKernel/SpicePool:
SpicePool.add('~/Desktop/naif0012.tls')
MetaKernel('~/Desktop/mk.tm', kernels='~/Documents')
TourConfig(mk='~/Desktop/mk.tm', kernels_dir='~/Documents')
This is supported for Windows, Linux and macOS and will be internally replaced by C:\Users\<USERNAME>, /home/<USERNAME> and /Users/<USERNAME> respectively.
Fixes
- By default on windows, the number of download threads is now set to
1to disable multi-thread downloads (#80 (closed)). This avoid to raiseRuntimeErroronfreeze_support()when a python script is executed.
If you use Jupyter notebooks, you can by-pass this default and provide a n_threads keyword explicitly:
MetaKernel('metakernel.tm', download=True, n_threads=2)
If you need to execute it in a script (ie. python.exe my_script.py) in this case, you need to encapsulate the call:
if __name__ == "__main__":
MetaKernel('metakernel.tm', download=True, n_threads=2)
-
MetaKernelnow escape correctly Windows path strings (#81 (closed)):
TourConfig(mk='metakernel.tm', kernel_dir='C:/Users/foo')
TourConfig(mk='metakernel.tm', kernel_dir=r'C:\Users\foo')
TourConfig(mk='metakernel.tm', kernel_dir='C:\\Users\\foo')
\ it should be either a regex-string or properly escaped with \\
鈽笍 trailing\in r-string is not supported in python. Use\\instead.
Edited by benoit seignovert