Skip to content
Snippets Groups Projects

Fix windows specific issues

Merged Benoit Seignovert requested to merge fix-windows-issues into main

Closes #80 (closed) and #81 (closed)

Add

  • Support ~ path for kernels and metakernels inputs and substitutions in TourConfig/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 1 to disable multi-thread downloads (#80 (closed)). This avoid to raise RuntimeError on freeze_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')

:warning: The path is provided with \ it should be either a regex-string or properly escaped with \\

:radioactive:trailing \ in r-string is not supported in python. Use \\ instead.

Edited by Benoit Seignovert

Merge request reports

Merge request pipeline #1096 passed

Merge request pipeline passed for 9a3a1d00

Test coverage 100.00% (0.00%) from 3 jobs

Merged by Benoit SeignovertBenoit Seignovert 1 year ago (Aug 9, 2023 9:27am UTC)

Loading

Pipeline #1097 passed

Pipeline passed for 050b86b4 on main

Test coverage 100.00% (0.00%) from 3 jobs

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading