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 requiring newer numpy just for typing annotations #1649

Merged
merged 2 commits into from
Apr 22, 2021

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Apr 22, 2021

The numpy.typing subpackage was added in numpy 1.20 it seems. Satpy should still be able to support older versions of numpy. This PR adds a try/except around the numpy.typing that I added in #1646 for these older versions.

  • Closes #xxxx
  • Tests added
  • Fully documented

@djhoese djhoese requested a review from mraspaud April 22, 2021 12:10
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.

How about putting this in _compat.py?

@djhoese
Copy link
Member Author

djhoese commented Apr 22, 2021

Done

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

@codecov
Copy link

codecov bot commented Apr 22, 2021

Codecov Report

Merging #1649 (8a7f333) into master (9257378) will decrease coverage by 0.00%.
The diff coverage is 60.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1649      +/-   ##
==========================================
- Coverage   92.63%   92.62%   -0.01%     
==========================================
  Files         258      258              
  Lines       37843    37847       +4     
==========================================
+ Hits        35055    35057       +2     
- Misses       2788     2790       +2     
Flag Coverage Δ
behaviourtests 4.84% <60.00%> (+0.02%) ⬆️
unittests 92.76% <60.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
satpy/_compat.py 81.81% <50.00%> (-18.19%) ⬇️
satpy/enhancements/__init__.py 97.50% <100.00%> (ø)

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 9257378...8a7f333. Read the comment docs.

@ch-k
Copy link
Contributor

ch-k commented Apr 22, 2021

Works for me with (numpy 1.19.5).

@djhoese djhoese merged commit b564e0c into pytroll:master Apr 22, 2021
@djhoese djhoese deleted the bugfix-numpy-typing branch April 22, 2021 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants