Closed zmunro closed 2 years ago
Thank you for the suggestion. It brought my attention back to some rather old code and a pattern that could use some cleaning up.
This is by design, as the message is captured and raised later only if the user explicitly asks for this type via infer_reader
or related module function. In particular, this is platform-dependent code (Windows only, must install optional dependency and have a 3rd party proprietary COM C++ DLL installed and registered) but it must be imported to register the reader type and how to check if it is the right format for any given file.
I do see that if you try to instantiate an instance of thermo_raw.ThermoRawLoader
when the comtypes
wrapper fails to import, it will fail with a NameError
because _ThermoRawFileAPI
won't be defined. That should be replaced with another placeholder when it's not available that re-raises that error as well.
Did you encounter this issue by directly instantiating thermo_raw.ThermoRawLoader
?
The error is now at least acknowledged more carefully in the public interface code.
Thank you again for reporting this.
If this import doesn't succeed, it is currently failing silently. The error message should be logged or raised.
https://github.com/mobiusklein/ms_deisotope/blob/dd83276bee3b85aac64075c07edce696fe5a51b0/ms_deisotope/data_source/thermo_raw.py#L120