-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Using p(x,n)
in the formula fails.
#444
Comments
Thanks for reporting the problem and also all the suggestions. This is not a problem with Bambi itself, but a problem with the formula parsing library, which we develop too. formulae has a bunch of built in functions that aim to simplify how you transform the data. Right now, when you call something, it first looks in the scope where the model is being constructed. If there's something with that name in there, it uses that thing. This is what is happening in your example. This behaviour allows you to override builtin functions. For example, formulae has a I think a nice fix would be to raise a warning when there's such a name conflict, but still use the builtin function. That would guide you to write a function with a name that does not conflict with the name of the builtin function in formulae. I'll try to fix this issue for the next release. |
@tomicapretto Seems like a reasonable thing to do. I can see it was a decision choice (up to a certain extent) but yeah, a warning message will likely be helpful. (I suspected as such about |
Let's keep this open until we have a fix. It may be helpful if someone else has the same problem. |
Fixed in bambinos/formulae#109 and available in formulae >= 0.5.3 |
Hello and thank you for your work in
bambi
, it is great.I noticed that when a variable
p
exists in the workspace,bambi
parsing fails if it needs to also use thep(x, n)
function for the response term. Model instantiation will try to use the variablep
already in the workpace. Please see a minimal example below.The full error is:
I am using the latest
bambi
/formulae
.Again, thank you for your work on
bambi
. This bug has a relatively easy work-around so it is not a show-stopper but I guess it would be better if it didn't exist. 😄PS: You might want to invest in having a minimal issues template for your git-repo, helps with the structure, makes it clear what information is needed, etc.
The text was updated successfully, but these errors were encountered: