Skip to content

Recomputing neighbors leaves a stale mapping matrix #91

Open

Description

@Marius1311

compute_neighbors and load_precomputed_distances replace self.knn but don't reset self._mapping_operator. map() only rebuilds the operator when it is None, so this silently uses weights from the old graph:

cm.map(obs_keys="celltype")
cm.compute_neighbors(n_neighbors=50)  # new graph
cm.map(obs_keys="celltype")         # still uses the old mapping matrix

Expected: setting a new knn invalidates _mapping_operator (e.g. reset it in both places, or make knn a property whose setter does so).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions