[MOAB-dev] r2908 - in MOAB/trunk/tools/iMesh/python: test tools

jvporter at wisc.edu jvporter at wisc.edu
Fri May 22 17:28:03 CDT 2009


Author: jvporter
Date: 2009-05-22 17:28:02 -0500 (Fri, 22 May 2009)
New Revision: 2908

Removed:
   MOAB/trunk/tools/iMesh/python/test/core.py
Modified:
   MOAB/trunk/tools/iMesh/python/test/adj.py
   MOAB/trunk/tools/iMesh/python/test/all.py
   MOAB/trunk/tools/iMesh/python/test/basic.py
   MOAB/trunk/tools/iMesh/python/test/entset.py
   MOAB/trunk/tools/iMesh/python/test/iter.py
   MOAB/trunk/tools/iMesh/python/test/tags.py
   MOAB/trunk/tools/iMesh/python/tools/volume.py
Log:
* Cleanup Python test code
* Minor aesthetic changes to volume ratio tool


Modified: MOAB/trunk/tools/iMesh/python/test/adj.py
===================================================================
--- MOAB/trunk/tools/iMesh/python/test/adj.py	2009-05-22 20:30:16 UTC (rev 2907)
+++ MOAB/trunk/tools/iMesh/python/test/adj.py	2009-05-22 22:28:02 UTC (rev 2908)
@@ -1,4 +1,5 @@
-from core import *
+from itaps import *
+import unittest
 
 topo = iMesh.topology # shorthand
 

Modified: MOAB/trunk/tools/iMesh/python/test/all.py
===================================================================
--- MOAB/trunk/tools/iMesh/python/test/all.py	2009-05-22 20:30:16 UTC (rev 2907)
+++ MOAB/trunk/tools/iMesh/python/test/all.py	2009-05-22 22:28:02 UTC (rev 2908)
@@ -3,4 +3,3 @@
 import tags
 import adj
 import iter
-

Modified: MOAB/trunk/tools/iMesh/python/test/basic.py
===================================================================
--- MOAB/trunk/tools/iMesh/python/test/basic.py	2009-05-22 20:30:16 UTC (rev 2907)
+++ MOAB/trunk/tools/iMesh/python/test/basic.py	2009-05-22 22:28:02 UTC (rev 2908)
@@ -1,4 +1,5 @@
-from core import *
+from itaps import *
+import unittest
 import tempfile
 
 class TestBasic(unittest.TestCase):

Deleted: MOAB/trunk/tools/iMesh/python/test/core.py
===================================================================
--- MOAB/trunk/tools/iMesh/python/test/core.py	2009-05-22 20:30:16 UTC (rev 2907)
+++ MOAB/trunk/tools/iMesh/python/test/core.py	2009-05-22 22:28:02 UTC (rev 2908)
@@ -1,2 +0,0 @@
-import unittest
-from itaps import *

Modified: MOAB/trunk/tools/iMesh/python/test/entset.py
===================================================================
--- MOAB/trunk/tools/iMesh/python/test/entset.py	2009-05-22 20:30:16 UTC (rev 2907)
+++ MOAB/trunk/tools/iMesh/python/test/entset.py	2009-05-22 22:28:02 UTC (rev 2908)
@@ -1,4 +1,5 @@
-from core import *
+from itaps import *
+import unittest
 
 class TestEntSet(unittest.TestCase):
     def setUp(self):

Modified: MOAB/trunk/tools/iMesh/python/test/iter.py
===================================================================
--- MOAB/trunk/tools/iMesh/python/test/iter.py	2009-05-22 20:30:16 UTC (rev 2907)
+++ MOAB/trunk/tools/iMesh/python/test/iter.py	2009-05-22 22:28:02 UTC (rev 2908)
@@ -1,4 +1,5 @@
-from core import *
+from itaps import *
+import unittest
 
 class TestIter(unittest.TestCase):
     def setUp(self):

Modified: MOAB/trunk/tools/iMesh/python/test/tags.py
===================================================================
--- MOAB/trunk/tools/iMesh/python/test/tags.py	2009-05-22 20:30:16 UTC (rev 2907)
+++ MOAB/trunk/tools/iMesh/python/test/tags.py	2009-05-22 22:28:02 UTC (rev 2908)
@@ -1,4 +1,5 @@
-from core import *
+from itaps import *
+import unittest
 from numpy import *
 
 class TestTags(unittest.TestCase):

Modified: MOAB/trunk/tools/iMesh/python/tools/volume.py
===================================================================
--- MOAB/trunk/tools/iMesh/python/tools/volume.py	2009-05-22 20:30:16 UTC (rev 2907)
+++ MOAB/trunk/tools/iMesh/python/tools/volume.py	2009-05-22 22:28:02 UTC (rev 2908)
@@ -14,17 +14,17 @@
 
 def hex_volume(coords):
     # assumes not-quite logical vertex ordering
-    def subvolume(a,b,c,d,e):
-        base = ( distance(cross(b-a,d-a)) +
-                 distance(cross(c-a,d-a)) ) / 2
-        norm = cross(b-a,c-a)
+    def subvolume(a, b, c, d, e):
+        base = ( distance(cross(b-a, d-a)) +
+                 distance(cross(c-a, d-a)) ) / 2
+        norm = cross(b-a, c-a)
         norm = norm / distance(norm)
-        height = abs(dot(norm,e-a))
+        height = abs(dot(norm, e-a))
         return base*height / 3
 
-    return subvolume(coords[0],coords[1],coords[3],coords[2],coords[7]) + \
-           subvolume(coords[0],coords[1],coords[4],coords[5],coords[7]) + \
-           subvolume(coords[1],coords[2],coords[5],coords[6],coords[7])
+    return subvolume(coords[0], coords[1], coords[3], coords[2], coords[7]) + \
+           subvolume(coords[0], coords[1], coords[4], coords[5], coords[7]) + \
+           subvolume(coords[1], coords[2], coords[5], coords[6], coords[7])
 
 def calc_volume(filename):
     mesh = iMesh()
@@ -86,5 +86,3 @@
     ylabel('volume ratio')
 
     show()
-
-



More information about the moab-dev mailing list