Changeset 9457
- Timestamp:
- Jan 21, 2015, 3:32:59 PM (10 years ago)
- Location:
- trunk/anuga_core/source/anuga
- Files:
-
- 1 added
- 15 edited
- 1 copied
- 8 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/__init__.py
r9405 r9457 140 140 #----------------------------- 141 141 142 from anuga.shallow_water.smf import slide_tsunami, slump_tsunami 142 from anuga.tsunami_source.smf import slide_tsunami, slump_tsunami 143 143 144 144 145 -
trunk/anuga_core/source/anuga/file/test_csv.py
r7872 r9457 229 229 230 230 path = get_pathname_from_package('anuga.shallow_water') 231 testfile = os.path.join(path, ' polygon_values_example.csv')231 testfile = os.path.join(path, 'test', 'data', 'polygon_values_example.csv') 232 232 233 233 polygons, values = load_csv_as_polygons(testfile, … … 306 306 307 307 path = get_pathname_from_package('anuga.shallow_water') 308 testfile = os.path.join(path, ' polygon_values_example.csv')308 testfile = os.path.join(path, 'test', 'data', 'polygon_values_example.csv') 309 309 310 310 polygons, values = load_csv_as_polygons(testfile, … … 386 386 387 387 path = get_pathname_from_package('anuga.shallow_water') 388 testfile = os.path.join(path, ' polygon_values_example.csv')388 testfile = os.path.join(path, 'test', 'data', 'polygon_values_example.csv') 389 389 390 390 polygons, values = load_csv_as_building_polygons(testfile, -
trunk/anuga_core/source/anuga/file_conversion/test_urs2sts.py
r8780 r9457 229 229 path = get_pathname_from_package('anuga.shallow_water') 230 230 231 testdir = os.path.join(path, ' urs_test_data')231 testdir = os.path.join(path, 'test', 'urs_test_data') 232 232 ordering_filename=os.path.join(testdir, 'thinned_bound_order_test.txt') 233 233 … … 398 398 path = get_pathname_from_package('anuga.shallow_water') 399 399 400 testdir = os.path.join(path, ' urs_test_data')400 testdir = os.path.join(path, 'test', 'urs_test_data') 401 401 ordering_filename=os.path.join(testdir, 'thinned_bound_order_test.txt') 402 402 -
trunk/anuga_core/source/anuga/shallow_water/test/test_DE1_domain.py
r9452 r9457 24 24 25 25 def tearDown(self): 26 pass 26 try: 27 os.remove('runup_sinusoid_de1.sww') 28 except: 29 pass 27 30 28 31 -
trunk/anuga_core/source/anuga/shallow_water/test/test_data_manager.py
r9452 r9457 44 44 45 45 # import all the boundaries - some are generic, some are shallow water 46 from boundaries import Reflective_boundary, \46 from anuga.shallow_water.boundaries import Reflective_boundary, \ 47 47 Field_boundary, Transmissive_momentum_set_stage_boundary, \ 48 48 Transmissive_stage_zero_momentum_boundary … … 58 58 from anuga.geospatial_data.geospatial_data import Geospatial_data 59 59 60 from shallow_water_domain import Domain60 from anuga.shallow_water.shallow_water_domain import Domain 61 61 62 62 # use helper methods from other unit test … … 198 198 for ext in ['_ha.nc', '_ua.nc', '_va.nc', '_e.nc']: 199 199 #print 'Trying to remove', self.test_MOST_file + ext 200 os.remove(self.test_MOST_file + ext) 200 try: 201 os.remove(self.test_MOST_file + ext) 202 except: 203 pass 204 205 for file in ['domain.sww', 'outline_meshed.tsh', 'outline.tsh']: 206 try: 207 os.remove(file) 208 except: 209 pass 201 210 202 211 def test_sww_constant(self): -
trunk/anuga_core/source/anuga/shallow_water/test/test_forcing.py
r9452 r9457 216 216 217 217 def tearDown(self): 218 pass 218 for file in ['domain.sww']: 219 try: 220 os.remove(file) 221 except: 222 pass 219 223 220 224 def write_wind_pressure_field_sts(self, -
trunk/anuga_core/source/anuga/shallow_water/test/test_loadsave.py
r9452 r9457 32 32 33 33 # boundary functions 34 from boundaries import Reflective_boundary, \34 from anuga.shallow_water.boundaries import Reflective_boundary, \ 35 35 Field_boundary, Transmissive_momentum_set_stage_boundary, \ 36 36 Transmissive_stage_zero_momentum_boundary … … 43 43 44 44 # Get gateway to C implementation of flux function for direct testing 45 from shallow_water_ext import flux_function_central as flux_function46 from shallow_water_ext import rotate45 from anuga.shallow_water.shallow_water_ext import flux_function_central as flux_function 46 from anuga.shallow_water.shallow_water_ext import rotate 47 47 48 48 … … 85 85 86 86 def tearDown(self): 87 pass 87 for file in ['domain.sww', 'domain_pickle.pickle']: 88 try: 89 os.remove(file) 90 except: 91 pass 88 92 89 93 def test_get_flow_through_cross_section_with_geo(self): -
trunk/anuga_core/source/anuga/shallow_water/test/test_local_extrapolation_and_flux_updating.py
r9452 r9457 2 2 import anuga 3 3 import numpy 4 import os 4 5 5 6 boundaryPolygon=[ [0., 0.], [0., 100.], [100.0, 100.0], [100.0, 0.0]] … … 12 13 13 14 def tearDown(self): 14 pass 15 for file in ['domain.sww', 'test_boundaryfluxintegral.msh', 'test_boundaryfluxintegral.sww']: 16 try: 17 os.remove(file) 18 except: 19 pass 20 15 21 16 22 def create_domain(self, flowalg): -
trunk/anuga_core/source/anuga/shallow_water/test/test_most2nc.py
r9452 r9457 2 2 import numpy as num 3 3 from anuga.file.netcdf import NetCDFFile 4 import most2nc4 from anuga.shallow_water.most2nc import most2nc 5 5 import os 6 6 … … 30 30 31 31 def test_small_nxn(self): 32 most2nc .most2nc(input_file=FN,output_file='test.nc'\32 most2nc(input_file=FN,output_file='test.nc'\ 33 33 ,inverted_bathymetry = False,verbose = False) 34 34 -
trunk/anuga_core/source/anuga/shallow_water/test/test_shallow_water_domain.py
r9452 r9457 29 29 from anuga.shallow_water.sww_interrogate import get_flow_through_cross_section 30 30 31 from shallow_water_domain import Domain31 from anuga.shallow_water.shallow_water_domain import Domain 32 32 33 33 # boundary functions 34 from boundaries import Reflective_boundary, \34 from anuga.shallow_water.boundaries import Reflective_boundary, \ 35 35 Field_boundary, Transmissive_momentum_set_stage_boundary, \ 36 36 Transmissive_stage_zero_momentum_boundary … … 43 43 44 44 # Get gateway to C implementation of flux function for direct testing 45 from shallow_water_ext import flux_function_central as flux_function46 from shallow_water_ext import rotate45 from anuga.shallow_water.shallow_water_ext import flux_function_central as flux_function 46 from anuga.shallow_water.shallow_water_ext import rotate 47 47 48 48 … … 7054 7054 [E-border, N-border], [W+border, N-border]] 7055 7055 7056 meshname = os.path.join(path, 'offending_mesh.msh')7056 meshname = 'offending_mesh.msh' 7057 7057 create_mesh_from_regions(bounding_polygon, 7058 7058 boundary_tags={'south': [0], 'east': [1], … … 7070 7070 #---------------------------------------------------------------------- 7071 7071 7072 points_file = os.path.join(path, 'offending_point.pts')7072 points_file = 'offending_point.pts' 7073 7073 7074 7074 # Offending point … … 7151 7151 interior_regions.append( [polygon, 100] ) 7152 7152 7153 meshname = os.path.join(path, 'offending_mesh.msh')7153 meshname = 'offending_mesh.msh' 7154 7154 create_mesh_from_regions(bounding_polygon, 7155 7155 boundary_tags={'south': [0], 'east': [1], … … 7217 7217 path = get_pathname_from_package('anuga.shallow_water') 7218 7218 7219 meshname = os.path.join(path, 'test_mesh.msh') 7219 meshname = 'test_mesh.msh' 7220 7220 7221 W = 304180 7221 7222 S = 6185270 … … 7239 7240 7240 7241 # Large test set revealed one problem 7241 points_file = os.path.join(path, 'test _points_large.csv')7242 points_file = os.path.join(path, 'test', 'data', 'test_points_large.csv') 7242 7243 7243 7244 domain.set_quantity('elevation', filename=points_file, … … 7253 7254 7254 7255 # Small test set revealed another problem 7255 points_file = os.path.join(path, 'test _points_small.csv')7256 points_file = os.path.join(path, 'test', 'data', 'test_points_small.csv') 7256 7257 try: 7257 7258 domain.set_quantity('elevation', filename=points_file, -
trunk/anuga_core/source/anuga/shallow_water/test/test_swb2_domain.py
r9452 r9457 24 24 25 25 def tearDown(self): 26 pass 26 for file in ['runup_sinusoid_v2.sww']: 27 try: 28 os.remove(file) 29 except: 30 pass 27 31 28 32 -
trunk/anuga_core/source/anuga/shallow_water/test/test_sww_interrogate.py
r9452 r9457 10 10 from anuga.config import g 11 11 12 from boundaries import Reflective_boundary, \12 from anuga.shallow_water.boundaries import Reflective_boundary, \ 13 13 Field_boundary, Transmissive_momentum_set_stage_boundary, \ 14 14 Transmissive_stage_zero_momentum_boundary … … 19 19 from anuga.file.sww import get_mesh_and_quantities_from_file 20 20 21 from shallow_water_domain import Domain21 from anuga.shallow_water.shallow_water_domain import Domain 22 22 23 23 from anuga.abstract_2d_finite_volumes.mesh_factory \ 24 import rectangular_cross 25 from sww_interrogate import get_maximum_inundation_elevation, \ 24 import rectangular_cross, rectangular 25 26 from anuga.shallow_water.sww_interrogate import get_maximum_inundation_elevation, \ 26 27 get_maximum_inundation_location, get_maximum_inundation_data, \ 27 28 get_flow_through_cross_section, get_energy_through_cross_section … … 31 32 32 33 class Test_sww_Interrogate(unittest.TestCase): 34 35 def setUp(self): 36 pass 37 38 def tearDown(self): 39 for file in ['flowtest.sww', 'flowtest_uniquely.sww', 'runup_test_2.sww']: 40 try: 41 os.remove(file) 42 except: 43 pass 44 45 33 46 def test_get_maximum_inundation(self): 34 47 """Test that sww information can be converted correctly to maximum … … 44 57 #Setup 45 58 46 from mesh_factory import rectangular59 #from mesh_factory import rectangular 47 60 48 61 # Create basic mesh (100m x 100m) … … 221 234 222 235 # Setup 223 from mesh_factory import rectangular236 #from mesh_factory import rectangular 224 237 225 238 # Create basic mesh (20m x 3m) … … 344 357 345 358 # Setup 346 from mesh_factory import rectangular359 #from mesh_factory import rectangular 347 360 348 361 # Create basic mesh (20m x 3m) … … 472 485 473 486 # Setup 474 from mesh_factory import rectangular487 #from mesh_factory import rectangular 475 488 476 489 # Create basic mesh (20m x 3m) … … 574 587 575 588 # Setup 576 from mesh_factory import rectangular589 #from mesh_factory import rectangular 577 590 578 591 # Create basic mesh (20m x 3m) -
trunk/anuga_core/source/anuga/tsunami_source/test/test_eq.py
r9456 r9457 1 1 import unittest 2 2 import numpy as num 3 from eqf import earthquake_tsunami, Okada_func3 from anuga.tsunami_source.eqf import earthquake_tsunami, Okada_func 4 4 5 5 -
trunk/anuga_core/source/anuga/tsunami_source/test/test_smf.py
r9456 r9457 1 1 import unittest 2 import os 2 3 import numpy as num 3 from smf import slide_tsunami, slump_tsunami, Double_gaussian4 from shallow_water_domainimport Domain4 from anuga.tsunami_source.smf import slide_tsunami, slump_tsunami, Double_gaussian 5 from anuga import Domain 5 6 6 7 class Test_smf(unittest.TestCase): … … 9 10 10 11 def tearDown(self): 11 pass 12 try: 13 os.remove('test.msh') 14 except: 15 pass 12 16 13 17 -
trunk/anuga_core/source/anuga/tsunami_source/test/test_tsunami_okada.py
r9456 r9457 1 1 import unittest 2 import os 2 3 import numpy as num 3 from tsunami_okada import earthquake_tsunami,Okada_func4 from anuga.tsunami_source.tsunami_okada import earthquake_tsunami,Okada_func 4 5 from anuga.shallow_water.shallow_water_domain import Domain 5 6 … … 26 27 """ 27 28 # Get path where this test is run 28 path = get_pathname_from_package('anuga. shallow_water')29 path = get_pathname_from_package('anuga.tsunami_source') 29 30 30 31 # Choose what test to proceed … … 34 35 if T==0: 35 36 # Fortran output file 36 filename = path+sep+' fullokada_SP.txt'37 filename = path+sep+'test'+sep+'data'+sep+'fullokada_SP.txt' 37 38 38 39 # Initial condition of earthquake for multiple source … … 50 51 elif T==1: 51 52 # Fortran output file 52 filename = path+sep+' fullokada_SS.txt'53 filename = path+sep+'test'+sep+'data'+sep+'fullokada_SS.txt' 53 54 54 55 # Initial condition of earthquake for multiple source … … 68 69 69 70 # Fortran output file 70 filename = path+sep+' fullokada_MS.txt'71 filename = path+sep+'test'+sep+'data'+sep+'fullokada_MS.txt' 71 72 72 73 # Initial condition of earthquake for multiple source … … 165 166 166 167 # Get path where this test is run 167 path= get_pathname_from_package('anuga. shallow_water')168 path= get_pathname_from_package('anuga.tsunami_source') 168 169 169 170 # Choose what test to proceed … … 172 173 if T==0: 173 174 # Fortran output file 174 filename = path+sep+' fullokada_SP.txt'175 filename = path+sep+'test'+sep+'data'+sep+'fullokada_SP.txt' 175 176 176 177 # Initial condition of earthquake for multiple source … … 188 189 elif T==1: 189 190 # Fortran output file 190 filename = path+sep+' fullokada_SS.txt'191 filename = path+sep+'test'+sep+'data'+sep+'fullokada_SS.txt' 191 192 192 193 # Initial condition of earthquake for multiple source … … 206 207 207 208 # Fortran output file 208 filename = path+sep+' fullokada_MS.txt'209 filename = path+sep+'test'+sep+'data'+sep+'fullokada_MS.txt' 209 210 210 211 # Initial condition of earthquake for multiple source
Note: See TracChangeset
for help on using the changeset viewer.