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

Fixes to ensure streams are correctly mapped to plots #6415

Merged
merged 6 commits into from
Oct 18, 2024

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Oct 17, 2024

This fix addresses a tricky situation where nested overlays were not resolved correctly because it would simply keep recursing until it got to the last layer. This meant the resulting subplot(s) would not update. We now still do the recursing (though if I spent a lot more time on this we maybe wouldn't have to do so), but also record all the streams along the way.

Also fixes a separate bug where during zorder assignment we did not take into account DynamicMaps that had an (Nd)Overlay as input, which would confuse the zorder assignment and therefore meant that streams would be assigned to the wrong plot (or no plot at all).

Fixes #5595
Fixes #5434

  • Add test

@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Oct 17, 2024
Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.50%. Comparing base (f9c7f05) to head (81323a7).
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6415      +/-   ##
==========================================
+ Coverage   88.48%   88.50%   +0.01%     
==========================================
  Files         323      323              
  Lines       68469    68599     +130     
==========================================
+ Hits        60588    60711     +123     
- Misses       7881     7888       +7     

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

Copy link
Member

@maximlt maximlt left a comment

Choose a reason for hiding this comment

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

Very happy to see #5595 being fixed! Overall LGTM (made some minor optional suggestions).

I was not able to see whether the OP example in #5434 is fixed as there seems to be some issues with the box edit tool, I can't create any selection.

@philippjfr make sure the PR title is updated based on your last changes since it seems the recursion is still done.

Technically spit_dmap_overlay is public as documented on the website (https://holoviews.org/reference_manual/holoviews.plotting.html#holoviews.plotting.util.split_dmap_overlay) so that's a breaking change. No one's probably using so I don't think it's an issue, the release notes might just include a comment on that.

@@ -202,6 +202,13 @@ def test_dynamic_compute_overlayable_zorders_mixed_dynamic_and_non_dynamic_ndove
self.assertIn(curve, sources[2])
self.assertNotIn(ndoverlay, sources[2])

def test_dynamic_compute_overlayable_zorders_ndoverlays_as_input(self):
Copy link
Member

@maximlt maximlt Oct 18, 2024

Choose a reason for hiding this comment

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

Does this test cover the two bugs fixed by the PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Had real trouble finding a smaller reproducible example for the first issue.

@philippjfr
Copy link
Member Author

I was not able to see whether the OP example in #5434 is fixed as there seems to be some issues with the box edit tool, I can't create any selection.

The UX of drawing boxes has changed in Bokeh (in quite a non-obvious way). You have to hold down shift and then draw.

Co-authored-by: Maxime Liquet <35924738+maximlt@users.noreply.github.com>
@philippjfr philippjfr changed the title Ensure decomposition of DynamicMap overlay does not recurse Fixes to ensure streams are correctly mapped to plots Oct 18, 2024
@philippjfr
Copy link
Member Author

I'm going to merge this and follow up with tests in a bit as I have to get the RC out asap.

@philippjfr philippjfr enabled auto-merge (squash) October 18, 2024 13:23
@philippjfr philippjfr disabled auto-merge October 18, 2024 15:05
@philippjfr philippjfr enabled auto-merge (squash) October 18, 2024 15:05
@philippjfr philippjfr disabled auto-merge October 18, 2024 15:05
@philippjfr philippjfr merged commit 4061614 into main Oct 18, 2024
13 of 14 checks passed
@philippjfr philippjfr deleted the overlay_split_bug branch October 18, 2024 15:05
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

datashader and rasterize=True not updating all layers BoxEdit stream not updating 2nd, 3rd ... box
2 participants