Managing projects

The projects module defines the Project class, which stores information about a computation-based project and contains a number of methods for managing and running computational experiments, whether simulations, analyses or whatever. This is the main class that is used directly when using Sumatra within your own scripts.

class sumatra.projects.Project(name, default_executable=None, default_repository=None, default_main_file=None, default_launch_mode=None, data_store='default', record_store='default', on_changed='error', description='', data_label=None, input_datastore=None, label_generator='timestamp', timestamp_format='%Y%m%d-%H%M%S')

Bases: object

add_comment(label, comment)
add_record(record)

Add a simulation or analysis record.

add_tag(label, tag)
compare(label1, label2, ignore_mimetypes=[], ignore_filenames=[])
data_label
delete_by_tag(tag, delete_data=False)

Delete all records with a given tag. Return the number of records deleted.

delete_record(label, delete_data=False)

Delete a record. Return 1 if the record is found. Otherwise return 0.

export()
format_records(format='text', mode='short', tags=None)
get_record(label)

Search for a record with the supplied label and return it if found. Otherwise return None.

info()

Show some basic information about the project.

launch(parameters={}, input_data=[], script_args='', executable='default', repository='default', main_file='default', version='latest', launch_mode='default', label=None, reason=None, timestamp_format='default')

Launch a new simulation or analysis.

most_recent()
new_record(parameters={}, input_data=[], script_args='', executable='default', repository='default', main_file='default', version='latest', launch_mode='default', label=None, reason=None, timestamp_format='default')
remove_tag(label, tag)
save()

Save state to some form of persistent storage. (file, database).

show_diff(label1, label2, mode='short', ignore_mimetypes=[], ignore_filenames=[])
update_code(working_copy, version='latest')

Check if the working copy has modifications and prompt to commit or revert them.

sumatra.projects.load_project(path=None)

Read project from directory passed as the argument and return Project object. If no argument is given, the project is read from the current directory.