retro

Run multiple commits on the same .pf file to see where changes arose.

Synopsis:

The functions here are intended to ease running a collection of commits on the same parameter file so that one can locate where a change in Python occured.

Command line usage (if any):

None at present. These are intend to be run as part as a Jupyter script or from a python window

Description:

Primary routines:

log2table -

create an ascii table that summarizes the log and contains entries for compiling and running python many times

compile_many -

create at lot of Python executables in a local directory

run_many -

runs a set of python executables

plot_many -

plot consecutive sets of the outputs

Notes

To use this, create a directory where one wants to run

Create a text file by running:

git log > commit.txt (or whatever

Edit this file so it includes only the commit range in which you are interested.

Run the function log2table to create a file which contains a summary of the logfile. This file, hereafter the masterfile, has additional columnns needed for the remainder of the effort

Run the function compile_many to compile every nth commit. The various versions of python will be called py_x001, etc, where 001 corresponds to the nubmer of the commit going from most recent to oldest.

Put the .pf file in your local directory. The runs are going to occur in a subdirectories name r_py_x001 etc.

If the run requires special files, such as seds that are not part of the normal python distribution, one needs to adjust the parameter files to work in the subdirectories. (The above sentence is worth repeating, because the system can easily hang up if this is not correct. python will exit but mpirun will not catch this problem, and so the subprocess routine will not exist until it times out.)

Run the function run_many to run all of the model that you have compiled.

Run the function plot_many to examine what the various spectra look like

History:

210220 ksl Coding begun

Functions

check4differences([masterfile, print_output])

Check for changes between compiled versions

check_completion([parameter_file])

Check the .sig file to see if a run has completed

check_inputs([command, parameter_file, ...])

Check that a parameter file has the appropriate parameters to run with a version of python

compile_many([masterfile, increment, nmin, ...])

This routine compiles a number of versions of python and checks to see if the code has changed between the time it has changed.

compile_one([commit, number, print_output])

Compile a single commit of Python and move the executable to a local directory.

get_python_source_directory()

log2table([logfile, masterfile])

Create a ascii table from a file that contains a normal git log (or the portion of a log that has been edited to be in the time period of interest

plot_many([masterfile, file, colname, ...])

Plot spectra from a set of models all of which should in various sub-dirctories.

plot_two([dir1, dir2, file, colname, ...])

Create plots that compare two Python runs

read_table([filename, format])

Read a file using astropy.io.ascii and return this

run_many([master, parameter_file, ...])

Run many versions of python on a single parameter file.

run_one([command, parameter_file, np, ...])

Run a single model, with a timeout, in the current working directory

xsmooth(flux[, smooth])

boxcar smooth the flux