Changeset 9722


Ignore:
Timestamp:
Apr 23, 2015, 8:21:24 PM (9 years ago)
Author:
steve
Message:

Added Gareths updates

Location:
trunk/anuga_core/anuga
Files:
4 edited

Legend:

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

    • Property svn:keywords changed from Revision to Date Revision
    r9721 r9722  
    2525__svn_revision__ = filter(str.isdigit, "$Revision$")
    2626
     27__svn_revision_date__ = "$Date$")
    2728
    2829
  • trunk/anuga_core/anuga/geometry/tests/test_polygon.py

    r9720 r9722  
    11741174        self.assertFalse(status!=2, 'Expected status 2, got status=%s, value=%s' %
    11751175                               (str(status), str(value)))
    1176         print line0, line1, value
    1177         print type(line0), type(value)
     1176        #print line0, line1, value
     1177        #print type(line0), type(value)
    11781178        self.assertTrue(num.allclose(value, line0))
    11791179
     
    19921992
    19931993if __name__ == "__main__":
    1994     suite = unittest.makeSuite(Test_Polygon,'test_intersection_bug_20081110_TR_BL')
     1994    suite = unittest.makeSuite(Test_Polygon,'test') #_intersection_bug_20081110_TR_BL')
    19951995    runner = unittest.TextTestRunner()
    19961996    runner.run(suite)
  • trunk/anuga_core/anuga/utilities/quantity_setting_functions.py

    r9719 r9722  
    342342                    pi_path = su.getRasterExtent(fi,asPolygon=True)
    343343
     344                    if verbose:
     345                        print 'Extracting extent from raster: ', fi
     346                        print 'Extent: ', pi_path
     347
    344348                elif( (type(pi) == str) and os.path.isfile(pi) ):
    345349                    # pi is a file
     
    504508                      ' nan_interpolation_region_polygon'
    505509
     510            if len(points_to_reinterpolate) > 0:
     511                msg = 'WARNING: nan interpolation is being applied. This ',\
     512                      'should be done in serial prior to distributing the ',\
     513                      'domain, as there is no parallel communication ',\
     514                      'implemented yet [so parallel results might depend on ',\
     515                      'the number of processes]'
     516                if verbose:
     517                    print msg
     518                   
     519
    506520            # Find the interpolation points = points not needing reinterpolation
    507521            ip = x*0 + 1
     
    514528
    515529            if len(nan_ip) > 0:
    516                 print len(nan_ip), ' points outside the nan_interpolation_region_polygon have nan values'
    517                 print 'This should not happen'
     530                print 'There are ', len(nan_ip), ' points outside the ',\
     531                      'nan_interpolation_region_polygon have nan values.'
     532                print 'The user should ensure this does not happen.'
    518533                print 'The points have the following coordinates:'
    519                 print xy_array_trans[ip,:]
    520                 msg = "There are nan points outside of nan_interpolation_region_polygon, even after all fall-through's"
     534                print xy_array_trans[ip[nan_ip],:]
     535                msg = "There are nan points outside of " +\
     536                      "nan_interpolation_region_polygon, even after all " +\
     537                      "fall-through's"
    521538                raise Exception(msg)
    522539         
  • trunk/anuga_core/anuga/utilities/tests/test_quantity_setting_functions.py

    r9679 r9722  
    192192        F=qs.composite_quantity_setting_function(
    193193            [[trenchPoly, -1000.], ['Extent', 'PointData_ElevTest.tif']],
    194             domain)
     194            domain,
     195            verbose=False)
    195196
    196197        # Points where we test the function
     
    216217            [[trenchPoly, -1000.], ['Extent', 'PointData_ElevTest.tif']],
    217218            domain,
    218             clip_range = [[-500., 1.0e+100], [-1.0e+100, 1.0e+100]])
     219            clip_range = [[-500., 1.0e+100], [-1.0e+100, 1.0e+100]],
     220            verbose=False)
    219221
    220222        # Points where we test the function
     
    241243        F = qs.composite_quantity_setting_function(
    242244            [[trenchPoly, f0], ['Extent', 'PointData_ElevTest.tif']],
    243             domain)
     245            domain,
     246            verbose=False)
    244247        fitted = F(testPts_X,testPts_Y)
    245248        # Now the fitted value in the trench should be determined by f0
     
    256259        F = qs.composite_quantity_setting_function(
    257260            [['All', f0 ], [None, 'PointData_ElevTest.tif']],
    258             domain)
     261            domain,
     262            verbose=False)
    259263        fitted=F(testPts_X,testPts_Y)
    260264        # Now the fitted value in the trench should be determined by f0
     
    267271            F=qs.composite_quantity_setting_function(
    268272                [['All', f0], ['All', 'PointData_ElevTest.tif']],
    269                 domain)
     273                domain,
     274                verbose=False)
    270275            # Need to call it to get the error
    271276            F(numpy.array([3.]), numpy.array([3.]))
     
    279284                [[trenchPoly, f0], ['All', 'PointData_ElevTest.tif']],
    280285                domain,
    281                 clip_range = [[ -500., -1000.], [-1.0e+100, 1.0e+100]])
     286                clip_range = [[ -500., -1000.], [-1.0e+100, 1.0e+100]],
     287                verbose=False)
    282288            return
    283289        self.assertRaises(Exception, lambda: should_fail_1())
Note: See TracChangeset for help on using the changeset viewer.