Skip to content

Commit

Permalink
remove deprecated 'from __future__ import print_function'
Browse files Browse the repository at this point in the history
  • Loading branch information
tgastine committed May 29, 2024
1 parent 10e49c7 commit c1e20a4
Show file tree
Hide file tree
Showing 27 changed files with 26 additions and 52 deletions.
1 change: 0 additions & 1 deletion samples/boussBenchSat/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/couetteAxi/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/doubleDiffusion/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/dynamo_benchmark/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/dynamo_benchmark_condICrotIC/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/finite_differences/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/fluxPerturbation/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/full_sphere/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/hydro_bench_anel/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/isothermal_nrho3/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import shutil
Expand Down
1 change: 0 additions & 1 deletion samples/magic_wizard.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
from __future__ import print_function
import argparse
import os
import shutil
Expand Down
1 change: 0 additions & 1 deletion samples/onset/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/phase_field/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/precession/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
2 changes: 1 addition & 1 deletion samples/testCoeffOutputs/reference.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-7.56843e-01 -7.56893e-01 -0.00000e+00 1.41734e-01 -9.86239e-02
1.44948e-04 -6.69540e-02 -0.00000e+00 -1.14957e+00 -2.87125e+00
-1.66843e-02 -6.69540e-02 -0.00000e+00 -1.14957e+00 -2.87125e+00
-7.57070e-01 -0.00000e+00 1.40492e-01 -9.85798e-02
1.41494e-04 1.46202e-04 1.77199e-02 0.00000e+00
9.44370e-03 8.06103e-03 8.41353e-01 0.00000e+00
Expand Down
51 changes: 25 additions & 26 deletions samples/testCoeffOutputs/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down Expand Up @@ -47,66 +46,66 @@ def generateEkinFile(fileName='e_kin.test'):

