astropy/astropy — pull request #2390 by bsipocz (2014-04-29 23:53:29+00:00)
Title: Change assert statements to raise error in modelling code

I've run into a surprising blank AssertionError with a code using `modeling/polinomial.py`. In that case it could have been a more informative TypeError or similar (I gave less than the expected number of parameters).

Checking the modeling module, there was a few asserts which, as I [understand] (https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement), shouldn't be in the non-test codes in the first place. So with this PR all assert statements have been changed to raise errors instead, and I tried to add an error message where it was missing.