Simu: Python's import system is too hard for me

This commit is contained in:
Eric Teunis de Boone 2022-03-24 15:45:40 +01:00
parent a50f6640a4
commit e4af62e51d
3 changed files with 15 additions and 10 deletions

View file

@ -1,9 +1,6 @@
from functools import partial from functools import partial
try:
from .location import Location from .location import Location
except ImportError:
from location import Location
class Antenna(Location): class Antenna(Location):
""" """

View file

@ -3,8 +3,14 @@
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d from mpl_toolkits.mplot3d import axes3d
import location as loc # fix package-internal importing
from antenna import Receiver, Emitter 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 # 2D showcase
source = Emitter([1,1]) source = Emitter([1,1])

View file

@ -2,10 +2,12 @@
import numpy as np import numpy as np
import scipy.interpolate as interp import scipy.interpolate as interp
try: if __name__ == "__main__" and __package__ is None:
import sys
sys.path.append("../../")
__package__ = "lib.signals"
from .signal import * from .signal import *
except ImportError:
from signal import *
class DigitisedSignal(Signal): class DigitisedSignal(Signal):
""" """