-
-
Notifications
You must be signed in to change notification settings - Fork 404
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 linking elements that are transformed by a Compositor #6003
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6003 +/- ##
==========================================
+ Coverage 88.61% 88.62% +0.01%
==========================================
Files 315 315
Lines 65593 65630 +37
==========================================
+ Hits 58122 58165 +43
+ Misses 7471 7465 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I reverted the changes made and in 96fa479 applied another better fix found by @philippjfr (thanks!) |
great work! works well for me |
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. |
Fixes #5908
The issue to fix could basically be simplified as linking a rasterized element to any other element:
rasterize
generatesImage
elements which have at least oneCompositor
registered, e.g.apply_nodata
. TheCompositor
transformation is applied in the following lines. I noticed that, in the example above, the_plot_id
value of theDynamicMap
changed afterobj.map(...)
is executed, but not of the left (target)Curve
. And indeed, re-setting "manually" the original_plot_id
value of theDynamicMap
allowed the link to be correctly setup.holoviews/holoviews/core/options.py
Lines 1002 to 1004 in 7a4fc21
The
obj.map(...)
call is pretty complex, however, the issue can be reproduced with a much simpler version that doesn't involve anyCompositor
. In this example the mapped operation is a bare identity function anddatashade
is used instead ofrasterize
to avoid involving anyCompositor
. This is enough for the code to fail at linking the elements:I tried to adjust
LabelledData.map()
so that it doesn't break the links but I wasn't very successful. So instead I decided to just try to reset the_plot_id
values afterobj.map(...)
is called, and it worked. Interestingly that also allowed to remove theOverlay.clone
override added in #5881, as in that PR this override was only necessary to link from anImage
to anOverlay
, which is now covered by the fix from this PR.Trying this fix against the code provided in the issue:
@philippjfr :
LabelledData.map()
(that callsobj.clone(shared=False)
which prevent the links from being preserved IIUC) or in some other place.