Previous topic

Providing information about programs

Next topic

Handling provenance information

This Page

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=u'default', record_store=u'default', on_changed=u'error', description=u'', data_label=None, input_datastore=None, label_generator=u'timestamp', timestamp_format=u'%Y%m%d-%H%M%S', allow_command_line_parameters=True, plugins=[])

Bases: future.types.newobject.newobject

add_comment(label, comment, replace=False)
add_record(record)

Add a simulation or analysis record.

add_tag(label, tag)
backup()

Create a new backup directory in the same location as the project directory and copy the contents of the project directory into the backup directory. Uses _get_project_file to extract the path to the project directory.

Returns:
  • backup_dir: the directory used for the backup
change_record_store(new_store)

Change the record store that is used by this project.

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()
find_records(tags=None, reverse=False)
format_records(format=u'text', mode=u'short', tags=None, reverse=False)
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=u'', executable=u'default', repository=u'default', main_file=u'default', version=u'current', launch_mode=u'default', label=None, reason=None, timestamp_format=u'default', repeats=None)

Launch a new simulation or analysis.

load_plugins(*plugins)
most_recent()
new_record(parameters={}, input_data=[], script_args=u'', executable=u'default', repository=u'default', main_file=u'default', version=u'current', launch_mode=u'default', label=None, reason=None, timestamp_format=u'default')
next()
remove_plugins(*plugins)
remove_tag(label, tag)
repeat(original_label, new_label=None)
save()

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

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

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

valid_name_pattern = u'(?P<project>\\w+[\\w\\- ]*)'
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.