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

Function warp_int

map.py:378–384  ·  view source on GitHub ↗
(a: np.ndarray, wx: np.ndarray, wy: np.ndarray)

Source from the content-addressed store, hash-verified

376
377
378def warp_int(a: np.ndarray, wx: np.ndarray, wy: np.ndarray) -> np.ndarray:
379 rows, cols = a.shape
380 rr = np.arange(rows, dtype=np.int32)[:, None]
381 cc = np.arange(cols, dtype=np.int32)[None, :]
382 r2 = np.clip(rr + wy.astype(np.int32), 0, rows - 1)
383 c2 = np.clip(cc + wx.astype(np.int32), 0, cols - 1)
384 return a[r2, c2]
385
386
387def hex_bfs_distance(mask_sources: np.ndarray) -> np.ndarray:

Callers 1

build_fieldsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected