added deprecation waring

This commit is contained in:
Junzi Sun 2018-03-27 18:24:22 +02:00
parent 12506e7c7f
commit 773efff9bc
3 changed files with 17 additions and 1 deletions

View File

@ -1 +1,3 @@
from __future__ import absolute_import, print_function, division
from pyModeS.decoder import *

View File

@ -5,3 +5,17 @@ from pyModeS.decoder.bds.bds44 import *
from pyModeS.decoder.bds.bds50 import *
from pyModeS.decoder.bds.bds53 import *
from pyModeS.decoder.bds.bds60 import *
def BDS(msg):
import warnings
from pyModeS.decoder.bds import infer
warnings.simplefilter('always', DeprecationWarning)
warnings.warn("pms.ehs.BDS() is deprecated, use pms.bds.infer() instead", DeprecationWarning)
return infer(msg)
def icao(msg):
import warnings
from pyModeS.decoder.modes import icao
warnings.simplefilter('always', DeprecationWarning)
warnings.warn("pms.ehs.icao() deprecated, please use pms.modes.icao() instead", DeprecationWarning)
return icao(msg)

View File

@ -41,7 +41,7 @@ def hex2int(hexstr):
def bin2np(binstr):
"""Convert a binary string to numpy array. """
return np.fromstring(binstr, 'u1') - ord('0')
return np.array([int(i) for i in binstr])
def np2bin(npbin):