zoj613 / htnorm

Fast and Exact Simulation of Hyperplane-Truncated Multivariate Normal Distributions, with C, Python and R interfaces.
BSD 3-Clause "New" or "Revised" License
11 stars 4 forks source link

BUG: Exceptions are not explicitly raised in python when validating output. #26

Closed zoj613 closed 2 years ago

zoj613 commented 2 years ago

https://github.com/zoj613/htnorm/blob/ef1f2e415f5c692e19735578c7ee3ecf81a42c3e/pyhtnorm/_htnorm.pyx#L98-L109

Since this cython function has void return type, the raised exception is not propagated properly and thus gets treated as a warning.

To remedy this, the function should return an int. A value of zero when everything checks out and probably a -1 otherwise.