Changeset 7567


Ignore:
Timestamp:
Nov 24, 2009, 3:25:22 PM (15 years ago)
Author:
ole
Message:

Got rid of environment variables and move log file to output dir.
The logging module will need some work, though.

Location:
anuga_validation/automated_validation_tests/patong_beach_validation
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • anuga_validation/automated_validation_tests/patong_beach_validation/project.py

    r7566 r7567  
    192192
    193193# create paths generated from environment variables.
    194 home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
    195 muxhome = os.getenv(ENV_MUXHOME)
    196    
     194#home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
     195#muxhome = os.getenv(ENV_MUXHOME)
     196
     197output_dirname = os.path.dirname(__file__)
     198home = os.path.join(output_dirname, 'local_data', 'data')
     199muxhome = home # FIXME (Ole): Get rid off
     200
    197201# check various directories/files that must exist
    198202anuga_folder = join(home, state, scenario_folder, 'anuga')
  • anuga_validation/automated_validation_tests/patong_beach_validation/run_model.py

    r7276 r7567  
    2828# Related major packages
    2929from Scientific.IO.NetCDF import NetCDFFile
    30 #import numpy as num
    3130
    3231from anuga.interface import create_domain_from_regions
     
    4544from anuga.caching import cache
    4645
     46import project
    4747import anuga.utilities.log as log
     48
     49#-------------------------------------------------------------------------------
     50# Copy scripts to time stamped output directory and capture screen
     51# output to file. Copy script must be before screen_catcher
     52#-------------------------------------------------------------------------------
     53
     54# Make output dir and set log filename before anything is logged
     55os.mkdir(project.output_run)
     56# Tell log module to store log file in output dir
     57log.log_filename = os.path.join(project.output_run, 'anuga.log')
     58log.critical('Log filename: %s' % log.log_filename)
     59
     60
     61output_dirname = os.path.dirname(project.__file__)
     62copy_code_files(project.output_run,
     63                [__file__,
     64                 os.path.join(output_dirname, project.__name__+'.py'),
     65                 os.path.join(output_dirname, 'setup_model.py')],
     66                verbose=True
     67                )
    4868
    4969# Application specific imports
     
    5171import build_urs_boundary as bub
    5272
    53 #-------------------------------------------------------------------------------
    54 # Copy scripts to time stamped output directory and capture screen
    55 # output to file. Copy script must be before screen_catcher
    56 #-------------------------------------------------------------------------------
    57 
    58 copy_code_files(project.output_run,
    59                 [__file__,
    60                  os.path.join(os.path.dirname(project.__file__),
    61                               project.__name__+'.py'),
    62                  os.path.join(os.path.dirname(project.__file__),
    63                               'setup_model.py')],
    64                 verbose=True
    65                )
    66 #start_screen_catcher(project.output_run, 0, 1)
    6773
    6874#-------------------------------------------------------------------------------
  • anuga_validation/automated_validation_tests/patong_beach_validation/setup_model.py

    r7001 r7567  
    2323
    2424# Test that environment variables are defined.
    25 if os.getenv(project.ENV_INUNDATIONHOME) is None:
    26     print "Environment variable '%s' is not set" % project.ENV_INUNDATIONHOME
    27     sanity_error = True
    28 
    29 if os.getenv(project.ENV_MUXHOME) is None:
    30     print "Environment variable '%s' is not set" % project.ENV_MUXHOME
    31     sanity_error = True
     25#if os.getenv(project.ENV_INUNDATIONHOME) is None:
     26#    print "Environment variable '%s' is not set" % project.ENV_INUNDATIONHOME
     27#    sanity_error = True
     28#
     29#if os.getenv(project.ENV_MUXHOME) is None:
     30#    print "Environment variable '%s' is not set" % project.ENV_MUXHOME
     31#    sanity_error = True
    3232
    3333#-------------------------------------------------------------------------------
  • anuga_validation/automated_validation_tests/patong_beach_validation/validate.py

    r7544 r7567  
    1818import anuga.utilities.log as log
    1919
     20log.log_filename = './validation.log'
    2021
    2122# sourceforge download mirror hosts (must end with '/')
Note: See TracChangeset for help on using the changeset viewer.