Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLiM Support in Windows #1563

Open
daikitag opened this issue May 28, 2024 · 3 comments
Open

SLiM Support in Windows #1563

daikitag opened this issue May 28, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@daikitag
Copy link

This is a Duplicate of #1426.

It seems that stdpopsim works totally fine on Windows with msprime engine, but the SLiM engine is only supported in non-Windows platform as indicated in this code,

if sys.platform != "win32":
, and we get
ValueError: Simulation engine 'slim' not registered
when we run stdpopsim.get_engine("slim") in a Windows platform.

Would it be possible for you to document this in stdpopsim documentation?
I would be happy to create a pull request to modify the documentation as well.

Also, when I manually added slim engine by running stdpopsim.register_engine(stdpopsim.slim_engine._SLiMEngine()) and ran the simulation by using the slim engine, I got an error in this line,

s = subprocess.check_output([slim_path, "-v"])
, with a FileNotFound error, and it seems that
subprocess.check_output([slim_path, "-v"])
does not work in the Windows platform.

I imagine that running SLiM through stdpopsim in Windows is an issue of subprocess and not an issue of SLiM, as I can comfortably run SLiM in windows by using the command line, but am I correct about it?
If so, I would be happy to try fixing this issue, such that Windows users can also get access to SLiM engine as default.

@daikitag daikitag added the enhancement New feature or request label May 28, 2024
@petrelharp
Copy link
Contributor

It would be great to get your help on this, @daikitag - you're right, this should now work, now that SLiM is installable on Windows. If you're up for this (probably painful) task, I think the first steps would be to

  1. make a new branch
  2. remove the if sys.platform != "win32": check you mention above
  3. see where it breaks
  4. open a PR to report/troubleshoot

@daikitag
Copy link
Author

Thank you @petrelharp . I am now digging deep into the SLiM code of stdpopsim for my research project, so it might take some time, but I will try fixing it.

@petrelharp
Copy link
Contributor

To answer your question above:

stdpopsim.register_engine(stdpopsim.slim_engine._SLiMEngine())

And, getting this working is a Can of Worms. But we'll do it soon (before 0.2.1, in a couple of weeks).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants