Skip to content

Fix tests#357

Merged
sophiamaedler merged 6 commits intomainfrom
fix_tests
Jan 26, 2026
Merged

Fix tests#357
sophiamaedler merged 6 commits intomainfrom
fix_tests

Conversation

@sophiamaedler
Copy link
Copy Markdown
Collaborator

Copilot AI review requested due to automatic review settings January 26, 2026 18:39
Copy link
Copy Markdown
Contributor

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.

Pull request overview

This PR fixes issues in the featurization pipeline related to mask-based intensity calculations. The changes address a bug where summed intensities were not properly handling NaN values from masked regions and were incorrectly normalizing by the last mask's area instead of each mask's own area.

Changes:

  • Fixed summed intensity calculation to use nansum instead of sum to properly handle masked (NaN) values
  • Fixed area normalization to use each mask's corresponding area instead of always using the last mask's area
  • Added comprehensive test coverage to verify correct intensity calculations and area normalization

Reviewed changes

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

File Description
src/scportrait/pipeline/featurization.py Fixed bug in intensity sum calculation and area normalization by using nansum and pairing masks with their corresponding areas
tests/unit_tests/pipeline/test_featurization.py Added test assertions to verify NaN handling and correct values for summed intensities with proper area normalization

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sophiamaedler sophiamaedler requested a review from Copilot January 26, 2026 19:28
Copy link
Copy Markdown
Contributor

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.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sophiamaedler sophiamaedler merged commit a0449dd into main Jan 26, 2026
2 checks passed
@sophiamaedler sophiamaedler deleted the fix_tests branch March 1, 2026 19:30
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.

pandas 3.0.0 breaks tests

2 participants