pyro-ppl / brmp

Bayesian Regression Models in Pyro
Apache License 2.0
70 stars 8 forks source link

Replace assertions used to signal error with exceptions with better messages #7

Open null-a opened 5 years ago

null-a commented 5 years ago

At some point, I'm hoping to make a pass through all of the code fixing as many of these as I can.

neerajprad commented 5 years ago

From #54:


Currently a formula like 'y ~ a * b' will throw an assertion error during code generation. Maybe we can recognize * as a valid Op but throw an NotImplementedError if we see it being used in the formula.

File "/Users/npradhan/workspace/pyro_dev/brmp/brmp/formula.py", line 208, in rpn2ast
    assert len(out) == 1
AssertionError