Skip to content

Commit

Permalink
Merge pull request #2944 from pnuu/fix-palettize-adding-fill-value-at…
Browse files Browse the repository at this point in the history
…tribute

Fix tests using `palettize`
  • Loading branch information
mraspaud authored Oct 21, 2024
2 parents d6d4406 + b9a2f4d commit 9b4f1f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions satpy/tests/enhancement_tests/test_enhancements.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ def run_and_check_enhancement(func, data, expected, **kwargs):
old_keys = set(pre_attrs.keys())
# It is OK to have "enhancement_history" added
new_keys = set(img.data.attrs.keys()) - {"enhancement_history"}
# In case of palettes are used, _FillValue is added.
# Colorize doesn't add the fill value, so ignore that
if "palettes" in kwargs and func.__name__ != "colorize":
assert "_FillValue" in new_keys
# Remove it from further comparisons
new_keys = new_keys - {"_FillValue"}
assert old_keys == new_keys

res_data_arr = img.data
Expand Down

0 comments on commit 9b4f1f4

Please sign in to comment.