Closed Nin17 closed 6 months ago
Thanks for opening this issue. This indeed feels like a bug. Would you be willing to try and fix this yourself?
I finally had some time to resurrect the CI, and merged this ticket in.
The code itself looks fine, and it is certainly a bug, but I don't think that in real situations it would have led to incorrect values being generated, given that when CS_Photo_Partial
errors out (which is going to be due to the excitation energy being too low to excite the M sub-shell), then the other P*
parameters passed to the function will already be 0.
Thanks again for your contribution! I plan on making an xraylib release later this week
In the error-handling section of the documentation, it states that
If you are not interested in the error message, feel free to simply pass NULL, and rely on the return value of the function, since 0.0 (or NULL in some cases) is returned when an error occurred:
...This is perfectly fine, and is fact recommended if speed execution speed is paramount.
. However, the functions PM3_auger_cascade_kissel and PM4_auger_cascade_kissel do not return0.0
when an error has occurred inCS_Photo_Partial
as they are missing the lines:that are present in every other function in the file.
Python code demonstrating the problem (tested with xraylib from conda-forge versions 4.1.0 - 4.1.3):
Output: