Skip to content

deep copy in make_browser_figure#119

Merged
thekugelmeister merged 3 commits intomainfrom
read_browser_y_index_bug
Nov 26, 2025
Merged

deep copy in make_browser_figure#119
thekugelmeister merged 3 commits intomainfrom
read_browser_y_index_bug

Conversation

@thekugelmeister
Copy link
Collaborator

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 dataframe y_index column 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.

Copy link
Collaborator

@OberonDixon OberonDixon left a comment

Choose a reason for hiding this comment

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

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.

@thekugelmeister thekugelmeister merged commit 8d31ec0 into main Nov 26, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants