tschoonj / xraylib

A library for X-ray matter interaction cross sections for X-ray fluorescence applications
https://github.com/tschoonj/xraylib/wiki
Other
120 stars 54 forks source link

Ignore Warning on Python #115

Closed badruk closed 4 years ago

badruk commented 5 years ago

When using the library I get this warning each time I try to delve into compounds, would it be possible to ignore it?

xraylib-parser: invalid character detected ,
CS_Total_CP: CompoundParser failed. Trying NIST compound database.

A Warning would be useful when the utility fails at finding a match: if it does in fact it just returns a 0 instead of a warning/error

tschoonj commented 5 years ago

Hi @badruk

This is already fixed in master, and will be included in the next release. For now, I recommend you just disable all warnings:

xraylib.SetErrorMessages(0)
tschoonj commented 4 years ago

Closing, let me know if you have any other questions.