shapepipe.pipeline.run_log

shapepipe.pipeline.run_log

RUN LOG HANDLING.

This module defines methods for creating a run log.

Author

Samuel Farrens <samuel.farrens@cea.fr>

class RunLog(run_log_file, module_list, current_run)[source]

Bases: object

Run Log Class.

This class manages the run log for ShapePipe.

Parameters
  • run_log_file (str) – Name of the run log file

  • module_list (list) – List of modules to be run

  • current_run (str) – Name of the current run

_write()[source]

Write.

Write current run to the run log.

get_run(search_string)[source]

Get Run.

Get a specific run that matches the input search string.

Parameters

search_string (str) – Pattern to match to runs

Returns

The run matching the search string

Return type

str

Raises
  • RuntimeError – If no runs found that match the search string

  • RuntimeError – If more than one run is found matches the search string

get_list(run_log_file)[source]

Get List.

Get a list of all runs in the run log.

Parameters

run_log_file (str) – Run log file name

Returns

Run log file entries

Return type

list

get_all(runs, module)[source]

Get All.

Get all previous pipeline runs of a given model.

Parameters
  • runs (list) – Log file entries consisting of directory and module(s)

  • module (str) – Module name

Raises

RuntimeError – If no previous runs are found

Returns

All run paths for a given module

Return type

list

get_last(runs, module)[source]

Get Last.

Get the last run of the pipeline for a given module.

Parameters
  • runs (list) – Log file entries consisting of directory and module(s)

  • module (str) – Module name

Returns

The last run for a given module

Return type

str

get_last_dir(run_log_file, module)[source]

Get Last Dir.

Return directory path corresponding to last run of given module.

Parameters
  • run_log_file (str) – Run log file name

  • module (str) – Module name

Returns

Directory name of last module run

Return type

str