Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import squidpy as sq
gr.spatial_neighbors_radius
gr.spatial_neighbors_delaunay
gr.spatial_neighbors_grid
gr.GraphMatrixT
gr.SpatialNeighborsResult
gr.mask_graph
gr.nhood_enrichment
Expand Down Expand Up @@ -129,7 +128,6 @@ See the {doc}`extensibility guide </extensibility>` for how to implement a custo

gr.neighbors.GraphBuilder
gr.neighbors.GraphBuilderCSR
gr.neighbors.GraphMatrixT
gr.neighbors.GraphPostprocessor
gr.neighbors.DistanceIntervalPostprocessor
gr.neighbors.PercentilePostprocessor
Expand Down
2 changes: 0 additions & 2 deletions src/squidpy/gr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
from squidpy.gr._ppatterns import co_occurrence, spatial_autocorr
from squidpy.gr._ripley import ripley
from squidpy.gr._sepal import sepal
from squidpy.gr.neighbors import GraphMatrixT

__all__ = [
"GraphMatrixT",
"SpatialNeighborsResult",
"NhoodEnrichmentResult",
"neighbors",
Expand Down
10 changes: 4 additions & 6 deletions src/squidpy/gr/neighbors.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from abc import ABC, abstractmethod
from collections.abc import Callable, Sequence
from dataclasses import dataclass
from typing import Any, TypeVar, cast
from typing import Any, cast

import numpy as np
from fast_array_utils import stats as fau_stats
Expand All @@ -31,7 +31,6 @@
from squidpy._validators import assert_positive

__all__ = [
"GraphMatrixT",
"GraphBuilder",
"GraphBuilderCSR",
"GraphPostprocessor",
Expand All @@ -45,10 +44,9 @@
]


# Kept module-level (not folded into GraphBuilder's params): types the public
# `GraphPostprocessor` alias and is itself a public `squidpy.gr` export.
GraphMatrixT = TypeVar("GraphMatrixT")
GraphPostprocessor = Callable[[GraphMatrixT, GraphMatrixT], tuple[GraphMatrixT, GraphMatrixT]]
# Public PEP 695 type alias for graph postprocessors. The type parameter is
# scoped to the alias itself, so no module-level `TypeVar` is needed.
type GraphPostprocessor[GraphMatrixT] = Callable[[GraphMatrixT, GraphMatrixT], tuple[GraphMatrixT, GraphMatrixT]]


class GraphBuilder[CoordT, GraphMatrixT](ABC):
Expand Down
Loading