# Classical CMB file
cmb = MagicCoeffCmb(tag='start', iplot=False, quiet=True)
st = '%.5e %.5e %.5e %.5e %.5e' % ( cmb.glm[0, cmb.idx[1, 0]],
cmb.glm[2, cmb.idx[1, 0]],
cmb.hlm[-1, cmb.idx[5, 0]],
cmb.glm[2, cmb.idx[5, 4]],
st = '%.5e %.5e %.5e %.5e %.5e' % ( cmb.glm[0, cmb.idx[1, 0]],
cmb.glm[2, cmb.idx[1, 0]],
cmb.hlm[-1, cmb.idx[5, 0]],
cmb.glm[2, cmb.idx[5, 4]],
cmb.hlm[3, cmb.idx[5, 4]] )
file.write(st+'\n')

# Secular variation CMB file
cmb = MagicCoeffCmb(tag='start', iplot=False, sv=True, quiet=True)
st = '%.5e %.5e %.5e %.5e %.5e' % ( cmb.glm[0, cmb.idx[1, 0]],
cmb.glm[2, cmb.idx[1, 0]],
cmb.hlm[-1, cmb.idx[5, 0]],
cmb.glm[2, cmb.idx[5, 4]],
st = '%.5e %.5e %.5e %.5e %.5e' % ( cmb.glm[1, cmb.idx[1, 0]],
cmb.glm[2, cmb.idx[1, 0]],
cmb.hlm[-1, cmb.idx[5, 0]],
cmb.glm[2, cmb.idx[5, 4]],
cmb.hlm[3, cmb.idx[5, 4]] )
file.write(st+'\n')

# Time-averaged CMB file
cmb = MagicCoeffCmb(tag='start', iplot=False, ave=True, quiet=True)
st = '%.5e %.5e %.5e %.5e' % ( cmb.glm[0, cmb.idx[1, 0]],
cmb.hlm[0, cmb.idx[5, 0]],
cmb.glm[0, cmb.idx[5, 4]],
st = '%.5e %.5e %.5e %.5e' % ( cmb.glm[0, cmb.idx[1, 0]],
cmb.hlm[0, cmb.idx[5, 0]],
cmb.glm[0, cmb.idx[5, 4]],
cmb.hlm[0, cmb.idx[5, 4]] )
file.write(st+'\n')

# Coeff at depth
coeff = MagicCoeffR(tag='start', field='V', r=1, iplot=False, quiet=True)
st = '%.5e %.5e %.5e %.5e' % ( coeff.wlm[0, coeff.idx[4, 4]].real,
coeff.wlm[0, coeff.idx[4, 4]].imag,
coeff.zlm[0, coeff.idx[1, 0]].real,
st = '%.5e %.5e %.5e %.5e' % ( coeff.wlm[0, coeff.idx[4, 4]].real,
coeff.wlm[0, coeff.idx[4, 4]].imag,
coeff.zlm[0, coeff.idx[1, 0]].real,
coeff.wlm[0, coeff.idx[2, 0]].imag )
file.write(st+'\n')

coeff = MagicCoeffR(tag='start', field='V', r=2, iplot=False, quiet=True)
st = '%.5e %.5e %.5e %.5e' % ( coeff.wlm[0, coeff.idx[4, 4]].real,
coeff.wlm[0, coeff.idx[4, 4]].imag,
coeff.zlm[0, coeff.idx[1, 0]].real,
st = '%.5e %.5e %.5e %.5e' % ( coeff.wlm[0, coeff.idx[4, 4]].real,
coeff.wlm[0, coeff.idx[4, 4]].imag,
coeff.zlm[0, coeff.idx[1, 0]].real,
coeff.wlm[0, coeff.idx[2, 0]].imag )
file.write(st+'\n')

coeff = MagicCoeffR(tag='start', field='B', r=1, iplot=False, quiet=True)
st = '%.5e %.5e %.5e %.5e' % ( coeff.wlm[0, coeff.idx[1, 0]].real,
coeff.wlm[0, coeff.idx[1, 0]].imag,
coeff.zlm[0, coeff.idx[5, 0]].real,
st = '%.5e %.5e %.5e %.5e' % ( coeff.wlm[0, coeff.idx[1, 0]].real,
coeff.wlm[0, coeff.idx[1, 0]].imag,
coeff.zlm[0, coeff.idx[5, 0]].real,
coeff.wlm[0, coeff.idx[5, 4]].imag )
file.write(st+'\n')

coeff = MagicCoeffR(tag='start', field='B', r=2, iplot=False, quiet=True)
st = '%.5e %.5e %.5e %.5e' % ( coeff.wlm[0, coeff.idx[1, 0]].real,
coeff.wlm[0, coeff.idx[1, 0]].imag,
coeff.zlm[0, coeff.idx[4, 0]].real,
st = '%.5e %.5e %.5e %.5e' % ( coeff.wlm[0, coeff.idx[1, 0]].real,
coeff.wlm[0, coeff.idx[1, 0]].imag,
coeff.zlm[0, coeff.idx[4, 0]].real,
coeff.wlm[0, coeff.idx[5, 4]].imag )
file.write(st+'\n')

pot = MagicPotential(field='B', verbose=False)
st = '%.5e %.5e %.5e %.5e' % ( pot.pol[5, 3].real, pot.pol[127, 15].imag,
st = '%.5e %.5e %.5e %.5e' % ( pot.pol[5, 3].real, pot.pol[127, 15].imag,
pot.tor[183, 16].real, pot.tor[121, 9].imag )
file.write(st+'\n')

pot = MagicPotential(field='V', verbose=False)
st = '%.5e %.5e %.5e %.5e' % ( pot.pol[65, 15].real, pot.pol[125, 17].imag,
st = '%.5e %.5e %.5e %.5e' % ( pot.pol[65, 15].real, pot.pol[125, 17].imag,
pot.tor[63, 12].real, pot.tor[184, 13].imag )
file.write(st+'\n')

Expand Down
1 change: 0 additions & 1 deletion samples/testGraphMovieOutputs/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/testMapping/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/testOutputs/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/testRMSOutputs/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/testRadialOutputs/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/testRestart/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/testTOGeosOutputs/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/testTruncations/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/time_schemes/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/varCond/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down
1 change: 0 additions & 1 deletion samples/varProps/unitTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import unittest
import numpy as np
import glob
Expand Down

0 comments on commit c1e20a4

Please sign in to comment.