fix #330: PolySelection.export_high_res_area not working when 'add' button is not clicked#440
Draft
cursor[bot] wants to merge 1 commit intomainfrom
Draft
fix #330: PolySelection.export_high_res_area not working when 'add' button is not clicked#440cursor[bot] wants to merge 1 commit intomainfrom
cursor[bot] wants to merge 1 commit intomainfrom
Conversation
…xp_data when list_poly_selection_coors is empty The export_high_res_area method in PolySelection required users to click the 'add' button before exporting, but users who clicked 'export' directly would have self.selected_exp_data populated without list_poly_selection_coors being filled. This caused get_selected_areas() to raise an exception. Added _resolve_selected_areas() that tries list_poly_selection_coors first, then falls back to self.selected_exp_data, with a clear error message if neither is available. Co-authored-by: wanruiwen-genomics-cn <wanruiwen-genomics-cn@users.noreply.github.com>
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.
Summary
PolySelection.export_high_res_area()always callsget_selected_areas(), which requireslist_poly_selection_coorsto be populated via the "add" button. However, when users click the "export" button directly (via_download_callback),self.selected_exp_datais populated butlist_poly_selection_coorsremains empty. This causesget_selected_areas()to raiseException('Please select the data area in the picture first!')even though valid data has been selected and exported.Changes
stereo/plots/interact_plot/poly_selection.py:_resolve_selected_areas()method that trieslist_poly_selection_coorsfirst (viaget_selected_areas), then falls back toself.selected_exp_data, with a clear error message if neither is availableexport_high_res_area()to use_resolve_selected_areas()instead of directly callingget_selected_area_coors()/get_selected_areas()get_selected_area_coors()to use_resolve_selected_areas()for consistent behaviorVerification
Classification
Closes #330