regression
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 -x 'whatever' -pf_dir test -out_dir foo] version
- 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/
- -x ‘-v/c’
Extra switches to be applied to the run, such as using linear Doppler shifts. Note that these will be applied to everything except the hydro calculation so use with caution. This should be a single string
- -out_dir foo
The directory (below the current working directory) where the tests will run. The default is constructed for the version and the data
Description:
The basic process is as follows
Create a directory in which to work and intialize it
Copy all of the relevant .pf files to this directory
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. There is a seperate python script to compare models to between regression tests
Sometimes it will be desirable to run different tests with different command line switches. This can be accomplished using a named file ‘commands.txt’ in the pf_dir directory. This file should contain lines for at least the pf files to which one wishes to apply these switches. The line in the file should read
py switches and the pf file name, e.g:
py -gamma agn_gamma.pf
The global switches obtained from the command line are applied after the individual swithches
It is possible to add special tests for regression, either to because models must be run in a certain order or because special options must be used. These should be added in a special section of doit, and should be self-contained.
History:
- 170903 ksl
Coding begun
- 180225 ksl
nsh had added a special test for hydro. This is useful in the sense that it allows one to deal with situations where several runs must be carreid out sequentially but but the mechanism that he chose makes it difficult to add new tests, because the standard and speciial tests are not sufficently isolated from one another.
Functions
|
Perform some checks on what happened in a run |
|
Test a specific version of python against a series of models |
|
|
|
This is just a steering routine so that switches can be processed from the command line |
|
This sums the errors from various threads |