cellmapper 0.2.5__tar.gz → 0.2.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. cellmapper-0.2.6/.github/PULL_REQUEST_TEMPLATE.md +24 -0
  2. cellmapper-0.2.6/.github/copilot-instructions.md +7 -0
  3. {cellmapper-0.2.5 → cellmapper-0.2.6}/.gitignore +1 -0
  4. {cellmapper-0.2.5 → cellmapper-0.2.6}/.pre-commit-config.yaml +3 -3
  5. cellmapper-0.2.6/AGENTS.md +77 -0
  6. {cellmapper-0.2.5 → cellmapper-0.2.6}/CHANGELOG.md +7 -0
  7. cellmapper-0.2.6/CLAUDE.md +5 -0
  8. {cellmapper-0.2.5 → cellmapper-0.2.6}/PKG-INFO +9 -7
  9. {cellmapper-0.2.5 → cellmapper-0.2.6}/README.md +1 -1
  10. cellmapper-0.2.6/REVIEW_GUIDE.md +74 -0
  11. cellmapper-0.2.6/docs/notebooks/tutorials/data_denoising.ipynb +924 -0
  12. cellmapper-0.2.6/docs/notebooks/tutorials/query_to_reference_mapping.ipynb +1030 -0
  13. cellmapper-0.2.6/docs/notebooks/tutorials/spatial_mapping.ipynb +923 -0
  14. cellmapper-0.2.6/docs/notebooks/tutorials/spatial_smoothing.ipynb +1216 -0
  15. {cellmapper-0.2.5 → cellmapper-0.2.6}/pyproject.toml +62 -42
  16. {cellmapper-0.2.5 → cellmapper-0.2.6}/src/cellmapper/model/evaluate.py +375 -41
  17. {cellmapper-0.2.5 → cellmapper-0.2.6}/src/cellmapper/model/kernel.py +1 -1
  18. {cellmapper-0.2.5 → cellmapper-0.2.6}/tests/conftest.py +19 -0
  19. cellmapper-0.2.6/tests/model/test_evaluate.py +294 -0
  20. cellmapper-0.2.5/.github/copilot-instructions.md +0 -206
  21. cellmapper-0.2.5/docs/notebooks/tutorials/data_denoising.ipynb +0 -813
  22. cellmapper-0.2.5/docs/notebooks/tutorials/query_to_reference_mapping.ipynb +0 -1029
  23. cellmapper-0.2.5/docs/notebooks/tutorials/spatial_mapping.ipynb +0 -926
  24. cellmapper-0.2.5/docs/notebooks/tutorials/spatial_smoothing.ipynb +0 -1228
  25. cellmapper-0.2.5/tests/model/test_evaluate.py +0 -55
  26. {cellmapper-0.2.5 → cellmapper-0.2.6}/.codecov.yaml +0 -0
  27. {cellmapper-0.2.5 → cellmapper-0.2.6}/.cruft.json +0 -0
  28. {cellmapper-0.2.5 → cellmapper-0.2.6}/.editorconfig +0 -0
  29. {cellmapper-0.2.5 → cellmapper-0.2.6}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  30. {cellmapper-0.2.5 → cellmapper-0.2.6}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  31. {cellmapper-0.2.5 → cellmapper-0.2.6}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  32. {cellmapper-0.2.5 → cellmapper-0.2.6}/.github/workflows/build.yaml +0 -0
  33. {cellmapper-0.2.5 → cellmapper-0.2.6}/.github/workflows/release.yaml +0 -0
  34. {cellmapper-0.2.5 → cellmapper-0.2.6}/.github/workflows/test.yaml +0 -0
  35. {cellmapper-0.2.5 → cellmapper-0.2.6}/.python-version +0 -0
  36. {cellmapper-0.2.5 → cellmapper-0.2.6}/.readthedocs.yaml +0 -0
  37. {cellmapper-0.2.5 → cellmapper-0.2.6}/.vscode/extensions.json +0 -0
  38. {cellmapper-0.2.5 → cellmapper-0.2.6}/.vscode/launch.json +0 -0
  39. {cellmapper-0.2.5 → cellmapper-0.2.6}/.vscode/settings.json +0 -0
  40. {cellmapper-0.2.5 → cellmapper-0.2.6}/LICENSE +0 -0
  41. {cellmapper-0.2.5 → cellmapper-0.2.6}/biome.jsonc +0 -0
  42. {cellmapper-0.2.5 → cellmapper-0.2.6}/docs/_static/.gitkeep +0 -0
  43. {cellmapper-0.2.5 → cellmapper-0.2.6}/docs/_static/css/custom.css +0 -0
  44. {cellmapper-0.2.5 → cellmapper-0.2.6}/docs/_static/images/cellmapper_logo_dark.svg +0 -0
  45. {cellmapper-0.2.5 → cellmapper-0.2.6}/docs/_static/images/cellmapper_logo_light.svg +0 -0
  46. {cellmapper-0.2.5 → cellmapper-0.2.6}/docs/_templates/.gitkeep +0 -0
  47. {cellmapper-0.2.5 → cellmapper-0.2.6}/docs/_templates/autosummary/class.rst +0 -0
  48. {cellmapper-0.2.5 → cellmapper-0.2.6}/docs/api.md +0 -0
  49. {cellmapper-0.2.5 → cellmapper-0.2.6}/docs/changelog.md +0 -0
  50. {cellmapper-0.2.5 → cellmapper-0.2.6}/docs/conf.py +0 -0
  51. {cellmapper-0.2.5 → cellmapper-0.2.6}/docs/contributing.md +0 -0
  52. {cellmapper-0.2.5 → cellmapper-0.2.6}/docs/extensions/typed_returns.py +0 -0
  53. {cellmapper-0.2.5 → cellmapper-0.2.6}/docs/index.md +0 -0
  54. {cellmapper-0.2.5 → cellmapper-0.2.6}/docs/notebooks/tutorials/index.rst +0 -0
  55. {cellmapper-0.2.5 → cellmapper-0.2.6}/docs/references.bib +0 -0
  56. {cellmapper-0.2.5 → cellmapper-0.2.6}/docs/references.md +0 -0
  57. {cellmapper-0.2.5 → cellmapper-0.2.6}/src/cellmapper/__init__.py +0 -0
  58. {cellmapper-0.2.5 → cellmapper-0.2.6}/src/cellmapper/_docs.py +0 -0
  59. {cellmapper-0.2.5 → cellmapper-0.2.6}/src/cellmapper/check.py +0 -0
  60. {cellmapper-0.2.5 → cellmapper-0.2.6}/src/cellmapper/constants.py +0 -0
  61. {cellmapper-0.2.5 → cellmapper-0.2.6}/src/cellmapper/logging.py +0 -0
  62. {cellmapper-0.2.5 → cellmapper-0.2.6}/src/cellmapper/model/_knn_backend.py +0 -0
  63. {cellmapper-0.2.5 → cellmapper-0.2.6}/src/cellmapper/model/cellmapper.py +0 -0
  64. {cellmapper-0.2.5 → cellmapper-0.2.6}/src/cellmapper/model/embedding.py +0 -0
  65. {cellmapper-0.2.5 → cellmapper-0.2.6}/src/cellmapper/model/mapping_operator.py +0 -0
  66. {cellmapper-0.2.5 → cellmapper-0.2.6}/src/cellmapper/model/neighbors.py +0 -0
  67. {cellmapper-0.2.5 → cellmapper-0.2.6}/src/cellmapper/utils.py +0 -0
  68. {cellmapper-0.2.5 → cellmapper-0.2.6}/tests/data/precomputed_leiden.csv +0 -0
  69. {cellmapper-0.2.5 → cellmapper-0.2.6}/tests/model/test_embedding.py +0 -0
  70. {cellmapper-0.2.5 → cellmapper-0.2.6}/tests/model/test_kernel.py +0 -0
  71. {cellmapper-0.2.5 → cellmapper-0.2.6}/tests/model/test_mapping_operator.py +0 -0
  72. {cellmapper-0.2.5 → cellmapper-0.2.6}/tests/model/test_neighbors.py +0 -0
  73. {cellmapper-0.2.5 → cellmapper-0.2.6}/tests/model/test_query_to_reference_mapping.py +0 -0
  74. {cellmapper-0.2.5 → cellmapper-0.2.6}/tests/model/test_self_mapping.py +0 -0
  75. {cellmapper-0.2.5 → cellmapper-0.2.6}/tests/test_basic.py +0 -0
  76. {cellmapper-0.2.5 → cellmapper-0.2.6}/tests/test_check.py +0 -0
  77. {cellmapper-0.2.5 → cellmapper-0.2.6}/tests/test_utils.py +0 -0
