Skip to content

Commit

Permalink
bug captured by mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlib committed Nov 18, 2023
1 parent b4dbb0a commit bf79cab
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
16 changes: 16 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[mypy]
ignore_missing_imports = True
; disallow_untyped_defs = True
; disallow_incomplete_defs = True
; check_untyped_defs = True
; warn_unused_ignores = True
; warn_redundant_casts = True
; warn_unused_configs = True
; warn_return_any = True
; warn_unreachable = True
; show_error_codes = True
; pretty = True
; strict_optional = False

[mypy-scipy.*]
ignore_errors = True
2 changes: 1 addition & 1 deletion openptv_python/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def from_file(self, ori_file: str, add_file: str) -> None:
-------
- Ex, In, G, addp: Calibration object parts without multimedia lookup table.
"""
if not pathlib.Path(ori_file).exists:
if not pathlib.Path(ori_file).exists():
raise IOError(f"File {ori_file} does not exist")

with open(ori_file, "r", encoding="utf-8") as fp:
Expand Down
4 changes: 2 additions & 2 deletions openptv_python/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def angle_acc(
angle = 0
else:
angle = (200.0 / math.pi) * math.acos(
sum([v0[i] * v1[i] for i in range(3)])
math.fsum([v0[i] * v1[i] for i in range(3)])
/ (math.dist(start, pred) * math.dist(start, cand))
)

Expand Down Expand Up @@ -373,7 +373,7 @@ def candsearch_in_pix_rest(
# binarized search for start point of candidate search
j0, dj = num_targets // 2, num_targets // 4
while dj > 1:
j0 += dj if next_frame[j0, 1] < ymin else -dj
j0 += dj if next_frame[j0].y < ymin else -dj
dj //= 2

j0 -= 12 if j0 >= 12 else j0 # due to trunc
Expand Down

0 comments on commit bf79cab

Please sign in to comment.