Refactor some functions in histogram tools#395
Closed
jo-mueller wants to merge 7 commits intoconnect_histogram_optional_featuresfrom
Closed
Refactor some functions in histogram tools#395jo-mueller wants to merge 7 commits intoconnect_histogram_optional_featuresfrom
jo-mueller wants to merge 7 commits intoconnect_histogram_optional_featuresfrom
Conversation
for more information, see https://pre-commit.ci
…github.com/BiAPoL/napari-clusters-plotter into refactor-some-functions-in-histogram-tools
5 tasks
Collaborator
|
Hi @jo-mueller , That's great! Thinks seem to be working! I found only one new bug: When I draw a cluster, then change the Hue to something non-categorical, and draw again, the MANUAL_CLUSTER_ID is brought back correctly, but my first selection is lost. |
Collaborator
Author
|
Argh ok if I'm only making it worse with my refactorings then maybe we should just merge #390 and then take it from there 😅. |
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.
@zoccoler small refactoring changes to #390. I changed the baplotter dependency to the branch on the repo to make sure that tests can pass, will change it as soon as 0.3.1 is released.
PS: I tested the functionality manually and everything seems to work. Tests are passing locally.
Long copilot description
This pull request refactors the color management logic in the
napari_clusters_plotterwidget to improve clarity and maintainability. Key changes include replacing redundant methods, simplifying color application, and introducing a new utility function for layer color updates.Refactoring and Simplification:
_on_show_plot_overlaymethod with a direct connection to_update_layer_colors, removing unnecessary indirection in handling theshow_color_overlay_signal. [1] [2]_update_layer_colorsmethod by consolidating logic for applying default and indexed colors, and removing redundant code paths.Utility Function Addition:
_apply_layer_colorutility function to centralize the logic for applying colors to layers, improving code reuse and readability.Code Cleanup:
_set_layer_colormethod and inlined its functionality into_apply_layer_color, as it was no longer needed._resetmethod from its previous location and moved its functionality into a new definition, aligning it with the refactored_update_layer_colorslogic. [1] [2]