-
-
Notifications
You must be signed in to change notification settings - Fork 308
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 bug merging themes #4416
fix bug merging themes #4416
Conversation
Fix bug where input arg to `merge` is modified. Change `copy` -> `deepcopy`, which correctly handles copying of non-toplevel attributes like `Theme(Axis = (; titlesize=10))`. otherwise leftmost argument to `merge` is modified.
Thanks, this is something I've been unhappy with too. I think we'll need to review this rather carefully since it has the potential to subtly change which attributes get picked. I'm not sure if I trust CI to pick up on that, though maybe I'm underestimating it. We may also want to consider this breaking since users might already use |
That's fair. Though In any case, I'd enjoy seeing this fixed as it was causing some reproducibility issues in my code, and in the end, this (+#4419) made it hard to combine |
I don't expect many people to use merge and I also don't expect anyone to rely on this behavior. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked through all the merge
functions we call. As far as I can tell we always rely on merge!()
for Attributes/Themes, or cast to Dict beforehand. So I think this shouldn't cause any issues
deepcopy
correctly handles copying of non-toplevel attributes likeTheme(Axis = (; titlesize=10))
, otherwise leftmost argument tomerge
is modified.Description
Fixes the following bug in which
theme1
is being modified bymerge
:Type of change
Delete options that do not apply:
Checklist