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

Better Error Message for Python Interface Automatically Downloading BridgeStan Source #156

Closed
gil2rok opened this issue Jul 12, 2023 · 1 comment · Fixed by #157
Closed

Comments

@gil2rok
Copy link

gil2rok commented Jul 12, 2023

BridgeStan's Python interface can automatically download the BridgeStan source code "the first time you need it", as the documentation describes. In the code, this is performed by get_bridgestan_src() which is called by get_bridgestan_path which is called by compile_model(). Therefore "the first time you need" BridgeStan source code really means the first time a model is compiled.

While this makes sense, most of the (limited) BridgeStan examples I've seen begin with the set_bridgestan_path() function. When using BridgeStan for the first time, set_bridgestan_path() will call verify_bridgestan_path() and throw an error (since BridgeStan source code is not installed and get_bridgestan_src() was never called).

To resolve this issue, I had to dive into the source code and call get_bridgestan_src() manually. If indeed most BridgeStan projects begin with set_bridgestan_path(), I imagine many other new users may face the same issue.

I want to suggest two small improvements to fix this:

  1. In the documentation, replace "the first time you need it" with "the first time a model is compiled"
  2. Update the error message in verify_bridgestan_path() to suggest to users how to download the BridgeStan source code. Perhaps something like: "if this is your first time using BridgeStan, call get_bridgestan_src() immediately before the set_bridgestan_path() function." This may, however, negate the automatic downloading of BridgeStan source code that was intended in the first place.

Any suggestions or feedback is welcome.

@WardBrian
Copy link
Collaborator

WardBrian commented Jul 12, 2023

If indeed most BridgeStan projects begin with set_bridgestan_path(), I imagine many other new users may face the same issue.

The only reason to do this is if you are using your own version of bridgestan, such as checking out the source repository, in which case the 'downloaded for you' feature is already moot. If you're hoping to benefit from the automatic downloading, using set_bridgestan_path is never necessary (and in general would prevent it)

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

Successfully merging a pull request may close this issue.

2 participants