regression_nsh

Execute a series of short python runs to test whether a version of python is working.

Command line usage (if any):

usage:

regression.py [-np 3 -pf_dir test -out_dir foo] version

where

version

the executable of python

-np 3

the number of processors with which to run (default 3)

-pf_dir test

the directory containing all of the .pf files which will be run The defaults is $SIROCCO/examples/regress. One does not need to provide the full path name to the directory. The routine doit first searches the current workind directory for the directory and then looks in $SIROCCO/examples/

-out_dir foo

The directory (below the current working directory) where the tests will run. The defauld is constructed for the version and the data

Description:

The basic process is as follows

  1. Create a directory in which to work and intialize it

  2. Copy all of the relevant .pf files to this directory

  3. Switch to the working directory and run all the models, performing some basic checks

Primary routines:

doit: Internal routine which runs python on all of the pf files of interest. Use this if working in a python shell steer: A routine to parse the command lineh check_one: A routine which oversees checking of the runs

Notes

Regression here means to run a series of models. These routines do not compare the models to earlier runs

History:

170903 ksl Coding begun

Functions

check_one(xfile, root)

Perform some checks on what happened in a run

doit([version, pf_dir, out_dir, np, outputfile])

Test a specific version of python against a series of models

py_hydro(ver, outputfile)

This is a self contained script to perform specialised tests of the py_hydro models.

run_cmds(commands, root_names, outputfile)

steer(argv)

This is just a steering routine so that switches can be processed from the command line

sum_errors([root])

This sums the errors from various threads