From fb6cdbe087dc5cc767f2bccd161239956d9d3b7d Mon Sep 17 00:00:00 2001 From: Zeina Migeed Date: Tue, 19 Nov 2024 13:40:53 -0800 Subject: [PATCH] Turn typing on for mapillary Summary: We are turning typing on for untyped directory. to type check your project: `arc pyre check //buck/pattern/...` You can enable this by adding `typing = True` to individual buck targets OR `# in a PACKAGE file load("fbcode_macros//build_defs:python.bzl", "python") python.set_typing(True)` will type check all buck targets nested underneath. This directory contains numerous type annotations that are not currently being type checked by a type checker. This can often lead to a false sense of security, since engineers expect feedback on their type annotations. Reviewed By: MaggieMoss Differential Revision: D66179514 fbshipit-source-id: 2279b119a7bc093c3e6f2c66dc92217383e391ef --- annotation_gui_gcp/lib/views/cad_view.py | 4 ---- annotation_gui_gcp/lib/views/cp_finder_view.py | 1 - annotation_gui_gcp/lib/views/image_view.py | 1 - opensfm/dataset.py | 2 -- 4 files changed, 8 deletions(-) diff --git a/annotation_gui_gcp/lib/views/cad_view.py b/annotation_gui_gcp/lib/views/cad_view.py index d5f79e930..5cb199246 100644 --- a/annotation_gui_gcp/lib/views/cad_view.py +++ b/annotation_gui_gcp/lib/views/cad_view.py @@ -32,7 +32,6 @@ def __init__( path_cad_file, is_geo_reference=False, )-> None: - # pyre-fixme[19]: Expected 0 positional arguments. super().__init__(main_ui, web_app, route_prefix) self.main_ui = main_ui @@ -43,7 +42,6 @@ def __init__( self.load_georeference_metadata(path_cad_file) self.is_geo_reference = is_geo_reference - # pyre-fixme[16]: `CADView` has no attribute `app`. self.app.add_url_rule( f"{route_prefix}/model", f"{route_prefix}_model", @@ -102,7 +100,6 @@ def display_points(self) -> None: def refocus(self, lat, lon)->None: x, y, z = self.latlon_to_xyz(lat, lon) - # pyre-fixme[16]: `CADView` has no attribute `send_sse_message`. self.send_sse_message( {"x": x, "y": y, "z": z}, event_type="move_camera", @@ -169,5 +166,4 @@ def sync_to_client(self)->None: point_id ] - # pyre-fixme[16]: `CADView` has no attribute `send_sse_message`. self.send_sse_message(data) diff --git a/annotation_gui_gcp/lib/views/cp_finder_view.py b/annotation_gui_gcp/lib/views/cp_finder_view.py index cee24084f..42705e7e6 100644 --- a/annotation_gui_gcp/lib/views/cp_finder_view.py +++ b/annotation_gui_gcp/lib/views/cp_finder_view.py @@ -18,7 +18,6 @@ def template_name(self): def get_candidate_images(self) -> t.List[str]: images_in_existing_views = [] - # pyre-fixme[16]: `ControlPointFinderView` has no attribute `main_ui`. for v in self.main_ui.sequence_views: images_in_existing_views.extend(v.image_list) diff --git a/annotation_gui_gcp/lib/views/image_view.py b/annotation_gui_gcp/lib/views/image_view.py index ec20e7543..11d1688a5 100644 --- a/annotation_gui_gcp/lib/views/image_view.py +++ b/annotation_gui_gcp/lib/views/image_view.py @@ -9,7 +9,6 @@ def point_color(point_id: str) -> str: return hex_color -# pyre-fixme[11]: Annotation `WebView` is not defined as a type. class ImageView(WebView): def __init__( self, diff --git a/opensfm/dataset.py b/opensfm/dataset.py index fa96fc6fb..12af6a344 100644 --- a/opensfm/dataset.py +++ b/opensfm/dataset.py @@ -334,8 +334,6 @@ def load_words(self, image: str) -> np.ndarray: def save_words(self, image: str, words: np.ndarray) -> None: with self.io_handler.open(self._words_file(image), "wb") as f: - # pyre-fixme[6]: For 1st argument expected `Union[_SupportsWrite[bytes], - # PathLike[str], str]` but got `IO[typing.Any]`. np.savez_compressed(f, words=words.astype(np.uint16)) def _matches_path(self) -> str: