Skip to content

Commit 910eefa

Browse files
committed
updated mypy comments using copilot
1 parent 522b4ad commit 910eefa

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

openptv_python/correspondences.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,9 @@ def take_best_candidates(
438438

439439
# Sort candidates by match quality (.corr)
440440
src.sort(order="corr") # by corr
441-
src = src[::-1] # reverse order
441+
src[:] = np.flip(
442+
src, axis=0
443+
) # reverse order in-place while preserving recarray type
442444

443445
# Take candidates from the top to the bottom of the sorted list
444446
# Only take if none of the corresponding targets have been used
@@ -665,7 +667,7 @@ def correspondences(
665667
)
666668

667669
match_counts[1] = take_best_candidates(
668-
con0, con[match_counts[3] :], cpar.num_cams, tim
670+
con0, con[match_counts[3] :].view(np.recarray), cpar.num_cams, tim
669671
)
670672
match_counts[3] += match_counts[1]
671673

@@ -675,7 +677,7 @@ def correspondences(
675677
corr_list, cpar.num_cams, frm.num_targets, vpar.corrmin, con0, 4 * nmax, tim
676678
)
677679
match_counts[2] = take_best_candidates(
678-
con0, con[match_counts[3] :], cpar.num_cams, tim
680+
con0, con[match_counts[3] :].view(np.recarray), cpar.num_cams, tim
679681
)
680682
match_counts[3] += match_counts[2]
681683

openptv_python/track.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ def sorted_candidates_in_volume(
610610
# fill and sort candidate struct
611611
num_cands = sort_candidates_by_freq(points, frm.num_cams)
612612
if num_cands > 0:
613-
points = points[: num_cands + 1]
613+
points = points[: num_cands + 1].view(np.recarray)
614614
# points[-1] = np.ndarray((1,), dtype = Foundpix_dtype)
615615
# points[-1].ftnr = TR_UNUSED
616616
else:

0 commit comments

Comments
 (0)