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
+11 -4
View File
@@ -1,3 +1,10 @@
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from past.utils import old_div
from SimPEG import Mesh, Tests
from SimPEG.Mesh.TreeMesh import CellLookUpException
import numpy as np
@@ -12,13 +19,13 @@ class TestSimpleQuadTree(unittest.TestCase):
nc = 8
h1 = np.random.rand(nc)*nc*0.5 + nc*0.5
h2 = np.random.rand(nc)*nc*0.5 + nc*0.5
h = [hi/np.sum(hi) for hi in [h1, h2]] # normalize
h = [old_div(hi,np.sum(hi)) for hi in [h1, h2]] # normalize
M = Mesh.TreeMesh(h)
M._refineCell([0,0,0])
M._refineCell([0,0,1])
M.number()
# M.plotGrid(showIt=True)
print M
print(M)
assert M.nhFx == 2
assert M.nFx == 9
@@ -60,7 +67,7 @@ class TestSimpleQuadTree(unittest.TestCase):
nc = 8
h1 = np.random.rand(nc)*nc*0.5 + nc*0.5
h2 = np.random.rand(nc)*nc*0.5 + nc*0.5
h = [hi/np.sum(hi) for hi in [h1, h2]] # normalize
h = [old_div(hi,np.sum(hi)) for hi in [h1, h2]] # normalize
M = Mesh.TreeMesh(h)
M._refineCell([0,0,0])
M._refineCell([0,0,1])
@@ -138,7 +145,7 @@ class TestOcTree(unittest.TestCase):
h1 = np.random.rand(nc)*nc*0.5 + nc*0.5
h2 = np.random.rand(nc)*nc*0.5 + nc*0.5
h3 = np.random.rand(nc)*nc*0.5 + nc*0.5
h = [hi/np.sum(hi) for hi in [h1, h2, h3]] # normalize
h = [old_div(hi,np.sum(hi)) for hi in [h1, h2, h3]] # normalize
M = Mesh.TreeMesh(h, levels=3)
M._refineCell([0,0,0,0])
M._refineCell([0,0,0,1])