Changeset 9203


Ignore:
Timestamp:
Jun 19, 2014, 6:49:04 PM (10 years ago)
Author:
steve
Message:

Got rid of a few print statments in test_spatialInputUtil

Location:
trunk/anuga_core/source/anuga/utilities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/utilities/spatialInputUtil.py

    r9201 r9203  
    264264    segLen=(seg_unitVec_x**2+seg_unitVec_y**2)**0.5
    265265    if(segLen==0.):
    266         print line
    267         print 'Pt'
    268         print pt
    269         raise Exception, 'Line has repeated points'
     266        #print line
     267        #print 'Pt'
     268        #print pt
     269        raise Exception, 'Line has repeated points: Line %s Pt %s' % (str(line),str(pt))
    270270    seg_unitVec_x=seg_unitVec_x/segLen
    271271    seg_unitVec_y=seg_unitVec_y/segLen
     
    472472        if(L1_L2_intersect.GetGeometryCount()==1):
    473473            if(not check_polygon_is_small(L1_L2_intersect, buf, tol2)):
    474                 print L1_L2_intersect.GetEnvelope()
    475                 raise Exception, 'line intersection is not allowed'
     474                #print L1_L2_intersect.GetEnvelope()
     475                raise Exception, 'line intersection is not allowed. Envelope %s '% str(L1_L2_intersect.GetEnvelope())
    476476            # Seems to need special treatment with only 1 intersection point
    477477            intersectionPts=[L1_L2_intersect.Centroid().GetPoint()]
  • trunk/anuga_core/source/anuga/utilities/test_spatialInputUtil.py

    r9201 r9203  
    1616from anuga.utilities import spatialInputUtil as su
    1717       
     18# pull -v argument from command line
     19verbose = anuga.get_args().verbose
    1820
    1921class Test_spatialInputUtil(unittest.TestCase):
     
    206208        seg2_wkb=su.ListPts2Wkb(seg2,geometry_type='line')
    207209
    208         newSeg1,newSeg2=su.addIntersectionPtsToLines(seg1_wkb,seg2_wkb,verbose=False)
     210        newSeg1,newSeg2=su.addIntersectionPtsToLines(seg1_wkb,seg2_wkb,verbose=verbose)
    209211        newSeg1=su.Wkb2ListPts(newSeg1)
    210212        newSeg2=su.Wkb2ListPts(newSeg2)
     
    221223        seg1_wkb=su.ListPts2Wkb(seg1,geometry_type='line')
    222224        seg2_wkb=su.ListPts2Wkb(seg2,geometry_type='line')
    223         newSeg1,newSeg2=su.addIntersectionPtsToLines(seg1_wkb,seg2_wkb,verbose=False)
     225        newSeg1,newSeg2=su.addIntersectionPtsToLines(seg1_wkb,seg2_wkb,verbose=verbose)
    224226        newSeg1=su.Wkb2ListPts(newSeg1)
    225227        newSeg2=su.Wkb2ListPts(newSeg2)
     
    241243        seg2_wkb=su.ListPts2Wkb(seg2,geometry_type='line')
    242244
    243         newSeg1,newSeg2=su.addIntersectionPtsToLines(seg1_wkb,seg2_wkb,verbose=False,\
     245        newSeg1,newSeg2=su.addIntersectionPtsToLines(seg1_wkb,seg2_wkb,verbose=verbose,\
    244246                                point_movement_threshold=0.01)
    245247        newSeg1=su.Wkb2ListPts(newSeg1)
     
    327329            newBP, newBL, newRW=su.add_intersections_to_domain_features(bounding_polygon,\
    328330                                    breakLines, riverWalls, point_movement_threshold=0.02,\
    329                                     verbose=False)
     331                                    verbose=verbose)
    330332            assert False
    331333        except:
    332334            assert True
    333335
     336        #print 'After first add_iinersections'
    334337        #################################################################
    335338        # Fix the riverwall, and it should work
     
    339342        newBP, newBL, newRW=su.add_intersections_to_domain_features(bounding_polygon,\
    340343                                breakLines, riverWalls, point_movement_threshold=0.02,\
    341                                 verbose=False)
     344                                verbose=verbose)
    342345
    343346        return
     
    346349if __name__ == "__main__":
    347350    suite = unittest.makeSuite(Test_spatialInputUtil, 'test')
    348     runner = unittest.TextTestRunner()
     351    runner = unittest.TextTestRunner(verbosity=1)
    349352    runner.run(suite)
Note: See TracChangeset for help on using the changeset viewer.