mirror of
https://github.com/wassname/simpeg.git
synced 2026-09-10 12:37:30 +08:00
Futurize 1, futurize 2, pasteurize.
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user