Changeset 9457


Ignore:
Timestamp:
Jan 21, 2015, 3:32:59 PM (10 years ago)
Author:
steve
Message:

Cleaning up shallow_water folder

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  
    140140#-----------------------------
    141141
    142 from anuga.shallow_water.smf import slide_tsunami, slump_tsunami
     142from anuga.tsunami_source.smf import slide_tsunami, slump_tsunami
     143
    143144
    144145
  • trunk/anuga_core/source/anuga/file/test_csv.py

    r7872 r9457  
    229229       
    230230        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')               
    232232
    233233        polygons, values = load_csv_as_polygons(testfile,
     
    306306       
    307307        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')               
    309309
    310310        polygons, values = load_csv_as_polygons(testfile,
     
    386386       
    387387        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')               
    389389
    390390        polygons, values = load_csv_as_building_polygons(testfile,
  • trunk/anuga_core/source/anuga/file_conversion/test_urs2sts.py

    r8780 r9457  
    229229        path = get_pathname_from_package('anuga.shallow_water')       
    230230       
    231         testdir = os.path.join(path, 'urs_test_data')
     231        testdir = os.path.join(path, 'test',  'urs_test_data')
    232232        ordering_filename=os.path.join(testdir, 'thinned_bound_order_test.txt')
    233233       
     
    398398        path = get_pathname_from_package('anuga.shallow_water')       
    399399               
    400         testdir = os.path.join(path, 'urs_test_data')       
     400        testdir = os.path.join(path, 'test', 'urs_test_data')       
    401401        ordering_filename=os.path.join(testdir, 'thinned_bound_order_test.txt')
    402402
  • trunk/anuga_core/source/anuga/shallow_water/test/test_DE1_domain.py

    r9452 r9457  
    2424
    2525    def tearDown(self):
    26         pass
     26        try:
     27            os.remove('runup_sinusoid_de1.sww')
     28        except:
     29            pass
    2730
    2831
  • trunk/anuga_core/source/anuga/shallow_water/test/test_data_manager.py

    r9452 r9457  
    4444
    4545# import all the boundaries - some are generic, some are shallow water
    46 from boundaries import Reflective_boundary, \
     46from anuga.shallow_water.boundaries import Reflective_boundary, \
    4747            Field_boundary, Transmissive_momentum_set_stage_boundary, \
    4848            Transmissive_stage_zero_momentum_boundary
     
    5858from anuga.geospatial_data.geospatial_data import Geospatial_data
    5959
    60 from shallow_water_domain import Domain
     60from anuga.shallow_water.shallow_water_domain import Domain
    6161
    6262# use helper methods from other unit test
     
    198198        for ext in ['_ha.nc', '_ua.nc', '_va.nc', '_e.nc']:
    199199            #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
    201210
    202211    def test_sww_constant(self):
  • trunk/anuga_core/source/anuga/shallow_water/test/test_forcing.py

    r9452 r9457  
    216216
    217217    def tearDown(self):
    218         pass
     218        for file in ['domain.sww']:
     219            try:
     220                os.remove(file)
     221            except:
     222                pass
    219223       
    220224    def write_wind_pressure_field_sts(self,
  • trunk/anuga_core/source/anuga/shallow_water/test/test_loadsave.py

    r9452 r9457  
    3232
    3333# boundary functions
    34 from boundaries import Reflective_boundary, \
     34from anuga.shallow_water.boundaries import Reflective_boundary, \
    3535            Field_boundary, Transmissive_momentum_set_stage_boundary, \
    3636            Transmissive_stage_zero_momentum_boundary
     
    4343
    4444# Get gateway to C implementation of flux function for direct testing
    45 from shallow_water_ext import flux_function_central as flux_function
    46 from shallow_water_ext import rotate
     45from anuga.shallow_water.shallow_water_ext import flux_function_central as flux_function
     46from anuga.shallow_water.shallow_water_ext import rotate
    4747
    4848
     
    8585
    8686    def tearDown(self):
    87         pass
     87        for file in ['domain.sww', 'domain_pickle.pickle']:
     88            try:
     89                os.remove(file)
     90            except:
     91                pass
    8892       
    8993    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  
    22import anuga
    33import numpy
     4import os
    45
    56boundaryPolygon=[ [0., 0.], [0., 100.], [100.0, 100.0], [100.0, 0.0]]
     
    1213
    1314    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
    1521
    1622    def create_domain(self, flowalg):
  • trunk/anuga_core/source/anuga/shallow_water/test/test_most2nc.py

    r9452 r9457  
    22import numpy as num
    33from anuga.file.netcdf import NetCDFFile
    4 import most2nc
     4from  anuga.shallow_water.most2nc import most2nc
    55import os
    66
     
    3030
    3131    def test_small_nxn(self):
    32         most2nc.most2nc(input_file=FN,output_file='test.nc'\
     32        most2nc(input_file=FN,output_file='test.nc'\
    3333                        ,inverted_bathymetry = False,verbose = False)
    3434
  • trunk/anuga_core/source/anuga/shallow_water/test/test_shallow_water_domain.py

    r9452 r9457  
    2929from anuga.shallow_water.sww_interrogate import get_flow_through_cross_section
    3030
    31 from shallow_water_domain import Domain
     31from anuga.shallow_water.shallow_water_domain import Domain
    3232
    3333# boundary functions
    34 from boundaries import Reflective_boundary, \
     34from anuga.shallow_water.boundaries import Reflective_boundary, \
    3535            Field_boundary, Transmissive_momentum_set_stage_boundary, \
    3636            Transmissive_stage_zero_momentum_boundary
     
    4343
    4444# Get gateway to C implementation of flux function for direct testing
    45 from shallow_water_ext import flux_function_central as flux_function
    46 from shallow_water_ext import rotate
     45from anuga.shallow_water.shallow_water_ext import flux_function_central as flux_function
     46from anuga.shallow_water.shallow_water_ext import rotate
    4747
    4848
     
    70547054                        [E-border, N-border], [W+border, N-border]]       
    70557055
    7056         meshname = os.path.join(path, 'offending_mesh.msh')
     7056        meshname = 'offending_mesh.msh'
    70577057        create_mesh_from_regions(bounding_polygon,
    70587058                                 boundary_tags={'south': [0], 'east': [1],
     
    70707070        #----------------------------------------------------------------------
    70717071
    7072         points_file = os.path.join(path, 'offending_point.pts')
     7072        points_file = 'offending_point.pts'
    70737073
    70747074        # Offending point
     
    71517151            interior_regions.append( [polygon, 100] )
    71527152
    7153         meshname = os.path.join(path, 'offending_mesh.msh')
     7153        meshname = 'offending_mesh.msh'
    71547154        create_mesh_from_regions(bounding_polygon,
    71557155                                 boundary_tags={'south': [0], 'east': [1],
     
    72177217        path = get_pathname_from_package('anuga.shallow_water')       
    72187218
    7219         meshname = os.path.join(path, 'test_mesh.msh')
     7219        meshname = 'test_mesh.msh'
     7220       
    72207221        W = 304180
    72217222        S = 6185270
     
    72397240       
    72407241        # 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')
    72427243
    72437244        domain.set_quantity('elevation', filename=points_file,
     
    72537254
    72547255        # 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')
    72567257        try:   
    72577258            domain.set_quantity('elevation', filename=points_file,
  • trunk/anuga_core/source/anuga/shallow_water/test/test_swb2_domain.py

    r9452 r9457  
    2424
    2525    def tearDown(self):
    26         pass
     26        for file in ['runup_sinusoid_v2.sww']:
     27            try:
     28                os.remove(file)
     29            except:
     30                pass
    2731
    2832
  • trunk/anuga_core/source/anuga/shallow_water/test/test_sww_interrogate.py

    r9452 r9457  
    1010from anuga.config import g
    1111
    12 from boundaries import Reflective_boundary, \
     12from anuga.shallow_water.boundaries import Reflective_boundary, \
    1313            Field_boundary, Transmissive_momentum_set_stage_boundary, \
    1414            Transmissive_stage_zero_momentum_boundary
     
    1919from anuga.file.sww import get_mesh_and_quantities_from_file
    2020           
    21 from shallow_water_domain import Domain
     21from anuga.shallow_water.shallow_water_domain import Domain
    2222
    2323from 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       
     26from anuga.shallow_water.sww_interrogate import get_maximum_inundation_elevation, \
    2627            get_maximum_inundation_location, get_maximum_inundation_data, \
    2728            get_flow_through_cross_section, get_energy_through_cross_section
     
    3132
    3233class 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   
    3346    def test_get_maximum_inundation(self):
    3447        """Test that sww information can be converted correctly to maximum
     
    4457        #Setup
    4558
    46         from mesh_factory import rectangular
     59        #from mesh_factory import rectangular
    4760
    4861        # Create basic mesh (100m x 100m)
     
    221234
    222235        # Setup
    223         from mesh_factory import rectangular
     236        #from mesh_factory import rectangular
    224237
    225238        # Create basic mesh (20m x 3m)
     
    344357
    345358        # Setup
    346         from mesh_factory import rectangular
     359        #from mesh_factory import rectangular
    347360
    348361        # Create basic mesh (20m x 3m)
     
    472485
    473486        # Setup
    474         from mesh_factory import rectangular
     487        #from mesh_factory import rectangular
    475488
    476489        # Create basic mesh (20m x 3m)
     
    574587
    575588        # Setup
    576         from mesh_factory import rectangular
     589        #from mesh_factory import rectangular
    577590
    578591        # Create basic mesh (20m x 3m)
  • trunk/anuga_core/source/anuga/tsunami_source/test/test_eq.py

    r9456 r9457  
    11import unittest
    22import numpy as num
    3 from eqf import earthquake_tsunami, Okada_func
     3from anuga.tsunami_source.eqf import earthquake_tsunami, Okada_func
    44
    55
  • trunk/anuga_core/source/anuga/tsunami_source/test/test_smf.py

    r9456 r9457  
    11import unittest
     2import os
    23import numpy as num
    3 from smf import slide_tsunami, slump_tsunami, Double_gaussian
    4 from shallow_water_domain import Domain
     4from anuga.tsunami_source.smf import slide_tsunami, slump_tsunami, Double_gaussian
     5from anuga import Domain
    56
    67class Test_smf(unittest.TestCase):
     
    910
    1011    def tearDown(self):
    11         pass
     12        try:
     13            os.remove('test.msh')
     14        except:
     15            pass
    1216
    1317
  • trunk/anuga_core/source/anuga/tsunami_source/test/test_tsunami_okada.py

    r9456 r9457  
    11import unittest
     2import os
    23import numpy as num
    3 from tsunami_okada import earthquake_tsunami,Okada_func
     4from anuga.tsunami_source.tsunami_okada import earthquake_tsunami,Okada_func
    45from anuga.shallow_water.shallow_water_domain import Domain
    56
     
    2627        """
    2728        # 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')
    2930       
    3031        # Choose what test to proceed
     
    3435        if T==0:
    3536            # Fortran output file           
    36             filename = path+sep+'fullokada_SP.txt'
     37            filename = path+sep+'test'+sep+'data'+sep+'fullokada_SP.txt'
    3738           
    3839            # Initial condition of earthquake for multiple source
     
    5051        elif T==1:
    5152            # Fortran output file       
    52             filename = path+sep+'fullokada_SS.txt'
     53            filename = path+sep+'test'+sep+'data'+sep+'fullokada_SS.txt'
    5354           
    5455            # Initial condition of earthquake for multiple source
     
    6869
    6970            # Fortran output file
    70             filename = path+sep+'fullokada_MS.txt'
     71            filename = path+sep+'test'+sep+'data'+sep+'fullokada_MS.txt'
    7172           
    7273            # Initial condition of earthquake for multiple source
     
    165166
    166167        # 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')
    168169       
    169170        # Choose what test to proceed
     
    172173        if T==0:
    173174            # Fortran output file
    174             filename = path+sep+'fullokada_SP.txt'
     175            filename = path+sep+'test'+sep+'data'+sep+'fullokada_SP.txt'
    175176           
    176177            # Initial condition of earthquake for multiple source
     
    188189        elif T==1:
    189190            # Fortran output file
    190             filename = path+sep+'fullokada_SS.txt'
     191            filename = path+sep+'test'+sep+'data'+sep+'fullokada_SS.txt'
    191192           
    192193            # Initial condition of earthquake for multiple source
     
    206207
    207208            # Fortran output file
    208             filename = path+sep+'fullokada_MS.txt'
     209            filename = path+sep+'test'+sep+'data'+sep+'fullokada_MS.txt'
    209210           
    210211            # Initial condition of earthquake for multiple source
Note: See TracChangeset for help on using the changeset viewer.