move common package to root level
This commit is contained in:
parent
fe9e033a64
commit
5286355bf6
2
Makefile
2
Makefile
@ -8,7 +8,7 @@ ext:
|
|||||||
python setup.py build_ext --inplace
|
python setup.py build_ext --inplace
|
||||||
|
|
||||||
test:
|
test:
|
||||||
python -m pytest
|
python -m pytest tests
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
find pyModeS/decoder -type f -name '*.c' -delete
|
find pyModeS/decoder -type f -name '*.c' -delete
|
||||||
|
@ -2,11 +2,11 @@ import os
|
|||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from .decoder import c_common as common
|
from . import c_common as common
|
||||||
from .decoder.c_common import *
|
from .c_common import *
|
||||||
except:
|
except:
|
||||||
from .decoder import common
|
from . import common
|
||||||
from .decoder.common import *
|
from .common import *
|
||||||
|
|
||||||
from .decoder import tell
|
from .decoder import tell
|
||||||
from .decoder import adsb
|
from .decoder import adsb
|
||||||
@ -15,6 +15,9 @@ from .decoder import bds
|
|||||||
from .extra import aero
|
from .extra import aero
|
||||||
from .extra import tcpclient
|
from .extra import tcpclient
|
||||||
|
|
||||||
|
from .encoder import encode_adsb
|
||||||
|
|
||||||
|
|
||||||
warnings.simplefilter("once", DeprecationWarning)
|
warnings.simplefilter("once", DeprecationWarning)
|
||||||
|
|
||||||
dirpath = os.path.dirname(os.path.realpath(__file__))
|
dirpath = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
@ -41,10 +41,8 @@ def crc(msg, encode=False):
|
|||||||
# the CRC generator
|
# the CRC generator
|
||||||
G = [int("11111111", 2), int("11111010", 2), int("00000100", 2), int("10000000", 2)]
|
G = [int("11111111", 2), int("11111010", 2), int("00000100", 2), int("10000000", 2)]
|
||||||
|
|
||||||
if encode and isinstance(msg, str):
|
if encode:
|
||||||
msg = msg[:-6] + "000000"
|
msg = msg[:-6] + "000000"
|
||||||
elif encode:
|
|
||||||
msg = msg[:-6] + b"000000"
|
|
||||||
|
|
||||||
msgbin = hex2bin(msg)
|
msgbin = hex2bin(msg)
|
||||||
msgbin_split = wrap(msgbin, 8)
|
msgbin_split = wrap(msgbin, 8)
|
@ -21,12 +21,7 @@ Common functions for Mode-S decoding
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from pyModeS.extra import aero
|
from pyModeS.extra import aero
|
||||||
|
from pyModeS import common
|
||||||
try:
|
|
||||||
from pyModeS.decoder import c_common as common
|
|
||||||
except:
|
|
||||||
from pyModeS.decoder import common
|
|
||||||
|
|
||||||
|
|
||||||
from pyModeS.decoder.bds import (
|
from pyModeS.decoder.bds import (
|
||||||
bds05,
|
bds05,
|
||||||
|
2
setup.py
2
setup.py
@ -19,7 +19,7 @@ from setuptools import setup, find_packages
|
|||||||
from setuptools.extension import Extension
|
from setuptools.extension import Extension
|
||||||
from Cython.Build import cythonize
|
from Cython.Build import cythonize
|
||||||
|
|
||||||
extensions = [Extension("pyModeS.decoder.c_common", ["pyModeS/decoder/c_common.pyx"])]
|
extensions = [Extension("pyModeS.c_common", ["pyModeS/c_common.pyx"])]
|
||||||
|
|
||||||
|
|
||||||
# To use a consistent encoding
|
# To use a consistent encoding
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from pyModeS.decoder import common
|
from pyModeS import common
|
||||||
|
|
||||||
|
|
||||||
def test_conversions():
|
def test_conversions():
|
||||||
|
Loading…
Reference in New Issue
Block a user