MCPcopy Create free account
hub / github.com/Astropulse/hexmap / neighbor_count

Function neighbor_count

map.py:460–461  ·  view source on GitHub ↗
(mask: np.ndarray, r: int, c: int)

Source from the content-addressed store, hash-verified

458
459
460def neighbor_count(mask: np.ndarray, r: int, c: int) -> int:
461 return sum(1 for rr, cc in hex_neighbors(r, c, mask.shape[0], mask.shape[1]) if mask[rr, cc])
462
463
464def prune_specks(cfg: Config, mask: np.ndarray, tag: str, passes: int, kill_prob: float = 0.70) -> np.ndarray:

Callers 2

prune_specksFunction · 0.85
thin_mountainsFunction · 0.85

Calls 1

hex_neighborsFunction · 0.85

Tested by

no test coverage detected