Futurize 1, futurize 2, pasteurize.

This commit is contained in:
Brendan Smithyman
2016-07-16 14:17:02 -05:00
parent 362975d2bd
commit ca8d8f8c2d
197 changed files with 2618 additions and 1235 deletions
+13 -5
View File
@@ -1,3 +1,11 @@
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
from builtins import int
from future import standard_library
standard_library.install_aliases()
from past.utils import old_div
import unittest
from SimPEG import *
import SimPEG.DCIP as DC
@@ -7,10 +15,10 @@ class IPProblemTests(unittest.TestCase):
def setUp(self):
cs = 12.5
nc = 500/cs+1
nc = old_div(500,cs)+1
hx = [(cs,0, -1.3),(cs,nc),(cs,0, 1.3)]
hy = [(cs,0, -1.3),(cs,int(nc/2+1)),(cs,0, 1.3)]
hz = [(cs,0, -1.3),(cs,int(nc/2+1))]
hy = [(cs,0, -1.3),(cs,int(old_div(nc,2)+1)),(cs,0, 1.3)]
hz = [(cs,0, -1.3),(cs,int(old_div(nc,2)+1))]
mesh = Mesh.TensorMesh([hx, hy, hz], 'CCN')
sighalf = 1e-2
sigma = np.ones(mesh.nC)*sighalf
@@ -35,7 +43,7 @@ class IPProblemTests(unittest.TestCase):
try:
from pymatsolver import MumpsSolver
problem.Solver = MumpsSolver
except ImportError, e:
except ImportError as e:
problem.Solver = SolverLU
mSynth = eta
@@ -69,7 +77,7 @@ class IPProblemTests(unittest.TestCase):
wtJv = w.dot(self.p.Jvec(self.m0, v))
vtJtw = v.dot(self.p.Jtvec(self.m0, w))
passed = np.abs(wtJv - vtJtw) < 1e-10
print 'Adjoint Test', np.abs(wtJv - vtJtw), passed
print('Adjoint Test', np.abs(wtJv - vtJtw), passed)
self.assertTrue(passed)
def test_dataObj(self):