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

Feature Request: Pass Stan model as string to CmdStanModel #757

Open
fonnesbeck opened this issue May 24, 2024 · 1 comment
Open

Feature Request: Pass Stan model as string to CmdStanModel #757

fonnesbeck opened this issue May 24, 2024 · 1 comment

Comments

@fonnesbeck
Copy link

fonnesbeck commented May 24, 2024

Summary:

Add an optional argument for passing Stan model as string to CmdStanModel

Description:

It would be a huge convenience to be able to pass a Stan model to CmdStanModel as a string, rather than first having to write it to a file. Adding boilerplate code to write a string to a file from Python only to load it back for the model to use seems unnecessary from a user's standpoint. Happily you can pass the data to the model directly as a dict; you should be able to do the same for the model.

Current Version:

1.2.2

@WardBrian
Copy link
Member

This was last discussed here:
#513

The discussion at the time mainly focused on how Stan code is code, so it makes sense to live in its own files that can be separately version controlled etc.

I think the way we would implement this would also force you to re-compile each time Python got restarted, which is also downside to allowing this

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

No branches or pull requests

2 participants