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 RealisticColors compositor upcasting data to float64 #2669

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

pnuu
Copy link
Member

@pnuu pnuu commented Dec 8, 2023

The RealisticColors compositor was upcasting the data to float64 (via np.where() usage). This PR fixes the issue, and adds the first test for the compositor.

  • Tests added

@pnuu pnuu added bug enhancement code enhancements, features, improvements component:compositors labels Dec 8, 2023
@pnuu pnuu self-assigned this Dec 8, 2023
@pnuu pnuu requested review from djhoese and mraspaud as code owners December 8, 2023 07:45
@pnuu
Copy link
Member Author

pnuu commented Dec 8, 2023

Creating the realistic_colors composite with main:
Screenshot 2023-12-08 at 09-47-55 Bokeh Plot

The same with this PR:
Screenshot 2023-12-08 at 09-49-23 Bokeh Plot

There's no change in memory usage, but the PR'd version is 17 seconds faster (20.0 s vs. 37 s).

Copy link

codecov bot commented Dec 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fbe017c) 95.31% compared to head (60a7c1b) 95.35%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2669      +/-   ##
==========================================
+ Coverage   95.31%   95.35%   +0.03%     
==========================================
  Files         371      371              
  Lines       52435    52451      +16     
==========================================
+ Hits        49980    50013      +33     
+ Misses       2455     2438      -17     
Flag Coverage Δ
behaviourtests 4.16% <0.00%> (-0.01%) ⬇️
unittests 95.96% <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

Pull Request Test Coverage Report for Build 7138733453

  • 20 of 20 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 95.916%

Totals Coverage Status
Change from base Build 7106990647: 0.03%
Covered Lines: 50139
Relevant Lines: 52274

💛 - Coveralls

Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

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

How did this never have tests before? Looks good to me. Thanks for fixing it.

One confusion: how does avoiding upcasting change the execution time so much?

@djhoese djhoese changed the title Fix RealisticColors compositor not to upcast data to float64 Fix RealisticColors compositor upcasting data to float64 Dec 8, 2023
@pnuu
Copy link
Member Author

pnuu commented Dec 11, 2023

One confusion: how does avoiding upcasting change the execution time so much?

My guess is that the tasks now interleave better with each other. The same can be observer with most of the other dtype and premature computation fixes I've made so far.

@pnuu pnuu merged commit 6f0a3ab into pytroll:main Dec 14, 2023
15 of 16 checks passed
@pnuu pnuu deleted the bugfix-realistic-colors-dtype branch December 14, 2023 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug component:compositors enhancement code enhancements, features, improvements
Projects
Development

Successfully merging this pull request may close these issues.

3 participants