From 0ccb18b055074777593f6169e2c5110037cd2cab Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Wed, 10 Nov 2021 14:27:28 -0500 Subject: [PATCH] add return type definitions Because my time is more valuable than a reviewer's pedanticness --- python/gtsam/examples/SFMExample_bal.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/gtsam/examples/SFMExample_bal.py b/python/gtsam/examples/SFMExample_bal.py index 77c186bd3..f3e48c3c3 100644 --- a/python/gtsam/examples/SFMExample_bal.py +++ b/python/gtsam/examples/SFMExample_bal.py @@ -17,8 +17,8 @@ import sys import gtsam from gtsam import (GeneralSFMFactorCal3Bundler, PriorFactorPinholeCameraCal3Bundler, PriorFactorPoint3) -from gtsam.symbol_shorthand import C, P -from gtsam.utils import plot +from gtsam.symbol_shorthand import C, P # type: ignore +from gtsam.utils import plot # type: ignore from matplotlib import pyplot as plt logging.basicConfig(stream=sys.stdout, level=logging.INFO) @@ -26,7 +26,7 @@ logging.basicConfig(stream=sys.stdout, level=logging.INFO) DEFAULT_BAL_DATASET = "dubrovnik-3-7-pre" -def plot_scene(scene_data: gtsam.SfmData, result: gtsam.Values): +def plot_scene(scene_data: gtsam.SfmData, result: gtsam.Values) -> None: """Plot the SFM results.""" plot_vals = gtsam.Values() for cam_idx in range(scene_data.number_cameras()): @@ -41,7 +41,7 @@ def plot_scene(scene_data: gtsam.SfmData, result: gtsam.Values): plt.show() -def run(args: argparse.Namespace): +def run(args: argparse.Namespace) -> None: """ Run LM optimization with BAL input data and report resulting error """ input_file = args.input_file @@ -109,7 +109,7 @@ def run(args: argparse.Namespace): plot_scene(scene_data, result) -def main(): +def main() -> None: """Main runner.""" parser = argparse.ArgumentParser() parser.add_argument('-i',