PyStan 3 prototype "pystan-next"

I’ve pushed a working prototype of PyStan 3 to https://github.com/stan-dev/pystan-next . The plan is for this code to eventually replace https://github.com/stan-dev/pystan.

The main design difference between PyStan 3 and previous versions is that PyStan 3 is pure-Python. There’s no C++ code. All the heavy lifting (e.g., model compilation) is handled by httpstan. It’s all permissively licensed, respecting the result of a vote of pystan devs.

I’ll aim to align the user-facing API with RStan3’s and gradually port every test from pystan to pystan-next.

Some notable statistics:

PyStan 2: 5,625 lines of code, excluding tests
PyStan 3 and httpstan: 1,669 lines of code, excluding tests

The reduction in lines of code is achieved thanks to the stan::services C++ API. For example, thanks to the work on the C++ API the file stan_fit.hpp (1,559 LOC) is no longer needed.

6 Likes

Wonderful!

Nice to see the code’s shrinking. Is that including httpstan? I didn’t even notice there was a new httpstan repo. I see the link to the ISC license is right at the top—fantastic.

How’s the performance with the HTTP interface?

And thanks to everyone who built stan::services—it’s so nice to see that paying off.

I’m a PyStan user. I just wonder where I can get relevant and update information about timeline of replacing PyStan with PyStan 3.

Also, what are the major improvement from PyStan3?

PyStan 3 Beta 1 is out, see Finalizing the Interface Guidelines Design Doc.
If you can wait a week or two there will be a release of PyStan 3 Beta 2. This version has some important fixes.

1 Like

I’m going to close this topic to new replies since there are much more recent posts.