stan-dev / httpstan

HTTP interface to Stan, a package for Bayesian inference.
ISC License
39 stars 15 forks source link

fix: Require multiprocessing to use "fork" #561

Closed riddell-stan closed 3 years ago

riddell-stan commented 3 years ago

Require multiprocessing to use the "fork" method for starting new processes. This is the only version httpstan currently works with. (macOS recently switched to "spawn" as the default.)

This follows the recommendation in the Python multiprocessing documentation:

A library which wants to use a particular start method should probably use get_context() to avoid interfering with the choice of the library user.

riddell-stan commented 3 years ago

This should address the problem in stan-dev/pystan#247

riddell-stan commented 3 years ago

re: "python script with basic import + model compilation + sampling" Are you thinking this would be useful documentation for people who aren't familiar with how REST APIs work?

I think the README example with curl is reasonably complete.

Of course, if you see any specific weaknesses in the documentation, feel free to open an issue.

ahartikainen commented 3 years ago

Just for having a "test" (outside pytest) that works. Maybe pystan is a better place for it?

riddell-stan commented 3 years ago

We have such a test in GitHub Actions: https://github.com/stan-dev/httpstan/blob/a1df6f3cf849431a015e20c218fca03494568e36/.github/workflows/main.yml#L48