Skip to content

Add Harmony to scanpy#3953

Open
Intron7 wants to merge 13 commits intomainfrom
add-harmony
Open

Add Harmony to scanpy#3953
Intron7 wants to merge 13 commits intomainfrom
add-harmony

Conversation

@Intron7
Copy link
Member

@Intron7 Intron7 commented Jan 26, 2026

After recent changes from Harmonypy its necessary to move HarmonyBatchcorrection to scanpy. This function is based on harmony-pytorch and rapids-singlecell

@Intron7 Intron7 requested a review from flying-sheep January 26, 2026 09:50
@Intron7 Intron7 added this to the 1.12.1 milestone Jan 26, 2026
@Intron7 Intron7 marked this pull request as draft January 26, 2026 09:51
@codecov
Copy link

codecov bot commented Jan 26, 2026

Codecov Report

❌ Patch coverage is 94.40000% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.31%. Comparing base (af57cff) to head (88dca09).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/scanpy/preprocessing/_harmony/__init__.py 96.06% 9 Missing ⚠️
src/scanpy/preprocessing/_harmony_integrate.py 75.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3953      +/-   ##
==========================================
+ Coverage   77.96%   78.31%   +0.35%     
==========================================
  Files         118      119       +1     
  Lines       12517    12749     +232     
==========================================
+ Hits         9759     9985     +226     
- Misses       2758     2764       +6     
Flag Coverage Δ
hatch-test.low-vers 77.61% <94.40%> (+0.36%) ⬆️
hatch-test.pre 77.27% <94.40%> (+0.37%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/scanpy/external/pp/__init__.py 100.00% <ø> (ø)
src/scanpy/preprocessing/__init__.py 100.00% <100.00%> (ø)
src/scanpy/preprocessing/_harmony_integrate.py 75.00% <75.00%> (ø)
src/scanpy/preprocessing/_harmony/__init__.py 96.06% <96.06%> (ø)

Copy link
Member

@flying-sheep flying-sheep left a comment

Choose a reason for hiding this comment

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

Looks good! I fixed the docs and made the code a bit nicer, but the reference tests have been failing from the start. Any idea why? You said they work locally for you?

@Intron7 Intron7 marked this pull request as ready for review March 2, 2026 09:49
@Intron7
Copy link
Member Author

Intron7 commented Mar 2, 2026

so 0.05 for L2 was way to low harmony-pytorch is at 0.0511. we were at 0.0501. I also ran harmoypy once and it was at 0.063. so I set L2 to 0.1

@Intron7 Intron7 requested a review from flying-sheep March 2, 2026 10:07
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.

scanpy.external.pp.harmony_integrate incompatible with newly updated harmonypy>=0.1.0

2 participants