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: Don't clone Span in _init_tools #6387

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fix: Don't clone Span in _init_tools #6387

wants to merge 2 commits into from

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented Sep 24, 2024

Fixes #6386

image

@hoxbro hoxbro added the type: bug Something isn't correct or isn't working label Sep 24, 2024
@TheoMathurin
Copy link
Contributor

Thanks for the lightning fast fix!

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.49%. Comparing base (3b3f10f) to head (7f731c7).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6387   +/-   ##
=======================================
  Coverage   88.49%   88.49%           
=======================================
  Files         323      323           
  Lines       68304    68313    +9     
=======================================
+ Hits        60448    60457    +9     
  Misses       7856     7856           

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

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.

This is not safe. We clone models because a user provided Model can only be used within a single plot. What likely needs to happen is that instead of cloning and replacing the models on a per-plot basis we have to search the entire model graph and replace shared instances all at once.

@hoxbro
Copy link
Member Author

hoxbro commented Sep 25, 2024

Just to be sure, we still clone the CrosshairTool with tool = type(tool)(**properties). This is to avoid cloning overlay=height in the following. The span in overlay=[height, width] is not cloned.

This is an regression and was only reasonly introduced in #6220.

height = Span(dimension="height")
width = Span(dimension="width")
cht1 = CrosshairTool(overlay=[height, width])
cht2 = CrosshairTool(overlay=height)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken shared linked crosshair tool if set on one dimension only
3 participants