Closed pnuu closed 1 month ago
This was the original log message when defusedxml
was not installed for avhrr_l1b_eps
reader. Note that the crucial info - missing defusedxml
library - is reported in a DEBUG
level message.
[DEBUG: 2024-10-16 11:01:28 : satpy.readers.yaml_reader] Reading ('/home/lahtinep/Software/pytroll/pytroll_packages/satpy/satpy/etc/readers/avhrr_l1b_eps.yaml',)
[INFO: 2024-10-16 11:01:28 : satpy.readers] Cannot use ['/home/lahtinep/Software/pytroll/pytroll_packages/satpy/satpy/etc/readers/avhrr_l1b_eps.yaml']
[DEBUG: 2024-10-16 11:01:28 : satpy.readers] while constructing a Python object
cannot find module 'satpy.readers.eps_l1b' (No module named 'defusedxml')
in "/home/lahtinep/Software/pytroll/pytroll_packages/satpy/satpy/etc/readers/avhrr_l1b_eps.yaml", line 144, column 22
[WARNING: 2024-10-16 11:01:28 : satpy.readers] Don't know how to open the following files: {'/home/lahtinep/data/satellite/polar/avhrr_l1b_nat/AVHR_xxx_1B_M01_20241015100703Z_20241015114603Z_N_O_20241015105547Z.nat'}
Traceback (most recent call last):
File "/home/lahtinep/bin/test_avhrr_l1b_nat.py", line 16, in <module>
main()
File "/home/lahtinep/bin/test_avhrr_l1b_nat.py", line 12, in main
scn = Scene(reader="avhrr_l1b_eps", filenames=[fname])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lahtinep/Software/pytroll/pytroll_packages/satpy/satpy/scene.py", line 155, in __init__
self._readers = self._create_reader_instances(filenames=filenames,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lahtinep/Software/pytroll/pytroll_packages/satpy/satpy/scene.py", line 176, in _create_reader_instances
return load_readers(filenames=filenames,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lahtinep/Software/pytroll/pytroll_packages/satpy/satpy/readers/__init__.py", line 590, in load_readers
_check_reader_instances(reader_instances)
File "/home/lahtinep/Software/pytroll/pytroll_packages/satpy/satpy/readers/__init__.py", line 629, in _check_reader_instances
raise ValueError("No supported files found")
ValueError: No supported files found
Attention: Patch coverage is 93.33333%
with 3 lines
in your changes missing coverage. Please review.
Project coverage is 96.08%. Comparing base (
b8991c0
) to head (3db6547
). Report is 112 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
satpy/readers/__init__.py | 86.95% | 3 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Is there a more fine-grained exception we could catch instead, for just building objects (which probably mean a missing import)?
I don't know. I'll have a look after figuring out the CodeScene complaint.
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
satpy/readers/init.py | 20 | 23 | 86.96% | ||
<!-- | Total: | 42 | 45 | 93.33% | --> |
Totals | |
---|---|
Change from base Build 11324402105: | 0.007% |
Covered Lines: | 52708 |
Relevant Lines: | 54803 |
https://github.com/pytroll/satpy/pull/2931/commits/ca987bc50a932b15192f483062f554562bf700bc should make CodeScene happier. Later today I'll look if there are more fine-grained failures we could check for, but I have a feeling there is none as YAMLError
was there also originally.
ConstructorError
seems to work perfectly :+1:
Curently PyYAML hides import errors in instantiated classes, and these are only logged at
DEBUG
level. This PR changes the log level toERROR
for these cases.