From 73fd3f9dc2eb249397909a098247b0a66da709c6 Mon Sep 17 00:00:00 2001 From: senselessdev1 Date: Thu, 13 Oct 2022 09:12:55 -0400 Subject: [PATCH] add namespace hack to prevent gtsam.gtsam.gtsfm --- python/gtsam/gtsfm.py | 4 ++++ python/gtsam/tests/test_DsfTrackGenerator.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 python/gtsam/gtsfm.py diff --git a/python/gtsam/gtsfm.py b/python/gtsam/gtsfm.py new file mode 100644 index 000000000..afa709083 --- /dev/null +++ b/python/gtsam/gtsfm.py @@ -0,0 +1,4 @@ +# This trick is to allow direct import of sub-modules +# without this, we can only do `from gtsam.gtsam.gtsfm import X` +# with this trick, we can do `from gtsam.gtsfm import X` +from .gtsam.gtsfm import * \ No newline at end of file diff --git a/python/gtsam/tests/test_DsfTrackGenerator.py b/python/gtsam/tests/test_DsfTrackGenerator.py index f1851c221..e63025cd3 100644 --- a/python/gtsam/tests/test_DsfTrackGenerator.py +++ b/python/gtsam/tests/test_DsfTrackGenerator.py @@ -9,7 +9,7 @@ import numpy as np import gtsam from gtsam import IndexPair, KeypointsVector, MatchIndicesMap, NamedSfmMeasurementVector -from gtsam.gtsam.gtsfm import ( +from gtsam.gtsfm import ( DsfTrackGenerator, Keypoints, NamedSfmMeasurement,