Skip to content

Fix HNOCA kernel to be the squared Jarrad kernel#65

Merged
Marius1311 merged 1 commit intomainfrom
Marius1311/hnoca-kernel-squared
Apr 1, 2026
Merged

Fix HNOCA kernel to be the squared Jarrad kernel#65
Marius1311 merged 1 commit intomainfrom
Marius1311/hnoca-kernel-squared

Conversation

@Marius1311
Copy link
Copy Markdown
Member

Closes #64

Summary

  • Changes denominator in the HNOCA kernel from 2 * n_neighbors to 4 * n_neighbors, making HNOCA exactly the Jarrad kernel squared

Details

The HNOCA kernel is defined as the Jarrad kernel squared. The Jarrad kernel normalizes overlap as:

overlap / (4k - overlap)

Previously, the HNOCA base expression used 2k instead of 4k before squaring, which deviated from the original HNOCA-tools implementation. This single-character fix aligns it correctly.

The HNOCA kernel should equal the Jarrad kernel squared. The base
expression before squaring was using `2 * n_neighbors` in the
denominator, but Jarrad uses `4 * n_neighbors`. Aligning the
denominator makes HNOCA = Jarrad^2, faithful to the original
HNOCA-tools implementation.

Co-Authored-By: Claude <noreply@anthropic.com>
@Marius1311
Copy link
Copy Markdown
Member Author

FYI @zhisonghe

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.37%. Comparing base (d3197f0) to head (f1a40b4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #65   +/-   ##
=======================================
  Coverage   86.37%   86.37%           
=======================================
  Files          13       13           
  Lines        1387     1387           
=======================================
  Hits         1198     1198           
  Misses        189      189           
Files with missing lines Coverage Δ
src/cellmapper/model/kernel.py 89.05% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Marius1311 Marius1311 merged commit 1b3f5d6 into main Apr 1, 2026
9 checks passed
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.

Fix HNOCA kernel to be the squared Jarrad kernel

1 participant