@@ -0,0 +1,24 @@
1
+ ## Summary
2
+
3
+ Describe the change in 2-5 sentences.
4
+
5
+ ## Behavior Or Invariants Changed
6
+
7
+ Call out any behavior changes and any repo invariants touched.
8
+ If none, say "None".
9
+
10
+ ## Tests Run
11
+
12
+ List the commands you ran and anything you intentionally did not run.
13
+
14
+ ## Reviewer Focus
15
+
16
+ Point reviewers to the highest-risk files, code paths, or assumptions.
17
+
18
+ ## Context
19
+
20
+ Add any domain context, dataset assumptions, or implementation background that is not obvious from the diff.
21
+
22
+ ## Open Questions Or Follow-Ups
23
+
24
+ List anything intentionally deferred, uncertain, or worth extra scrutiny.
@@ -0,0 +1,7 @@
1
+ # Copilot Instructions for CellMapper
2
+
3
+ Canonical repo guidance lives in:
4
+ - `AGENTS.md` — architecture, invariants, and validation commands
5
+ - `REVIEW_GUIDE.md` — PR review workflow, risk areas, and changed-path test lookup
6
+
7
+ If this file conflicts with those guides, the guides win.
@@ -16,6 +16,7 @@ uv.lock
16
16
 
17
17
  # Tests and coverage
