AshKelly / pyquad

A lightweight, parallel python wrapper for the GSL integration library
GNU General Public License v3.0
13 stars 1 forks source link

Exceptionss that can be raised in Python #4

Closed Jammy2211 closed 4 years ago

Jammy2211 commented 4 years ago

When I integrate a very elliptical mass profile, I get the following GSL error:

/home/jammy/PycharmProjects/VirtualEnvs/PyAuto/bin/python3 /home/jammy/PycharmProjects/PyAuto/PyAutoLens/test_autolens/numerics/deflections/sersic.py
gsl: pyquad/integration/qags.c:562: ERROR: integral is divergent, or slowly convergent
Default GSL error handler invoked.

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

Unfortunately, I can't bypass this exception using a try / except in Python, as the error is within pyquad and crashes the code.

Is there a neat way to stop this from crashing the code or returning a Python exception?

AshKelly commented 4 years ago

Yea there is. The master branch actually should fix this and output a python warning using the code Arnau wrote.

I'll just check through the code and make sure the tests are all ok and then push a release

Jammy2211 commented 4 years ago

Christmas came early!