Changeset 6702


Ignore:
Timestamp:
Apr 2, 2009, 4:04:16 PM (15 years ago)
Author:
rwilson
Message:

Further numpy back merges from main trunk.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • anuga_validation/okushiri_2005/test_caching_of_set_quantity.py

    r6550 r6702  
    77This script depends on  Benchmark_2.msh and Benchmark_2_Bathymetry.pts
    88"""
     9# FIXME(Ole): This needs to become a unit test - in automated validation tests under Okushiri.
    910
    10 # FIXME(Ole): This script is obsolete and has been moved into the
    11 # automatic validation unit test suite.
     11# FIXME(Ole): This won't work until ticket:314 has been fixed.
    1212
    1313# Module imports
     
    3838          'alpha': alpha,
    3939          'verbose': internal_verbose,
     40          'acceptable_overshoot': 1.01, # This is the default value in _fit_to_mesh - actually, not implemented. Remove!
    4041          'mesh_origin': None,
    4142          'data_origin': None,
  • branches/numpy/anuga/utilities/log.py

    r6689 r6702  
    1919to configure the logging.
    2020Note that this module uses features of the logging package that were introduced
    21 in python2.5.  If running on earlier versions, these features are disables:
    22     . Module name + line number
     21in python2.5.  If running on earlier versions, these features are disabled:
     22    . Calling module name + line number
    2323'''
    2424
     
    8484    if not _setup:
    8585        # sanity check the logging levels, require console >= file
    86         if console_logging_level < log_logging_level:
     86        if log_logging_level > console_logging_level:
    8787            log_logging_level = console_logging_level
    8888
     
    122122    for (fpath, lnum, mname, _) in frames:
    123123        fname = os.path.basename(mname).rsplit('.', 1)[0]
     124        print 'fname=%s, mname=%s' % (fname, mname)
    124125        if mname != __name__:
    125126            break
     
    164165    log(logging.CRITICAL, msg)
    165166
    166 def resource_usage(level=logging.CRITICAL):
    167     '''Log resource usage at given log level.'''
     167##
     168# @brief Log memory usage at time of call.
     169# @param level Override the default INFO logging level.
     170# @note From http://code.activestate.com/recipes/286222/.
     171def resource_usage(level=logging.INFO):
     172    '''Log memory usage at given log level.'''
    168173
    169174    if sys.platform != 'win32':
     
    213218    else:
    214219        pass
     220
     221if __name__ == "__main__":
     222    debug('DEBUG message')
     223    info('INFO message')
     224    warning('WARNING message')
  • branches/numpy/anuga/utilities/log_test.py

    r6697 r6702  
    2727
    2828    def tearDown(self):
    29         if os.path.exists(LOGFILE_NAME):
    30             os.remove(LOGFILE_NAME)
    31         if os.path.exists(STDOUT_LOG_NAME):
    32             os.remove(STDOUT_LOG_NAME)
     29        pass
     30#        if os.path.exists(LOGFILE_NAME):
     31#            os.remove(LOGFILE_NAME)
     32#        if os.path.exists(STDOUT_LOG_NAME):
     33#            os.remove(STDOUT_LOG_NAME)
    3334
    3435    ##
Note: See TracChangeset for help on using the changeset viewer.