Handling provenance information

The records module defines the Record class, which gathers and stores information about an individual simulation or analysis run.

class sumatra.records.Record(executable, repository, main_file, version, launch_mode, datastore, parameters={}, input_data=[], script_arguments='', label=None, reason='', diff='', user='', on_changed='error', input_datastore=None, stdout_stderr='Not launched.', timestamp=None, timestamp_format='%Y%m%d-%H%M%S')

Bases: object

The Record class has two main roles: capturing information about the context of a computation, and storing this information for later retrieval.

add_tag(tag)
property command_line

Return the command-line string for the computation captured by this record.

delete_data()

Delete any data files associated with this record.

describe(format='text', mode='long')

Return a description of the record.

mode:

either ‘long’ or ‘short’

format

either ‘text’ or ‘html’

difference(other_record, ignore_mimetypes=[], ignore_filenames=[])

Determine the difference between this computational experiment and another (code, platform, results, etc.).

Return a RecordDifference object.

register(working_copy)

Record information about the environment.

run(with_label=False, project=None)

Launch the simulation or analysis.

with_label

adds the record label either to the parameter file (with_label=”parameters”) or to the end of the command line (with_label=”cmdline”), and appends the label to the datastore root. This allows the program being run to create files in a directory specific to this run.

property script_content

Return the script content from the main file.

valid_name_pattern = '(?P<label>\\w+[\\w|\\-\\.:/\\s]*)'
class sumatra.records.RecordDifference(recordA, recordB, ignore_mimetypes=[], ignore_filenames=[])

Bases: object

Represents the difference between two Record objects.

property code_differs
property dependencies_differ
property dependency_differences
ignore_filenames = ['\\.log', '^log']
ignore_mimetypes = []
property input_data_differ
property input_data_differences
property launch_mode_differences
property output_data_differ
property output_data_differences
property parameter_differences
property recordA_script_content_diff
property recordB_script_content_diff
script_content_diff(record, other)