satpy icon indicating copy to clipboard operation
satpy copied to clipboard

Landsat MSS reader `_get_matched_dataset_info` bug fix

Open simonreise opened this issue 1 month ago • 7 comments

Function _get_matched_dataset_info should return only dataset info, not a tuple of (True, info)

  • [ ] Closes #xxxx
  • [x] Tests added
  • [ ] Fully documented
  • [ ] Add your name to AUTHORS.md if not there already

simonreise avatar Nov 14 '25 18:11 simonreise

Thanks! ...but how has this ever worked?

djhoese avatar Nov 14 '25 18:11 djhoese

Tests were not failing, because we test only B4 band, and for B4 it worked correctly, hahah

simonreise avatar Nov 14 '25 18:11 simonreise

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 96.33%. Comparing base (ee989f6) to head (dc624b0). :warning: Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3300   +/-   ##
=======================================
  Coverage   96.33%   96.33%           
=======================================
  Files         463      463           
  Lines       58870    58880   +10     
=======================================
+ Hits        56711    56722   +11     
+ Misses       2159     2158    -1     
Flag Coverage Δ
behaviourtests 3.60% <0.00%> (-0.01%) :arrow_down:
unittests 96.42% <100.00%> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Nov 14 '25 18:11 codecov[bot]

Pull Request Test Coverage Report for Build 19578152038

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.002%) to 96.411%

Files with Coverage Reduction New Missed Lines %
tests/reader_tests/test_landsat.py 1 99.8%
<!-- Total: 1
Totals Coverage Status
Change from base Build 19515384246: 0.002%
Covered Lines: 56600
Relevant Lines: 58707

💛 - Coveralls

coveralls avatar Nov 14 '25 18:11 coveralls

  1. If you have it, could you paste the error message you were getting before you fixed this?
  2. Would it be possible to add a test for this?

djhoese avatar Nov 14 '25 18:11 djhoese

I already do not have an exact error message, but it crased on this line from satpy/readers/core/yaml_reader.py

coordinates = ds_info.get("coordinates")

with error like tuple does not have a "get" method

We can add additional band tests, like testing also B5 for Landsat 1 and B3 for Landsat 4

simonreise avatar Nov 14 '25 19:11 simonreise

I added testing "B5" band for Landsat 1 and "B3" for Landsat 4, by adding the corresponding fixtures for these bands and trying to open them in test_basicload. But now probably thermal_name arg should be renamed to something more general, as previously it was used only to open thermal bands, and now it is also used to open additional bands for MSS products

simonreise avatar Nov 21 '25 17:11 simonreise