[cig-commits] r14017 - in cs/spatialdata-0.1/trunk: spatialdata/geocoords tests/libtests/spatialdb tests/pytests/spatialdb

brad at geodynamics.org brad at geodynamics.org
Tue Feb 3 21:36:33 PST 2009


Author: brad
Date: 2009-02-03 21:36:33 -0800 (Tue, 03 Feb 2009)
New Revision: 14017

Removed:
   cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/TestSCECCVMH.py
Modified:
   cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSCart.py
   cs/spatialdata-0.1/trunk/tests/libtests/spatialdb/TestSimpleDB.cc
   cs/spatialdata-0.1/trunk/tests/libtests/spatialdb/TestSimpleDB.hh
Log:
Adjusted header file to fix possible error.

Modified: cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSCart.py
===================================================================
--- cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSCart.py	2009-02-04 01:47:39 UTC (rev 14016)
+++ cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSCart.py	2009-02-04 05:36:33 UTC (rev 14017)
@@ -56,7 +56,9 @@
   # PUBLIC METHODS /////////////////////////////////////////////////////
 
   def __init__(self, name="cscart"):
-    """Constructor."""
+    """
+    Constructor.
+    """
     CoordSys.__init__(self, name)
     return
 

Modified: cs/spatialdata-0.1/trunk/tests/libtests/spatialdb/TestSimpleDB.cc
===================================================================
--- cs/spatialdata-0.1/trunk/tests/libtests/spatialdb/TestSimpleDB.cc	2009-02-04 01:47:39 UTC (rev 14016)
+++ cs/spatialdata-0.1/trunk/tests/libtests/spatialdb/TestSimpleDB.cc	2009-02-04 05:36:33 UTC (rev 14017)
@@ -12,10 +12,10 @@
 
 #include <portinfo>
 
+#include "TestSimpleDB.hh" // Implementation of class methods
+
 #include "spatialdata/spatialdb/SimpleDB.hh" // USES SimpleDB
 
-#include "TestSimpleDB.hh" // Implementation of class methods
-
 #include "data/SimpleDBTestData.hh" // USES SimpleDBTestData
 
 #include "spatialdata/spatialdb/SimpleDBData.hh" // USES SimpleDBData
