Ignore:
Timestamp:
Jul 22, 2009, 9:22:11 AM (16 years ago)
Author:
rwilson
Message:

Replaced 'print' statements with log.critical() calls.

Location:
anuga_core/source/anuga/utilities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/utilities/numerical_tools.py

    r7276 r7317  
    77from warnings import warn
    88
     9import anuga.utilities.log as log
    910import numpy as num
    1011
     
    4142            raise ValueError, errmsg
    4243        else:
    43             print 'NOTE: changing argument to acos from %.18f to 1.0' %x
     44            log.critical('NOTE: changing argument to acos from %.18f to 1.0' %x)
    4445            x = 1.0
    4546
  • anuga_core/source/anuga/utilities/polygon.py

    r7276 r7317  
    99from anuga.geospatial_data.geospatial_data import ensure_absolute, Geospatial_data
    1010from anuga.config import netcdf_float
     11import anuga.utilities.log as log
    1112
    1213
     
    642643
    643644    if verbose:
    644         print 'Found %d points (out of %d) inside polygon' % (count, M)
     645        log.critical('Found %d points (out of %d) inside polygon' % (count, M))
    645646
    646647    return indices, count
     
    929930                   'within its regions in [%.2f, %.2f], y in [%.2f, %.2f]'
    930931                   % (min(x), max(x), min(y), max(y)))
    931             print msg
     932            log.critical(msg)
    932933
    933934        return z
     
    11211122    # TO DO check if any of the regions fall inside one another
    11221123
    1123     print '----------------------------------------------------------------------------'
    1124     print 'Polygon   Max triangle area (m^2)   Total area (km^2)   Estimated #triangles'
    1125     print '----------------------------------------------------------------------------'   
     1124    log.critical('-' * 80)
     1125    log.critical('Polygon   Max triangle area (m^2)   Total area (km^2) '
     1126                 'Estimated #triangles')
     1127    log.critical('-' * 80)
    11261128       
    11271129    no_triangles = 0.0
     
    11341136        area -= this_area
    11351137
    1136         print 'Interior ',
    1137         print ('%.0f' % resolution).ljust(25),
    1138         print ('%.2f' % (this_area/1000000)).ljust(19),
    1139         print '%d' % (this_triangles)
     1138        log.critical('Interior %s%s%d'
     1139                     % (('%.0f' % resolution).ljust(25),
     1140                        ('%.2f' % (this_area/1000000)).ljust(19),
     1141                        this_triangles))
     1142        #print 'Interior ',
     1143        #print ('%.0f' % resolution).ljust(25),
     1144        #print ('%.2f' % (this_area/1000000)).ljust(19),
     1145        #print '%d' % (this_triangles)
    11401146
    11411147    bound_triangles = area/remainder_res
    11421148    no_triangles += bound_triangles
    11431149
    1144     print 'Bounding ',
    1145     print ('%.0f' % remainder_res).ljust(25),
    1146     print ('%.2f' % (area/1000000)).ljust(19),
    1147     print '%d' % (bound_triangles)
     1150    log.critical('Bounding %s%s%d'
     1151                 % (('%.0f' % remainder_res).ljust(25),
     1152                    ('%.2f' % (area/1000000)).ljust(19),
     1153                    bound_triangles))
     1154    #print 'Bounding ',
     1155    #print ('%.0f' % remainder_res).ljust(25),
     1156    #print ('%.2f' % (area/1000000)).ljust(19),
     1157    #print '%d' % (bound_triangles)
    11481158
    11491159    total_number_of_triangles = no_triangles/0.7
    11501160
    1151     print 'Estimated total number of triangles: %d' %total_number_of_triangles
    1152     print 'Note: This is generally about 20% less than the final amount'
     1161    log.critical('Estimated total number of triangles: %d'
     1162                 % total_number_of_triangles)
     1163    log.critical('Note: This is generally about 20%% '
     1164                 'less than the final amount')
    11531165
    11541166    return int(total_number_of_triangles)
  • anuga_core/source/anuga/utilities/quad.py

    r7276 r7317  
    66from treenode import TreeNode
    77import string, types, sys
     8import anuga.utilities.log as log
    89
    910
     
    124125            three_cells = self.branch.pop()
    125126            for cell in three_cells:
    126                 #print "cell ", cell.show()
    127127                points += cell.retrieve(get_vertices=get_vertices)
    128128        return points, self.branch
     
    223223            triangles = {}
    224224            verts = self.retrieve_vertices()
    225             # print "verts", verts
    226225            for vert in verts:
    227226                triangle_list = self.mesh.get_triangles_and_vertices_per_node(vert)
    228227                for k, _ in triangle_list:
    229228                    if not triangles.has_key(k):
    230                         # print 'k',k
    231229                        tri = self.mesh.get_vertex_coordinates(k,
    232230                                                               absolute=True)
     
    372370        """
    373371        if depth == 0:
    374             print
    375         print "%s%s" % ('  '*depth, self.name),
    376         if self.children:
    377             print
     372            log.critical()
     373        log.critical("%s%s" % ('  '*depth, self.name))
     374        if self.children:
     375            log.critical()
    378376            for child in self.children:
    379377                child.show(depth+1)
    380378        else:
    381             print '(xmin=%.2f, xmax=%.2f, ymin=%.2f, ymax=%.2f): [%d]'\
    382                   %(self.western, self.eastern,
    383                     self.southern, self.northern,
    384                     self.count())
     379            log.critical('(xmin=%.2f, xmax=%.2f, ymin=%.2f, ymax=%.2f): [%d]'
     380                         % (self.western, self.eastern, self.southern,
     381                            self.northern, self.count()))
    385382
    386383
     
    390387        """
    391388        if depth == 0:
    392             print
    393         print "%s%s:" % ('  '*depth, self.name),
     389            log.critical()
     390        log.critical("%s%s:" % ('  '*depth, self.name))
    394391        if self.children:
    395392            print
     
    397394                child.show_all(depth+1)
    398395        else:
    399             print '%s' %self.retrieve()
     396            log.critical('%s' % self.retrieve())
    400397
    401398
  • anuga_core/source/anuga/utilities/system_tools.py

    r7276 r7317  
    1515except ImportError:
    1616    import md5 as hashlib
     17
     18import anuga.utilities.log as log
    1719
    1820
     
    238240
    239241        if verbose is True:
    240             print 'Version info stored to %s' %filename
     242            log.critical('Version info stored to %s' % filename)
    241243
    242244
Note: See TracChangeset for help on using the changeset viewer.