18
18
  /data/
19
+ /tests/data/scanpy_cache/
19
20
  /node_modules/
20
21
  /.coverage*
21
22
 
@@ -7,16 +7,16 @@ default_stages:
7
7
  minimum_pre_commit_version: 2.16.0
8
8
  repos:
9
9
  - repo: https://github.com/biomejs/pre-commit
10
- rev: v2.3.10
10
+ rev: v2.4.16
11
11
  hooks:
12
12
  - id: biome-format
13
13
  exclude: ^\.cruft\.json$ # inconsistent indentation with cruft - file never to be modified manually.
14
14
  - repo: https://github.com/tox-dev/pyproject-fmt
15
- rev: v2.11.1
15
+ rev: v2.23.0
16
16
  hooks:
17
17
  - id: pyproject-fmt
18
18
  - repo: https://github.com/astral-sh/ruff-pre-commit
19
- rev: v0.14.11
19
+ rev: v0.15.16
20
20
  hooks:
21
21
  - id: ruff-check
22
22
  types_or: [python, pyi, jupyter]
@@ -0,0 +1,77 @@
1
+ # AGENTS.md — CellMapper
2
+
3
+ CellMapper is a Python package for k-NN-based mapping of cells across
4
+ representations to transfer labels, embeddings, and expression values. It works
5
+ for millions of cells, on CPU and GPU, across molecular modalities, and between
6
+ spatial and non-spatial data. The core idea is to separate the method (k-NN
7
+ graph + kernel → mapping matrix) from the application (transfer across arbitrary
8
+ representations).
9
+ Key frameworks: AnnData/Scanpy, numpy/scipy, scikit-learn, pynndescent, faiss,
10
+ RAPIDS cuML.
11
+
12
+ ## Trust Order
13
+
14
+ When sources disagree:
15
+ 1. PR description and changed code
16
+ 2. This file (`AGENTS.md`)
17
+ 3. `REVIEW_GUIDE.md`
18
+ 4. Tests and fixtures
19
+ 5. Public docs in `docs/` and `README.md`
20
+
21
+ Every fact should have one owner. This file owns invariants and the reference
22
+ table below — everything else is delegated.
23
+
24
+ ## Where To Find What
25
+
26
+ | Topic | Source of truth |
27
+ |-------|----------------|
28
+ | User-facing overview, use cases, quickstart | `README.md` |
29
+ | Public API reference | `docs/api.md` and autosummary under `docs/generated/` |
30
+ | Tutorials (query→reference, spatial mapping, spatial smoothing, data denoising) | `docs/notebooks/tutorials/` |
31
+ | Contributor setup, environments, docs build | `docs/contributing.md` |
32
+ | Release notes | `docs/changelog.md` |
33
+ | PR review workflow and risk areas | `REVIEW_GUIDE.md` |
34
+ | Test fixtures | `tests/conftest.py`, `tests/data/` |
35
+ | Kernel taxonomy and tunable thresholds (sklearn warning cutoff, spectral threshold) | `src/cellmapper/constants.py` |
36
+ | Optional-dependency gating | `src/cellmapper/check.py` |
37
+ | Method-level behavior (parameters, return shapes) | docstrings in `src/cellmapper/model/` |
38
+
39
+ ## Review Guidelines
40
+
41
+ For GitHub PR reviews, use `REVIEW_GUIDE.md` as the canonical review workflow and
42
+ source of review-specific risk areas, testing checks, and documentation-impact checks.
43
+ This file only owns the project invariants and source-of-truth map below.
44
+
45
+ ## Critical Invariants
46
+
47
+ - **Self-mapping mode** activates when `reference is None` **or** `reference is query` (object identity). See `CellMapper.__init__` in `src/cellmapper/model/cellmapper.py`.
48
+ - **Reference is read-only.** `.map()` never mutates the reference AnnData. `query` is mutated in place for `map_obs` / `map_obsm`. Expression transfer produces a separate `query_imputed` AnnData object, not a view.
49
+ - **Output key naming** follows `{key}{prediction_postfix}` and `{key}{confidence_postfix}` in `query.obs` / `query.obsm`. Postfixes are user-controllable on the per-method entrypoints (`map_obs`, `map_obsm`); `.map()` also exposes `prediction_postfix`.
50
+ - **`.map()` auto-chains** `compute_neighbors` → `compute_mapping_matrix` → `map_obs/obsm/layers` based on missing state. Callers that use these methods directly must respect that ordering.
51
+ - **Mapping matrix is row-stochastic and float32.** Sparse inputs are stored as `scipy.sparse.csr_matrix`; dense inputs stay dense. Zero-neighbor rows are left as-is. See `MappingOperator._validate_and_normalize_mapping_matrix`.
52
+ - **Matrix powers `t > 1` are self-mapping-only** (`MappingOperator._validate_power` raises otherwise).
53
+ - **Optional k-NN backends fail fast.** `check.check_deps()` is called at backend construction with clear install hints — no silent fallback. Supported backends: `sklearn`, `pynndescent`, `faiss-cpu`, `faiss-gpu`, `rapids`.
54
+ - **Kernel taxonomy lives in `constants.py`** (`JACCARD_BASED_KERNELS`, `CONNECTIVITY_BASED_KERNELS`, `SELF_MAPPING_ONLY_KERNELS`). Kernels in `SELF_MAPPING_ONLY_KERNELS` require a square neighbor matrix.
55
+ - **`Neighbors` strips self-edges** from storage for square matrices; `n_neighbors` counts non-self neighbors.
56
+ - **`query_imputed` is always assembled via `utils.create_imputed_anndata`**. Setter accepts `AnnData | ndarray | csr_matrix | DataFrame | None`; result has `obs`/`obsm` from query and `var`/`varm` from reference.
57
+ - **Public API surface = `__init__.py` `__all__`**: `CellMapper`, `Kernel`, `Neighbors`, `logger`. `EvaluationMixin` and `EmbeddingMixin` are internal. Do not re-export helpers from the top-level package.
58
+ - **Tests mirror source layout.** `src/cellmapper/X.py` → `tests/test_X.py`; `src/cellmapper/model/X.py` → `tests/model/test_X.py`.
59
+
60
+ ## Development Commands
61
+
62
+ Python 3.12 and 3.14 (see the `hatch-test` matrix in `pyproject.toml`).
63
+
64
+ ```bash
65
+ hatch test # run tests (highest Python)
66
+ hatch test --all # full matrix
67
+ hatch run docs:build # build Sphinx docs
68
+ pre-commit run --all-files # lint and format
69
+ ```
70
+
71
+ Focused runs (with `uv`):
72
+
73
+ ```bash
74
+ uv run pytest tests/model
75
+ uv run pytest tests/model/test_mapping_operator.py
76
+ uv run pytest tests/test_utils.py
77
+ ```
@@ -10,6 +10,13 @@ and this project adheres to [Semantic Versioning][].
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ### Changed
14
+ - Dropped Python 3.11 support; the minimum supported version is now Python 3.12, aligning with `cellrank` (≥2.1 requires Python ≥3.12) and unpinning the `tutorials` extra from the old `cellrank` 2.0.7 {pr}`81`
15
+ - The `gpcca-fast` dependency group now delegates `petsc4py`/`slepc4py` to `cellrank[petsc]>=2.3.1` (mpi4py-free) instead of hardcoding them, keeping only an explicit `slepc` to work around slepc4py's missing runtime metadata {pr}`82`
16
+
17
+ ### Fixed
18
+ - Fixed intermittent `OSError: Can't synchronously read data (filter returned failure during read)` when running the test suite under `pytest -n auto`, caused by xdist workers racing on scanpy's shared `pbmc3k_raw.h5ad` dataset cache. Each worker now uses its own cache directory.
19
+
13
20
  ## [v0.2.5]
