MCPcopy Create free account
hub / github.com/CompVis/zigma / traverse_grid_v1_continuous

Function traverse_grid_v1_continuous

utils/utils_zigzag.py:190–204  ·  view source on GitHub ↗
(N)

Source from the content-addressed store, hash-verified

188
189
190def traverse_grid_v1_continuous(N):
191 path = []
192 direction = "right" # initial direction
193 for i in range(N):
194 if direction == "right":
195 for j in range(N):
196 path.append(i * N + j)
197 if i != N - 1: # if not the last row
198 direction = "left"
199 elif direction == "left":
200 for j in range(N - 1, -1, -1):
201 path.append(i * N + j)
202 if i != N - 1: # if not the last row
203 direction = "right"
204 return [path, list(reversed(path))]
205
206
207def test_hibert_fig(num_dims=2, img_size_power=3):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected