diff --git a/simulations/lib/location/antenna.py b/simulations/lib/location/antenna.py index 824eccc..6760345 100644 --- a/simulations/lib/location/antenna.py +++ b/simulations/lib/location/antenna.py @@ -1,9 +1,6 @@ from functools import partial -try: - from .location import Location -except ImportError: - from location import Location +from .location import Location class Antenna(Location): """ diff --git a/simulations/lib/location/example.py b/simulations/lib/location/example.py index 45b485b..9f37de6 100755 --- a/simulations/lib/location/example.py +++ b/simulations/lib/location/example.py @@ -3,8 +3,14 @@ import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import axes3d -import location as loc -from antenna import Receiver, Emitter +# fix package-internal importing +if __name__ == "__main__" and __package__ is None: + import sys + sys.path.append("../../") + __package__ = "lib.location" + +from . import location as loc +from ..location.antenna import Receiver, Emitter # 2D showcase source = Emitter([1,1]) diff --git a/simulations/lib/signals/digitisedsignal.py b/simulations/lib/signals/digitisedsignal.py index 5d2a09c..59d683d 100755 --- a/simulations/lib/signals/digitisedsignal.py +++ b/simulations/lib/signals/digitisedsignal.py @@ -2,10 +2,12 @@ import numpy as np import scipy.interpolate as interp -try: - from .signal import * -except ImportError: - from signal import * +if __name__ == "__main__" and __package__ is None: + import sys + sys.path.append("../../") + __package__ = "lib.signals" + +from .signal import * class DigitisedSignal(Signal): """