14
21
 
15
22
  ### Added
@@ -0,0 +1,5 @@
1
+ # CellMapper Agent Entry Point
2
+
3
+ @AGENTS.md
4
+
5
+ Use `REVIEW_GUIDE.md` for automated PR review workflow, risk areas, and changed-path test lookup.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cellmapper
3
- Version: 0.2.5
3
+ Version: 0.2.6
4
4
  Summary: k-NN-based mapping of cells across representations
5
5
  Project-URL: Documentation, https://cellmapper.readthedocs.io/
6
6
  Project-URL: Homepage, https://github.com/quadbio/cellmapper
@@ -30,11 +30,10 @@ License: MIT License
30
30
  SOFTWARE.
31
31
  License-File: LICENSE
32
32
  Classifier: Programming Language :: Python :: 3 :: Only
33
- Classifier: Programming Language :: Python :: 3.11
34
33
  Classifier: Programming Language :: Python :: 3.12
35
34
  Classifier: Programming Language :: Python :: 3.13
36
35
  Classifier: Programming Language :: Python :: 3.14
37
- Requires-Python: >=3.11
36
+ Requires-Python: >=3.12
38
37
  Requires-Dist: anndata>=0.11
39
38
  Requires-Dist: docrep
40
39
  Requires-Dist: numpy