@@ -87,7 +87,7 @@
 // Populate database with data.
 void
 spatialdata::spatialdb::TestSimpleDB::_setupDB(SimpleDB* const db,
-					 const SimpleDBTestData& data)
+					       const SimpleDBTestData& data)
 { // _setupDB
   SimpleDBData* dbData = new SimpleDBData;
   dbData->allocate(data.numLocs, data.numVals, data.spaceDim,

Modified: cs/spatialdata-0.1/trunk/tests/libtests/spatialdb/TestSimpleDB.hh
===================================================================
--- cs/spatialdata-0.1/trunk/tests/libtests/spatialdb/TestSimpleDB.hh	2009-02-04 01:47:39 UTC (rev 14016)
+++ cs/spatialdata-0.1/trunk/tests/libtests/spatialdb/TestSimpleDB.hh	2009-02-04 05:36:33 UTC (rev 14017)
@@ -23,11 +23,12 @@
 
 #include <cppunit/extensions/HelperMacros.h>
 
+#include "spatialdata/spatialdb/spatialdbfwd.hh"
+
 /// Namespace for spatial package
 namespace spatialdata {
   namespace spatialdb {
     class TestSimpleDB;
-    class SimpleDB; // USES SimpleDB
     class SimpleDBTestData; // USES SimpleDBTestData
   } // spatialdb
 } // spatialdata

Deleted: cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/TestSCECCVMH.py
===================================================================
--- cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/TestSCECCVMH.py	2009-02-04 01:47:39 UTC (rev 14016)
+++ cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/TestSCECCVMH.py	2009-02-04 05:36:33 UTC (rev 14017)
@@ -1,112 +0,0 @@
-#!/usr/bin/env python
-#
-# ======================================================================
-#
-#                           Brad T. Aagaard
-#                        U.S. Geological Survey
-#
-# {LicenseText}
-#
-# ======================================================================
-#
-
-import unittest
-
-import numpy
-
-class TestSCECCVMH(unittest.TestCase):
-
-  def setUp(self):
-    from spatialdata.spatialdb.SCECCVMH import SCECCVMH
-    db = SCECCVMH()
-    db.inventory.dataDir = "/home/brad/data/sceccvm-h/vx53/bin"
-    db._configure()
-    self._db = db
-    return
-
-
-  def test_query(self):
-    locs = numpy.array( [[-118.520000,  34.120000,  -1400.00],
-                         [-116.400000,  32.340000,  -1000.00]],
-                        numpy.float64)
-    from spatialdata.geocoords.CSGeo import CSGeo
-    cs = CSGeo()
-    cs.inventory.datumHoriz = "NAD27"
-    cs.inventory.datumVert = "mean sea level"
-    cs.inventory.ellipsoid = "clrk66"
-    cs._configure()
-    cs.initialize()
-    queryVals = ["topo-elev", "moho-depth", "density"]
-    dataE = numpy.array([[489.975189, -31178.105469,   2660.851074],
-                         [801.209961, -34526.414062,   3022.192708]],
-                        numpy.float64)
-    errE = [0, 0]
-    
-    db = self._db
-    db.open()
-    db.queryVals(queryVals)
-    data = numpy.zeros(dataE.shape, dtype=numpy.float64)
-    err = []
-    nlocs = locs.shape[0]
-    for i in xrange(nlocs):
-      e = db.query(data[i,:], locs[i,:], cs)
-      err.append(e)
-    db.close()    
-
-    self.assertEqual(len(errE), len(err))
-    for vE, v in zip(errE, err):
-      self.assertEqual(vE, v)
-
-    self.assertEqual(len(dataE.shape), len(data.shape))
-    for dE, d in zip(dataE.shape, data.shape):
-      self.assertEqual(dE, d)
-    for vE, v in zip(numpy.reshape(dataE, -1), numpy.reshape(data, -1)):
-      self.assertAlmostEqual(vE, v, 6)
-    return
-
-
-  def test_querySquash(self):
-    locs = numpy.array( [[-118.520000,  34.120000,  -1400.00-489.975189],
-                         [-116.400000,  32.340000,  -1000.00-801.209961]],
-                        numpy.float64)
-    from spatialdata.geocoords.CSGeo import CSGeo
-    cs = CSGeo()
-    cs.inventory.datumHoriz = "NAD27"
-    cs.inventory.datumVert = "mean sea level"
-    cs.inventory.ellipsoid = "clrk66"
-    cs._configure()
-    cs.initialize()
-    queryVals = ["topo-elev", "moho-depth", "density"]
-    dataE = numpy.array([[489.975189, -31178.105469,   2660.851074],
-                         [801.209961, -34526.414062,   3022.192708]],
-                        numpy.float64)
-    errE = [0, 0]
-    
-    db = self._db
-    db.open()
-    db.queryVals(queryVals)
-    from pyre.units.length import km
-    squashLimit = -2.5*km
-    db.squash(True, squashLimit.value)
-    data = numpy.zeros(dataE.shape, dtype=numpy.float64)
-    err = []
-    nlocs = locs.shape[0]
-    for i in xrange(nlocs):
-      e = db.query(data[i,:], locs[i,:], cs)
-      err.append(e)
-    db.close()    
-
-    self.assertEqual(len(errE), len(err))
-    for vE, v in zip(errE, err):
-      self.assertEqual(vE, v)
-
-    self.assertEqual(len(dataE.shape), len(data.shape))
-    for dE, d in zip(dataE.shape, data.shape):
-      self.assertEqual(dE, d)
-    for vE, v in zip(numpy.reshape(dataE, -1), numpy.reshape(data, -1)):
-      self.assertAlmostEqual(vE, v, 6)
-
-    return
-
-
-# End of file 



More information about the CIG-COMMITS mailing list