Skip to content

UMAP: pass compatibility_layout=True explicitly and record it (#644) - #648

Merged
guijacquemet merged 2 commits into
mainfrom
claude/umap-compat-layout
Nov 26, 2026
Merged

guijacquemet merged 2 commits into
mainfrom
claude/umap-compat-layout

Conversation

@guijacquemet

@guijacquemet guijacquemet commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes #644 (owner decision: pass the argument explicitly, with True for now).

What changed

  • embedding._umap passes compatibility_layout=True to umap.UMAP explicitly (one constant, embedding.COMPATIBILITY_LAYOUT), for the maps' UMAP and the UMAP the populations (question 10) are clustered on.
  • Embeddings and populations do not change. True is the umap-learn 0.5 layout and the 0.6 default; the value is now explicit, so a later umap-learn default cannot change them silently.
  • The value is recorded as compatibility_layout in the settings of embed and find_populations, beside n_neighbors, min_dist and random_state.
  • Floor raised to umap-learn>=0.6.
  • CHANGELOG entry. docs/common/function_index.jsonl regenerated.
  • Tests: test_umap_is_built_with_compatibility_layout_explicitly (patches umap.UMAP, asserts the kwarg is present and True at both call sites; fails if it is removed or differs), test_the_settings_record_the_umap_layout, and test_the_settings_record_the_umap_layout_the_populations_were_found_on.
  • Cache/provenance identity: no embedding is cached and no cache key or run identity includes the UMAP settings (only lru_caches on statistics helpers), so nothing earlier can be reused. Nothing to fix.

Why not False yet

With False (the layout umap-learn plans as its default), HDBSCAN split one cloud into 41 clusters and named no main population. Measured with umap-learn 0.6.0 on 2160 Gaussian cells plus a 240-cell separate blob: True gives 2 clusters (2161 and 239 cells); False gives 41 (largest 358 cells, 300 unassigned). No cluster passes MAIN_SHARE 0.5, so no P1 is named; the 238-cell group is still found. Three existing population tests failed on False for this reason and pass on True. The switch is deferred; revisit False together with retuning the populations.

Golden outputs

None updated.

Tests run (umap-learn 0.6.0, Python 3.13)

  • Embedding/populations/discovery/guards/function-guard/tool/feature-table files (233 tests): 233 passed, 0 failed, 0 skipped.
  • Report/guided/scale/feature-table variants/spec pin (143 tests): 143 passed, 0 failed, 0 skipped.
  • ruff check and ruff format --check: clean. tools/audit.py --check-against origin/main: baselines only tightened. tools/check.py does not exist in this repository. The full suite was not run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a

umap-learn 0.6 warns that the default of compatibility_layout will change.
embedding._umap now passes compatibility_layout=False, the value is recorded
as "compatibility_layout" in the settings of embed and find_populations, and
the floor is umap-learn>=0.6.

False changes the UMAP coordinates compared with earlier runs, and the
populations found on them. Tests that guard the argument and the recorded
setting are added; function_index.jsonl regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
Owner decision: pass compatibility_layout=True, so embeddings and populations
are unchanged and no installed umap-learn default decides the layout. False
split one Gaussian cloud into 41 HDBSCAN clusters and named no main
population, so it is deferred until the populations are retuned with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
@guijacquemet guijacquemet changed the title UMAP: pass compatibility_layout=False explicitly and record it (#644) UMAP: pass compatibility_layout=True explicitly and record it (#644) Nov 26, 2026
@guijacquemet
guijacquemet marked this pull request as ready for review November 26, 2026 06:36
@guijacquemet
guijacquemet merged commit 90488b8 into main Nov 26, 2026
2 checks passed
@guijacquemet
guijacquemet deleted the claude/umap-compat-layout branch November 26, 2026 06:36
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.

UMAP: set compatibility_layout explicitly (umap-learn 0.6 warns its default will change)

2 participants