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 most warnings during tests #157

Merged
merged 9 commits into from
Dec 16, 2023
Merged

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Dec 15, 2023

In an effort to catch issues sooner, this PR configures pytest to error on any warnings. This is configured in pyproject.toml. This PR also includes a fix for the weber fechner stretching method where data was not clipped to what should be considered the minimum input stimuli (s0).

The 2 errors that are globally ignored by pytest are:

    "ignore::rasterio.errors.NotGeoreferencedWarning",
    # remove after #149 is merged
    "ignore:invalid value encountered in cast:RuntimeWarning",

The first one is to ignore all the times our test save to a geotiff but don't include an AreaDefinition so no geotransform information is set. This happens in so many spots I didn't want to try to fix them all in this PR and I'm not sure it is worth the time and effort.

The second, as mentioned in the comment, should be fixed when #149 gets merged.

  • 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)

@djhoese djhoese added the bug label Dec 15, 2023
@djhoese djhoese requested a review from mraspaud December 15, 2023 16:15
@djhoese djhoese self-assigned this Dec 15, 2023
utcnow is deprecated in Python 3.12
Copy link

codecov bot commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cb62b3b) 91.60% compared to head (3a9f1ca) 91.57%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #157      +/-   ##
==========================================
- Coverage   91.60%   91.57%   -0.03%     
==========================================
  Files          12       12              
  Lines        4004     4014      +10     
==========================================
+ Hits         3668     3676       +8     
- Misses        336      338       +2     
Flag Coverage Δ
unittests 91.57% <100.00%> (-0.03%) ⬇️

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.

@coveralls
Copy link

coveralls commented Dec 15, 2023

Coverage Status

coverage: 91.808% (-0.03%) from 91.838%
when pulling 3a9f1ca on djhoese:remove-test-warnings
into cb62b3b on pytroll:main.

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!

@pnuu
Copy link
Member

pnuu commented Dec 15, 2023

The first one is to ignore all the times our test save to a geotiff but don't include an AreaDefinition so no geotransform information is set. This happens in so many spots I didn't want to try to fix them all in this PR and I'm not sure it is worth the time and effort.

I added the area defs for writer tests in Satpy. If I get bored, I could start adding them also on Trollimage tests.

@djhoese
Copy link
Member Author

djhoese commented Dec 16, 2023

I added the area defs for writer tests in Satpy. If I get bored, I could start adding them also on Trollimage tests.

I got a little nervous changing the tests because I know Martin modified some in his PR and didn't want to cause too many conflicts. Let me see how many there are...33 test failures.

@djhoese djhoese merged commit 7f24250 into pytroll:main Dec 16, 2023
23 of 26 checks passed
@djhoese djhoese deleted the remove-test-warnings branch December 16, 2023 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

4 participants