deep copy in make_browser_figure#119
Merged
thekugelmeister merged 3 commits intomainfrom Nov 26, 2025
Merged
Conversation
OberonDixon
requested changes
Nov 26, 2025
Collaborator
OberonDixon
left a comment
There was a problem hiding this comment.
This seems like a fine approach to me. The change I am requesting is to get rid of or make non-redundant the .copy() operation, which I believe currently is creating a copy that does not then get used.
I assume that the normal level of copying depth that gets applied by .assign is ok, because we aren't making in-place modifications to python objects (such as numpy arrays) downstream in the pipeline. If I am misremembering though then it could be that we need a deeper copying operation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Avoid modifying the input dataframe in
make_browser_figure, to avoid a bug where it was impossible to rerun the browser figure with collapsing reads until the input dataframey_indexcolumn was reset to be non-unique.The current (very simple) implementation of this fix relies on a deep copy operation, meaning that for very large datasets this may cause memory issues. I do not foresee this being the bottleneck for read browsing; by the time this becomes an issue the browser itself may be completely inoperable. However, I am leaving the space for a different fix to be implemented if this is a problem.
Addressing this issue in some other way will require a rewrite of the plotting logic, as the column in question is referenced inside of a different groupby operation.