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

Add better dtype preservation in astronomy functions with numpy 2 #155

Closed
wants to merge 6 commits into from

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Jun 21, 2024

Using numpy 2 is revealing a lot of spots in the astronomy functions where 32-bit floats/datetimes are being promoted/upcasted to 64-bit floats. This PR is an overhaul of type annotations and tests and dtype checks in order to try to clean this up a bit. But with all the type annotations it has started to get less clean. I've always had trouble though with understanding what arguments were what type so hopefully this is a start toward better descriptions of those.

  • Closes #xxxx
  • Tests added
  • Tests passed
  • Passes flake8 pyorbital
  • Fully documented

@djhoese djhoese added the bug label Jun 21, 2024
@djhoese djhoese self-assigned this Jun 21, 2024
Copy link

codecov bot commented Jun 21, 2024

Codecov Report

Attention: Patch coverage is 92.47312% with 7 lines in your changes missing coverage. Please review.

Project coverage is 88.02%. Comparing base (18340ca) to head (23ada80).
Report is 32 commits behind head on main.

Files with missing lines Patch % Lines
pyorbital/astronomy.py 92.30% 4 Missing ⚠️
pyorbital/tests/test_astronomy.py 92.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #155      +/-   ##
==========================================
+ Coverage   87.51%   88.02%   +0.51%     
==========================================
  Files          14       14              
  Lines        2210     2247      +37     
==========================================
+ Hits         1934     1978      +44     
+ Misses        276      269       -7     
Flag Coverage Δ
unittests 88.02% <92.47%> (+0.51%) ⬆️

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

Coverage Status

coverage: 87.965% (+0.4%) from 87.562%
when pulling 23ada80 on djhoese:bugfix-dtype-promotion
into 83e029a on pytroll:main.

@mraspaud
Copy link
Member

closing this one, as it is not relevant right now anymore. Feel free to reopen in the situation changes.

@mraspaud mraspaud closed this Jun 26, 2024
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.

3 participants