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 rayleigh not preserving input dtype #195

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Sep 13, 2023

This was discussed briefly on slack, but I noticed that the rayleigh correction in Satpy causes 32-bit float inputs to become 64-bit float outputs after correction. This is mostly due to two things:

  1. The LUTs are 64-bit floats
  2. The multilinear interpolator has a dtype argument that wasn't being specified and defaults to float64.

This PR fixes both and includes an update to the pre-commit config. I also added pyspectral to pre-commit.ci so the pre-commit config should be automatically updated for us.

NOTE: This PR doesn't make a huge difference in performance, but it doesn't hurt either. I think the consistency alone is worth it.

  • Closes #xxxx
  • Tests added
  • Tests passed: Passes pytest pyspectral
  • Passes flake8 pyspectral
  • Fully documented

@djhoese djhoese added the bug label Sep 13, 2023
@djhoese djhoese self-assigned this Sep 13, 2023
@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Merging #195 (7630698) into main (e247cc2) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #195      +/-   ##
==========================================
+ Coverage   89.23%   89.27%   +0.03%     
==========================================
  Files          23       23              
  Lines        2536     2545       +9     
==========================================
+ Hits         2263     2272       +9     
  Misses        273      273              
Flag Coverage Δ
unittests 89.27% <100.00%> (+0.03%) ⬆️

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

Files Changed Coverage Δ
pyspectral/rayleigh.py 98.36% <100.00%> (+0.03%) ⬆️
pyspectral/tests/test_rayleigh.py 100.00% <100.00%> (ø)

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.

Pre commit is complaining, but otherwise lgtm

@mraspaud mraspaud merged commit b3b93b9 into pytroll:main Sep 21, 2023
16 checks passed
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