@@ -52,6 +51,7 @@ Provides-Extra: doc
52
51
  Requires-Dist: docutils!=0.18.*,!=0.19.*,<0.22,>=0.8; extra == 'doc'
53
52
  Requires-Dist: ipykernel; extra == 'doc'
54
53
  Requires-Dist: ipython; extra == 'doc'
54
+ Requires-Dist: ipywidgets; extra == 'doc'
55
55
  Requires-Dist: myst-nb>=1.1; extra == 'doc'
56
56
  Requires-Dist: pandas; extra == 'doc'
57
57
  Requires-Dist: setuptools; extra == 'doc'
@@ -68,16 +68,18 @@ Requires-Dist: coverage>=7.10; extra == 'test'
68
68
  Requires-Dist: faiss-cpu; extra == 'test'
69
69
  Requires-Dist: pytest; extra == 'test'
70
70
  Requires-Dist: pytest-cov; extra == 'test'
71
- Requires-Dist: squidpy>=1.6; extra == 'test'
71
+ Requires-Dist: pytest-mock; extra == 'test'
72
+ Requires-Dist: squidpy>=1.8; extra == 'test'
72
73
  Provides-Extra: tutorials
74
+ Requires-Dist: cellrank>=2; extra == 'tutorials'
73
75
  Requires-Dist: harmony-pytorch; extra == 'tutorials'
