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 stretch when min/max value it outside input data type #154

Merged
merged 2 commits into from Nov 26, 2023

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Nov 25, 2023

I noticed this while running some tests for my own project. I had a test case (not necessarily based on real-world use cases) where a uint8 array was divided by 500. In main this was converting 500 to the type of the array which was overflowing 500 to the uint8 version of it at 244 which produces unexpected final results.

  • Closes #xxxx (remove if there is no corresponding issue, which should only be the case for minor changes)
  • 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)
  • Fully documented (remove if this change should not be visible to users, e.g., if it is an internal clean-up, or if this is part of a larger project that will be documented later)

Copy link

codecov bot commented Nov 25, 2023

Codecov Report

Attention: 21 lines in your changes are missing coverage. Please review.

Comparison is base (a84299f) 91.50% compared to head (ba55be6) 91.53%.

Files Patch % Lines
trollimage/utilities.py 0.00% 21 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #154      +/-   ##
==========================================
+ Coverage   91.50%   91.53%   +0.02%     
==========================================
  Files          12       12              
  Lines        3969     3970       +1     
==========================================
+ Hits         3632     3634       +2     
+ Misses        337      336       -1     
Flag Coverage Δ
unittests 91.53% <38.23%> (+0.02%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@djhoese djhoese requested a review from pnuu November 25, 2023 20:40
@coveralls
Copy link

coveralls commented Nov 25, 2023

Coverage Status

coverage: 91.768% (+0.03%) from 91.74%
when pulling ba55be6 on djhoese:bugfix-stretch-int-overflow
into a84299f on pytroll:main.

@djhoese djhoese added the bug label Nov 25, 2023
@djhoese djhoese self-assigned this Nov 25, 2023
Copy link
Member

@pnuu pnuu left a comment

Choose a reason for hiding this comment

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

LGTM.

Thanks for fixing the formatting, I didn't realize I hadn't setup pre-commit on my local trollimage repo.

I was thinking that maybe we should create an issue about the reportedly untested functions, but none of them seem to be used in Trollimage.

@djhoese
Copy link
Member Author

djhoese commented Nov 26, 2023

Yeah I had no idea these other functions existed that flake8 was complaining about. I think they can be removed but it should probably be done in a separate PR and by someone else.

@djhoese djhoese merged commit 00c175b into pytroll:main Nov 26, 2023
25 of 26 checks passed
@djhoese djhoese deleted the bugfix-stretch-int-overflow branch November 26, 2023 16:28
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

3 participants