Changeset 9693


Ignore:
Timestamp:
Feb 25, 2015, 3:59:42 PM (9 years ago)
Author:
steve
Message:

Cleaned up warning simple filter to fix error on warning in test_all.py

Location:
trunk/anuga_core
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/anuga/__init__.py

    r9680 r9693  
    2121#-----------------------------------------------------
    2222
    23 
    24 
    25 
    26 # PEP0440 compatible formatted version, see:
    27 # https://www.python.org/dev/peps/pep-0440/
    28 #
    29 # Generic release markers:
    30 # X.Y
    31 # X.Y.Z # For bugfix releases
    32 #
    33 # Admissible pre-release markers:
    34 # X.YaN # Alpha release
    35 # X.YbN # Beta release
    36 # X.YrcN # Release Candidate
    37 # X.Y # Final release
    38 #
    39 # Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer.
    40 #
    4123__version__ = '1.3.8'
    4224
     
    216198    # Shallow Water Tsunamis
    217199    #-----------------------------
    218 
    219200    from anuga.tsunami_source.smf import slide_tsunami, slump_tsunami
    220201
     
    228209
    229210
    230 
    231211    #-----------------------------
    232212    # File conversion utilities
    233213    #-----------------------------
    234     from anuga.file_conversion.file_conversion import sww2obj, \
    235                         timefile2netcdf, tsh2sww
     214    from anuga.file_conversion.file_conversion import sww2obj
     215    from anuga.file_conversion.file_conversion import timefile2netcdf
     216    from anuga.file_conversion.file_conversion import tsh2sww
    236217    from anuga.file_conversion.urs2nc import urs2nc
    237218    from anuga.file_conversion.urs2sww import urs2sww 
  • trunk/anuga_core/anuga/abstract_2d_finite_volumes/tests/test_generic_domain.py

    r9617 r9693  
    101101
    102102        assert domain.CFL == 3.0
     103       
     104        warnings.simplefilter("default")
    103105       
    104106
  • trunk/anuga_core/anuga/config.py

    r9265 r9693  
    2626
    2727pmesh_filename = '.\\pmesh'
    28 version_filename = 'stored_version_info.py'
     28#version_filename = 'stored_version_info.py'
    2929default_datadir = '.'
    3030time_format = '%d/%m/%y %H:%M:%S'    # Used with timefile2netcdf
     
    3434# Major revision number for use with create_distribution
    3535# and update_anuga_user_guide
    36 major_revision = '1.3.1'
     36#major_revision = '1.3.1'
    3737
    3838################################################################################
  • trunk/anuga_core/anuga/fit_interpolate/interpolate2d.py

    r8970 r9693  
    148148   
    149149    # Restrict interpolation points to those that are inside the grid
    150     inside = -outside  # Invert boolean array to find elements inside
     150    inside = numpy.logical_not(outside)  # Invert boolean array to find elements inside
    151151    xi = xi[inside]
    152152    eta = eta[inside]
     
    185185        # Set up masks for the quadrants
    186186        left = alpha < 0.5
    187         right = -left
     187        right = numpy.logical_not(left)
    188188        lower = beta < 0.5
    189         upper = -lower
     189        upper = numpy.logical_not(lower)
    190190
    191191        lower_left = lower * left
  • trunk/anuga_core/anuga/fit_interpolate/tests/test_interpolate2d.py

    r9480 r9693  
    4444    # Filter NaN's out
    4545    if numpy.any(xn):
    46         x = x[-xn]
    47         y = y[-yn]
     46        x = x[numpy.logical_not(xn)]
     47        y = y[numpy.logical_not(yn)]
    4848
    4949    # Compare non NaN's and return
  • trunk/anuga_core/anuga/parallel/tests/test_parallel_inlet_operator.py

    r9571 r9693  
    298298        if myid == 0:
    299299            if verbose: print 'PARALLEL START'
     300            random.seed(1001)
    300301            for i in range(samples):
    301302                x = random.randrange(0,1000)/1000.0 * length
  • trunk/anuga_core/anuga/pmesh/mesh.py

    r9591 r9693  
    18701870                                         # if attributes are brought back in.
    18711871        #point_dict['geo_reference'] = self.geo_reference
    1872         if mesh_dict['vertices'] == []:
     1872        if len(mesh_dict['vertices']) == 0:
    18731873            #point_dict['pointlist'] = mesh_dict['points']
    18741874            geo = Geospatial_data(mesh_dict['points'],
  • trunk/anuga_core/anuga/structures/inlet_operator.py

    r9282 r9693  
    33import inlet
    44
    5 from warnings import warn
     5import warnings
    66
    77class Inlet_operator(anuga.Operator):
     
    174174                default(0.0)
    175175            except:
     176                msg = "could not call default"
    176177                raise Exception(msg)
    177178
     
    204205                       'Note: Further warnings will be supressed'
    205206                       % (str(err_msg), str(self.default(t))))
    206                 warn(msg)
     207               
     208                warnings.warn(msg)
    207209
    208210                # FIXME (Ole): Replace this crude flag with
  • trunk/anuga_core/anuga/structures/tests/test_inlet_operator.py

    r9566 r9693  
    1616from anuga.structures.inlet_operator import Inlet_operator
    1717
    18 import warnings
    19 warnings.simplefilter("ignore")
     18
    2019
    2120class Test_inlet_operator(unittest.TestCase):
     
    289288        os.chdir(baseDir)
    290289
     290        import warnings
     291        warnings.simplefilter("ignore")
     292       
    291293        Inlet_operator(domain, line1, Q1, default=6)
    292294        Inlet_operator(domain, line2, Q2, default=3)
     
    298300
    299301
     302        warnings.simplefilter("default")
    300303        vol1 = domain.compute_total_volume()
    301304
  • trunk/anuga_core/anuga/test_all.py

    r9583 r9693  
    2626from anuga.utilities.terminal_width import terminal_width
    2727import anuga.utilities.system_tools as aust
     28from anuga import __version__
    2829
    2930
     
    3334
    3435# Directories that should not be searched for test files.
    35 exclude_dirs = ['shallow_water_balanced' , # Special requirements
     36exclude_dirs = ['shallow_water_balanced' ,
    3637                '.svn',          # subversion
    3738                'props', 'wcprops', 'prop-base', 'text-base', 'tmp']
     
    253254    # timestamp at the end
    254255    timestamp = time.asctime()
    255     major_revision = config.major_revision
     256    major_revision = __version__
    256257    minor_revision = aust.get_revision_number()
    257258    print '\nFinished at %s, version %s %s' % (timestamp, major_revision, minor_revision)
  • trunk/anuga_core/tools/install_packages.sh

    r9689 r9693  
    1818sudo apt-get install gfortran
    1919
     20##########################################################
     21# Setup various versions of MPI
    2022if [[ "$PARALLEL" == "mpich2" ]]; then
    2123    sudo apt-get install mpich2;
    2224fi
    2325
     26if [[ "$PARALLEL" == "openmpi" ]]; then
     27    sudo apt-get install -y libopenmpi-dev openmpi-bin;
     28fi
     29
     30
     31##########################################################
    2432if [[ "$DISTRIB" == "conda" ]]; then
     33
    2534    # Deactivate the travis-provided virtual environment and setup a
    2635    # conda-based environment instead
     
    3544    export PATH=$HOME/miniconda/bin:$PATH
    3645    conda update --yes conda
    37 
    38 
    3946
    4047    # Configure the conda environment and put it in the path using the
     
    5764   
    5865   
     66    # Install pypar if parallel set
     67        if [[ "$PARALLEL" == "mpich2" || "$PARALLEL" == "openmpi" ]]; then
     68        git clone https://github.com/daleroberts/pypar;
     69        pushd pypar;
     70        python setup.py install;
     71        popd;
     72        fi
     73       
    5974    # Useful for debugging any issues with conda
    6075    conda info -a
    6176
     77########################################################
    6278elif [[ "$DISTRIB" == "ubuntu" ]]; then
    6379    # Use standard ubuntu packages in their default version
     80   
    6481    sudo apt-get install -qq python-dev python-numpy python-scipy \
    6582                             python-matplotlib netcdf-bin \
     
    6784                             python-gdal python-pip
    6885
    69     pip install nose netCDF4 pyproj
     86    sudo pip install nose netCDF4 pyproj
     87   
     88    # Install pypar if parallel set
     89        if [[ "$PARALLEL" == "mpich2" || "$PARALLEL" == "openmpi" ]]; then
     90        git clone https://github.com/daleroberts/pypar;
     91        pushd pypar;
     92        python setup.py install;
     93        popd;
     94    fi
    7095fi
    7196
    7297
    73 # Install pypar if parallel set
    74 if [[ "$PARALLEL" == "mpich2" ]]; then
    75     git clone https://github.com/daleroberts/pypar;
    76     pushd pypar;
    77     python setup.py install;
    78     popd;
    79 fi
    80 
    81 
     98########################################################
    8299if [[ "$COVERAGE" == "--coverage" ]]; then
    83100    pip install coverage coveralls
Note: See TracChangeset for help on using the changeset viewer.