@@ -61,7 +61,9 @@ cpdef int distance(H3int h1, H3int h2) except -1:
61
61
62
62
check_for_error(
63
63
h3lib.gridDistance(h1, h2, & distance)
64
- )
64
+ ) # todo: should this raise a distance error?
65
+
66
+ # s = 'Cells are too far apart to compute distance: {} and {}'
65
67
66
68
return distance
67
69
@@ -258,6 +260,8 @@ cpdef H3int[:] uncompact(const H3int[:] hc, int res):
258
260
)
259
261
)
260
262
263
+ # todo: again! doesn't work if i have this before the error check!
264
+ # why isn't hmm.to_mv() robust to failures before it?
261
265
mv = hmm.to_mv()
262
266
263
267
return mv
@@ -314,7 +318,7 @@ cpdef double cell_area(H3int h, unit='km^2') except -1:
314
318
return area
315
319
316
320
317
- cdef _could_not_find_line (err, start, end):
321
+ cdef could_not_find_line (err, start, end):
318
322
msg = " Couldn't find line between cells {} and {}"
319
323
msg = msg.format(hex (start), hex (end))
320
324
@@ -329,12 +333,12 @@ cpdef H3int[:] line(H3int start, H3int end):
329
333
# probably applies to all size/work pairs of functions...
330
334
err = h3lib.gridPathCellsSize(start, end, & n)
331
335
332
- _could_not_find_line (err, start, end)
336
+ could_not_find_line (err, start, end)
333
337
334
338
hmm = H3MemoryManager(n)
335
339
err = h3lib.gridPathCells(start, end, hmm.ptr)
336
340
337
- _could_not_find_line (err, start, end)
341
+ could_not_find_line (err, start, end)
338
342
339
343
# todo: probably here too?
340
344
mv = hmm.to_mv()
0 commit comments