Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix geotiff scale/offset failing for non-linear enhancements #103

Merged
merged 1 commit into from
Mar 4, 2022

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Mar 4, 2022

The geotiff scale_offset_tags looks through the enhancement_history and gathers all scale/offset information. If an enhancement doesn't have those then the entire saving operation fails. This makes batch processing difficult where I would like all datasets that can have scale/offset tags to have them, but any that don't to not fail but still be produced.

This PR fixes this by turning the error into a DEBUG logger message. I would say it could be a warning, but I'm not sure how I feel about that since it is the desired output I want. Additionally, I'm not sure I like the cleanliness of my code in this, but couldn't think of anything better.

  • Tests added (for all bug fixes or enhancements)
  • Tests passed (for all non-documentation changes)
  • Passes git diff origin/master **/*py | flake8 --diff (remove if you did not edit any Python files)

@djhoese djhoese added the bug label Mar 4, 2022
@djhoese djhoese requested a review from mraspaud March 4, 2022 14:37
@djhoese djhoese self-assigned this Mar 4, 2022
@codecov
Copy link

codecov bot commented Mar 4, 2022

Codecov Report

Merging #103 (b995860) into main (00cdfc4) will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #103      +/-   ##
==========================================
+ Coverage   92.39%   92.47%   +0.07%     
==========================================
  Files          10       10              
  Lines        3406     3415       +9     
==========================================
+ Hits         3147     3158      +11     
+ Misses        259      257       -2     
Flag Coverage Δ
unittests 92.47% <100.00%> (+0.07%) ⬆️

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

Impacted Files Coverage Δ
trollimage/tests/test_image.py 100.00% <100.00%> (ø)
trollimage/xrimage.py 88.42% <100.00%> (+0.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 00cdfc4...b995860. Read the comment docs.

Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mraspaud mraspaud merged commit 230cc5e into pytroll:main Mar 4, 2022
@djhoese djhoese deleted the bugfix-scale-offset-gamma branch March 4, 2022 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants