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 fail-fast for datasets outside the visible extent #1345

Merged
merged 2 commits into from
Jun 14, 2024

Conversation

raphaelquast
Copy link
Contributor

@raphaelquast raphaelquast commented Jun 13, 2024

While trying to improve datashader integration with EOmaps I ran into the following problem:

At the moment, DSArtist.make_image() does not check if the data is actually contained within the visible extent before attempting to create an image.

This results in a huge performance penalty if a large number of datasets are present in a figure but only a few are actually in the visible extent. (e.g. during pan-zoom etc.)

This PR addresses this issue by evaluating the data-bbox on DSArtist initialization and then using it to fast-exit DSArtist.make_image() in case no data is in the extent.

Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

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

Looks great to me!

Copy link

codecov bot commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.30%. Comparing base (7f31d04) to head (33e333e).

Files Patch % Lines
datashader/mpl_ext.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1345      +/-   ##
==========================================
- Coverage   90.31%   90.30%   -0.01%     
==========================================
  Files          92       92              
  Lines       18579    18582       +3     
==========================================
+ Hits        16779    16781       +2     
- Misses       1800     1801       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@raphaelquast
Copy link
Contributor Author

Awesome! Thanks for the really quick response!

Copy link
Member

@jbednar jbednar left a comment

Choose a reason for hiding this comment

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

Thanks so much for the contribution! I can't spot any reason not to merge this.

@raphaelquast
Copy link
Contributor Author

raphaelquast commented Jun 13, 2024

Nice! Thanks for having a look!

As i see it, the only drawback that might be relevant is that coordinate limits are now always evaluated while before it was possible to circuumvent the evaluation by passing explicit values for x_range and y_range.

@jbednar
Copy link
Member

jbednar commented Jun 13, 2024

Seems like an OK tradeoff to me.

@philippjfr philippjfr merged commit 2abbda3 into holoviz:main Jun 14, 2024
16 checks passed
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