Skip to content

Commit 0e7c565

Browse files
generatedunixname2012458493028417meta-codesync[bot]
authored andcommitted
Fix broken fbcode//mapillary/opensfm/opensfm/test:tests-library-type-checking - unmanaged
Reviewed By: ahojnnes Differential Revision: D104788134 fbshipit-source-id: 41bb0361083125314f568ee587bdd1f2c4a3e3ae
1 parent 461eab1 commit 0e7c565

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

opensfm/test/test_datastructures.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def _create_reconstruction(
7979
# create a new observation
8080
obs = pymap.Observation(100, 200, 0.5, 255, 0, 0, int(pt.id))
8181
shot = rec.shots[str(ch)]
82-
rec.add_observation(shot, pt, obs)
82+
rec.add_observation(shot.id, pt.id, obs)
8383
# TODO: If required, we have to do the same for pano shots
8484
return rec
8585

@@ -900,7 +900,8 @@ def test_point_reproj_errors_assign() -> None:
900900
pt = rec.points["0"]
901901

902902
# When assigning reprojections errors
903-
reproj_errors = dict({"shot1": np.random.rand(2), "shot2": np.random.rand(2)})
903+
reproj_errors = {"shot1": np.random.rand(2), "shot2": np.random.rand(2)}
904+
# pyrefly: ignore [bad-argument-type]
904905
pt.reprojection_errors = reproj_errors
905906

906907
# They should be correct

opensfm/test/test_matching.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ def test_match_images(scene_synthetic: synthetic_scene.SyntheticInputData) -> No
119119
pair = images[i], images[i + 1]
120120
matches = pairs.get(pair)
121121
if matches is None or len(matches) == 1:
122-
# pyrefly: ignore [no-matching-overload]
123-
matches = pairs.get(pair[::-1])
122+
matches = pairs.get((pair[1], pair[0]))
124123
assert matches is not None
125124
assert len(matches) > 25
126125

opensfm/test/test_reconstruction_resect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def split_synthetic_reconstruction(
7272
) -> Tuple[types.Reconstruction, types.Reconstruction]:
7373
cluster1 = types.Reconstruction()
7474
cluster2 = types.Reconstruction()
75-
cluster1.cameras = scene.cameras
76-
cluster2.cameras = scene.cameras
75+
cluster1.cameras = dict(scene.cameras)
76+
cluster2.cameras = dict(scene.cameras)
7777
for i, shot in zip(range(len(scene.shots)), scene.shots.values()):
7878
if i >= cluster_size:
7979
cluster2.add_shot(shot)

opensfm/test/test_reconstruction_shot_neighborhood.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pyre-strict
2-
from typing import List
2+
from collections.abc import Iterable
33

44
from opensfm import pygeometry, pymap, pysfm, reconstruction, types
55

@@ -9,7 +9,7 @@ def _add_shot(rec: types.Reconstruction, shot_id: str, cam: pygeometry.Camera) -
99

1010

1111
def _add_point(
12-
rec: types.Reconstruction, point_id: str, observations: List[str]
12+
rec: types.Reconstruction, point_id: str, observations: Iterable[str]
1313
) -> None:
1414
rec.create_point(point_id)
1515
for shot_id in observations:

0 commit comments

Comments
 (0)