74
76
  Requires-Dist: igraph; extra == 'tutorials'
75
77
  Requires-Dist: netgraph; extra == 'tutorials'
76
78
  Requires-Dist: python-louvain; extra == 'tutorials'
77
79
  Requires-Dist: scvi-tools>=1.3; extra == 'tutorials'
78
80
  Requires-Dist: seaborn; extra == 'tutorials'
79
- Requires-Dist: sopa>=2; extra == 'tutorials'
80
- Requires-Dist: squidpy>=1.6; extra == 'tutorials'
81
+ Requires-Dist: sopa>=2.2; extra == 'tutorials'
82
+ Requires-Dist: squidpy>=1.8; extra == 'tutorials'
81
83
  Description-Content-Type: text/markdown
82
84
 
83
85
  # CellMapper
@@ -114,7 +116,7 @@ The core idea of `CellMapper` is to separate the method (k-NN graph with some ke
114
116
 
115
117
  ## 📦 Installation
116
118
 
117
- You need to have 🐍 Python 3.11 or newer installed on your system.
119
+ You need to have 🐍 Python 3.12 or newer installed on your system.
118
120
  If you don't have Python installed, we recommend installing [uv][].
119
121
 
120
122
  There are two alternative options to install ``cellmapper``:
@@ -32,7 +32,7 @@ The core idea of `CellMapper` is to separate the method (k-NN graph with some ke
32
32
 
33
33
  ## 📦 Installation
34
34
 
35
- You need to have 🐍 Python 3.11 or newer installed on your system.
35
+ You need to have 🐍 Python 3.12 or newer installed on your system.
36
36
  If you don't have Python installed, we recommend installing [uv][].
37
37
 
38
38
  There are two alternative options to install ``cellmapper``:
@@ -0,0 +1,74 @@
1
+ # CellMapper Review Guide
2
+
3
+ Agent-neutral PR review playbook. Written for **review agents running on GitHub** — use the imperative voice.
4
+
5
+ **Scope: review only.** Produce comments and suggestions. Do **not** push commits, modify files, or apply fixes. Flag issues and suggest diffs in comments; leave the edits to the author.
6
+
7
+ Architecture, invariants, and commands live in `AGENTS.md`. Do not restate them here — link.
8
+
9
+ ## Workflow
10
+
11
+ 1. Read the PR body.
12
+ 2. Check CI (`gh pr checks <num>`, `gh run view <run-id> --log-failed`) and investigate failures before commenting.
13
+ 3. Map changed paths to tests (see below) and check whether the change touches an invariant from `AGENTS.md`.
14
+ 4. Prioritize behavioral regressions, numerical correctness, and public-contract changes over style.
15
+
16
+ ## High-Risk Areas
17
+
18
+ Pointers only — see `AGENTS.md` for the actual invariants.
19
+
20
+ - **Mapping-matrix construction** (`model/mapping_operator.py`): normalization, dtype, sparsity handling. Silent shifts possible without test failures.
21
+ - **Matrix powers / diffusion** (`model/mapping_operator.py`, `_validate_power`, `_apply_iterative`, `_apply_spectral`): self-mapping gate, iterative-vs-spectral behavior.
22
+ - **Self-mapping detection** (`model/cellmapper.py::CellMapper.__init__`): identity check drives all downstream mode-dependent logic.
23
+ - **Kernel taxonomy** (`constants.py`, `model/kernel.py`, `model/neighbors.py`): new kernels must land in the right set in `constants.py`.
24
+ - **k-NN backend gating** (`model/_knn_backend.py`, `check.py`): optional deps must route through `check.check_deps()`.
25
+ - **AnnData output contract** (`model/cellmapper.py::map_obs / map_obsm / map_layers`): key naming, what gets written where, `query_imputed` construction via `utils.create_imputed_anndata`.
26
+ - **Public API surface** (`src/cellmapper/__init__.py`): new re-exports commit the project to an API.
27
+
28
+ ## Changed-Path Test Lookup
29
+
30
+ Tests mirror the source tree.
31
+
32
+ | Changed path | Primary tests |
33
+ |--------------|---------------|
34
+ | `src/cellmapper/model/cellmapper.py` | `tests/model/test_query_to_reference_mapping.py`, `tests/model/test_self_mapping.py` |
35
+ | `src/cellmapper/model/kernel.py` | `tests/model/test_kernel.py` |
36
+ | `src/cellmapper/model/mapping_operator.py` | `tests/model/test_mapping_operator.py` |
37
+ | `src/cellmapper/model/neighbors.py` | `tests/model/test_neighbors.py` |
38
+ | `src/cellmapper/model/embedding.py` | `tests/model/test_embedding.py` |
39
+ | `src/cellmapper/model/evaluate.py` | `tests/model/test_evaluate.py` |
40
+ | `src/cellmapper/model/_knn_backend.py` | `tests/model/test_neighbors.py`, `tests/model/test_kernel.py` |
41
+ | `src/cellmapper/check.py` | `tests/test_check.py` |
42
+ | `src/cellmapper/utils.py` | `tests/test_utils.py` |
43
+ | End-to-end behavioral change | also `tests/test_basic.py` |
44
+ | Fixture changes | `tests/conftest.py`, `tests/data/` |
45
+
46
+ ## Testing
47
+
48
+ - **New code** should be covered. Reuse fixtures from `tests/conftest.py`; prefer `pytest.mark.parametrize`; favor few meaningful tests over many redundant ones.
49
+ - **Failing CI** is not to be waved through. Distinguish critical regressions from flakes; escalate critical ones.
50
+ - **Modified tests** — scrutinize *how*. Relaxed tolerances, removed assertions, deleted cases, or loosened matrices are red flags. Require explicit justification in the PR body.
51
+
52
+ ## Documentation Impact
53
+
54
+ Behavior or API changes often touch docs in multiple places. Point at the **owning file** (see the `AGENTS.md` "Where To Find What" table) — don't duplicate content in the review.
55
+
56
+ - Public symbol / API changes → `docs/api.md`, autosummary, `README.md` quickstart, source docstrings.
57
+ - Contributor workflow or env changes → `docs/contributing.md`.
58
+ - Tutorials under `docs/notebooks/tutorials/` → flag stale imports, outputs, or API usage.
59
+ - Invariants / commands → `AGENTS.md`.
60
+ - Review workflow / risk areas / test lookup → this file.
61
+ - `CLAUDE.md` and `.github/copilot-instructions.md` should stay thin pointers — flag any PR that re-adds content here.
62
+
63
+ ## Checklist
64
+
65
+ - Invariants in `AGENTS.md` preserved?
66
+ - CI green (or failures investigated)?
67
+ - Test coverage adequate and not silently weakened?
68
+ - Public contracts (AnnData output, mapping matrix format, public API surface) unchanged — or explicitly called out in the PR body?
69
+ - Affected human- and agent-facing docs updated?
70
+ - PR scope tight, no unrelated bundling?
71
+
72
+ ## PR Metadata
73
+
74
+ This repo uses `.github/PULL_REQUEST_TEMPLATE.md`. Treat its sections as the preferred summary surface.