this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

more modern python

+9 -9
+9 -9
test/testkiss.py
··· 4 4 # 5 5 # SPDX-License-Identifier: BSD-3-Clause 6 6 # See COPYING file for more information. 7 - 7 + from __future__ import division,print_function 8 8 import math 9 9 import sys 10 10 import os ··· 50 50 return s 51 51 52 52 def dounpack(x,cpx): 53 - uf = fmt * ( len(x) / struct.calcsize(fmt) ) 53 + uf = fmt * ( len(x) // struct.calcsize(fmt) ) 54 54 s = struct.unpack(uf,x) 55 55 if cpx: 56 56 return numpy.array(s[::2]) + numpy.array( s[1::2] )*1j ··· 99 99 errpow = numpy.vdot(errf,errf)+1e-10 100 100 sigpow = numpy.vdot(xverf,xverf)+1e-10 101 101 snr = 10*math.log10(abs(sigpow/errpow) ) 102 - print 'SNR (compared to NumPy) : %.1fdB' % float(snr) 102 + print( 'SNR (compared to NumPy) : {0:.1f}dB'.format( float(snr) ) ) 103 103 104 104 if snr<minsnr: 105 - print 'xver=',xver 106 - print 'x2=',x2 107 - print 'err',err 105 + print( 'xver=',xver ) 106 + print( 'x2=',x2) 107 + print( 'err',err) 108 108 sys.exit(1) 109 109 110 110 def dofft(x,isreal): ··· 124 124 if doreal: 125 125 cmd += ' -R ' 126 126 127 - print cmd 127 + print( cmd) 128 128 129 129 from subprocess import Popen,PIPE 130 130 p = Popen(cmd,shell=True,stdin=PIPE,stdout=PIPE ) ··· 149 149 doreal = opts.has_key('-r') 150 150 151 151 if doreal: 152 - print 'Testing multi-dimensional real FFTs' 152 + print( 'Testing multi-dimensional real FFTs') 153 153 else: 154 - print 'Testing multi-dimensional FFTs' 154 + print( 'Testing multi-dimensional FFTs') 155 155 156 156 for dim in range(1,4): 157 157 test_fft( dim )