Changeset 3351
- Timestamp:
- Jul 18, 2006, 1:51:19 PM (19 years ago)
- Location:
- inundation
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/geospatial_data/geospatial_data.py
r3320 r3351 792 792 msg = "Use a Geospatial_data object or a mesh origin. Not both." 793 793 assert geo_reference == None, msg 794 794 return points 795 795 else: 796 796 points = ensure_numeric(points, Float) … … 804 804 geo_reference[1], 805 805 geo_reference[2]) 806 806 points = Geospatial_data(data_points=points, geo_reference=geo) 807 807 return points 808 808 -
inundation/geospatial_data/test_geospatial_data.py
r3302 r3351 1073 1073 [2.0, 0.0],[2.0, 2.0], 1074 1074 [1.0, 3.0],[2.0, 2.0]] 1075 new_points = ensure_ absolute(points)1076 1077 assert allclose(new_points , points)1075 new_points = ensure_geospatial(points) 1076 1077 assert allclose(new_points.get_data_points(absolute = True), points) 1078 1078 1079 1079 points = array([[2.0, 0.0],[1.0, 1.0], 1080 1080 [2.0, 0.0],[2.0, 2.0], 1081 1081 [1.0, 3.0],[2.0, 2.0]]) 1082 new_points = ensure_ absolute(points)1083 1084 assert allclose(new_points , points)1082 new_points = ensure_geospatial(points) 1083 1084 assert allclose(new_points.get_data_points(absolute = True), points) 1085 1085 1086 1086 ab_points = array([[2.0, 0.0],[1.0, 1.0], … … 1345 1345 if __name__ == "__main__": 1346 1346 1347 #suite = unittest.makeSuite(Test_Geospatial_data, 'test_ lat_long')1347 #suite = unittest.makeSuite(Test_Geospatial_data, 'test_ensure_geospatial') 1348 1348 suite = unittest.makeSuite(Test_Geospatial_data, 'test') 1349 1349 runner = unittest.TextTestRunner() -
inundation/pmesh/mesh.py
r3193 r3351 637 637 """ 638 638 point_data = ensure_geospatial(point_data) 639 639 #print "point_data",point_data 640 640 # get points relative to the mesh geo_ref 641 641 points = point_data.get_data_points(geo_reference=self.geo_reference) 642 #FIXME finish....643 642 644 643 for point in points: -
inundation/pmesh/test_mesh.py
r3304 r3351 2142 2142 'FAILED!') 2143 2143 2144 2144 2145 def test_add_vertices_more(self): 2146 points = [[0.1,1],[0.4,.2],[7,5],[10,5]] 2147 #spat = Geospatial_data(points) 2148 2149 m = Mesh() 2150 m.add_vertices(points) 2151 2152 vert = m.getUserVertices() 2153 #print "vert",vert 2154 self.failUnless(4==len(vert), 2155 'FAILED!') 2156 vert= m.get_user_vertices(absolute=True) 2157 self.failUnless(vert==points, 2158 'FAILED!') 2159 2145 2160 def test_add_verticesII(self): 2146 2161 points_lat_long = [[-33,152],[-35,152],[-35,150],[-33,150]] … … 2214 2229 #------------------------------------------------------------- 2215 2230 if __name__ == "__main__": 2216 #suite = unittest.makeSuite(meshTestCase,'test')2217 suite = unittest.makeSuite(meshTestCase,'test_add_verticesII')2231 suite = unittest.makeSuite(meshTestCase,'test') 2232 #suite = unittest.makeSuite(meshTestCase,'test_add_vertices_more') 2218 2233 runner = unittest.TextTestRunner() #verbosity=2) 2219 2234 runner.run(suite)
Note: See TracChangeset
for help on using the changeset viewer.