8000 fix: blob.py 2d intensities shape and pd.concat instead of append by shachafl · Pull Request #2064 · spacetx/starfish · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: blob.py 2d intensities shape and pd.concat instead of append #2064

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

Merged
merged 1 commit into from
Apr 16, 2025

Conversation

shachafl
Copy link
Collaborator

This closes #2003

Fixed 2 bugs in blob.py that were discovered when running the BlobDetector how-to example:
https://spacetx-starfish.readthedocs.io/en/latest/gallery/how_to/blob_detector.html#howto-blobdetector

  1. Replaced deprecated pandas append() with concat()
  2. Fixed the shape of intensities in 2d by adding the index z_inds as it is still used although it is set to zero.

@shachafl shachafl requested review from berl and Copilot April 11, 2025 18:05
@shachafl shachafl self-assigned this Apr 11, 2025
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

starfish/core/spots/FindSpots/blob.py:151

  • Verify that 'z_inds' is properly defined and matches the dimensions of data_image to avoid unexpected index errors.
intensities = data_image[tuple([z_inds, y_inds, x_inds])]

starfish/core/spots/FindSpots/blob.py:218

  • [nitpick] Consider explicitly specifying the 'axis' parameter (axis=0) in pd.concat() to ensure consistent row-wise concatenation, especially if DataFrame dimensions might vary.
merged_z_tables[(r, ch)] = pd.concat([merged_z_tables[(r, ch)], spot_attributes_list[i][0].spot_attrs.data])

Copy link
Collaborator
@berl berl left a comment

Choose a reason for hiding this comment

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

good catch! looks like this doesn't have test coverage- feel free to add some with another issue if time permits

@shachafl shachafl merged commit b8fdfa9 into master Apr 16, 2025
29 checks passed
@shachafl shachafl deleted the blob.py_fix branch April 16, 2025 16:13
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.

ValueError when running BlobDetector
2 participants
0