update var by dist normalization - #1065
Open
LLehner wants to merge 3 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1065 +/- ##
==========================================
- Coverage 78.62% 78.61% -0.02%
==========================================
Files 63 63
Lines 9330 9325 -5
Branches 1557 1557
==========================================
- Hits 7336 7331 -5
Misses 1422 1422
Partials 572 572
🚀 New features to boost your workflow:
|
timtreis
reviewed
Nov 22, 2025
| df["obs"] = adata.obs_names | ||
|
|
||
| # store dataframes by (slide, anchor) combination and also the corresponding maximum distance for normalization | ||
| # store dataframes by (slide, anchor) combinationq |
Member
|
Can you describe the issue you're solving here better and then also translate this into a test? |
Member
Author
Previous normalization was useless as it just changed the the distance values to be within [0,1] without actually changing the scale. Now the distances from categories with a lower maximum are stretched to be comparable. This doesn't affect the raw distances which are still provided when running this function. I will add a test. |
Member
Replace the per-slide sklearn MinMaxScaler with a plain divide-by-max. The preceding loop already forces each slide's minimum distance to 0, so (x - min) / (max - min) reduces to x / max: the output is identical, minus the sklearn.preprocessing dependency and the unused max_distances bookkeeping. Also fix the stale comment and lock the per-slide normalization contract (every slide stretched to a max distance of 1) with a regression test that would fail under global cross-slide normalization. Forward-ports #1065 onto current main. Co-authored-by: LLehner <LLehner@users.noreply.github.com>
timtreis
force-pushed
the
update_var_by_dist_normalization
branch
from
August 12, 2026 23:06
f7b8b2e to
6245dc2
Compare
for more information, see https://pre-commit.ci
The v0.8.0 template sync (#1257) deleted docs/extensions/typed_returns.py, which renders numpy-style Returns type annotations as clean cross-references. Without it, public functions annotated '-> NDArray' emit an unresolvable numpy._typing._array_like.NDArray reference, and the docs build (run with -W) fails. This is why main's Read the Docs build is currently red. Restore the extension and re-register it in conf.py. Verified green with a full 'sphinx-build -M html docs docs/_build -W'.
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.

Distances to anchor point are now actually normalized for each slide respectively.