fastFM icon indicating copy to clipboard operation
fastFM copied to clipboard

Get rid of C assertions please

Open quantverse opened this issue 8 years ago • 1 comments

Hello,

this project should just get rid of C assertions completely (they should be replaced by some better, reliable error handling techniques.) I use this library from python and it crashes whole script when assertion fails.

Example: when it does not like something in your data (whatever that is), it just crashes with assertion like this:

python3: ffm_als_mcmc.c:172: sparse_fit: Assertion `(sizeof (*w_0) == sizeof (float) ? __finitef (*w_0) : sizeof (*w_0) == sizeof (double) ? __finite (*w_0) : __finitel (*w_0)) && "w_0 not finite"' failed.

Which crashes the python script completely without any possibility to recover from the error. This should never happen. It should throw an exception instead so the script may recover if it catches the exception. Until then, fastFM cannot be used in any automated complex applications.

quantverse avatar Jan 30 '17 13:01 quantverse

Thank you for your kind words. A contributions removing the assertions would indeed be very welcome. A good place to start would be this issue: https://github.com/ibayer/fastFM/issues/88

ibayer avatar Jan 30 '17 13:01 ibayer