seamm_datastore package
Subpackages
- seamm_datastore.database package
- Submodules
- seamm_datastore.database.build module
- seamm_datastore.database.models module
FlowchartFlowchart.conceptdoiFlowchart.create()Flowchart.create_from_file()Flowchart.creatorsFlowchart.descriptionFlowchart.doiFlowchart.flowchart_metadataFlowchart.flowchart_versionFlowchart.get_or_create_from_file()Flowchart.groupFlowchart.group_idFlowchart.group_permissionsFlowchart.idFlowchart.jobsFlowchart.jsonFlowchart.keywordsFlowchart.other_permissionsFlowchart.ownerFlowchart.owner_idFlowchart.owner_permissionsFlowchart.parse_flowchart_file()Flowchart.projectsFlowchart.sha256Flowchart.sha256_strictFlowchart.title
GroupGroupProjectAssociationJobJob.create()Job.create_from_file()Job.descriptionJob.finishedJob.flowchartJob.flowchart_idJob.groupJob.group_idJob.group_permissionsJob.idJob.last_updateJob.other_permissionsJob.ownerJob.owner_idJob.owner_permissionsJob.parametersJob.parse_job_data()Job.pathJob.projectsJob.startedJob.statusJob.submittedJob.titleJob.update()
ProjectProject.create()Project.descriptionProject.flowchartsProject.groupProject.group_idProject.group_permissionsProject.idProject.jobsProject.nameProject.other_permissionsProject.ownerProject.owner_idProject.owner_permissionsProject.pathProject.permissions_query()Project.special_groupsProject.special_usersProject.update()
ResourceRoleUserUserProjectAssociationutc_now()
- seamm_datastore.database.schema module
- Module contents
- seamm_datastore.tests package
- Submodules
- seamm_datastore.tests.conftest module
- seamm_datastore.tests.test_build module
- seamm_datastore.tests.test_create module
test_add_job()test_create_user()test_flowchart_duplicate_hash_raises()test_flowchart_from_file()test_flowchart_get_or_create_concurrent_race()test_flowchart_parse()test_flowchart_sha256_strict_unique_constraint()test_job_create_shared_flowchart_reuses_row()test_project_create()test_project_create_group()test_project_exists()test_project_no_user()
- seamm_datastore.tests.test_errors module
- seamm_datastore.tests.test_methods module
- seamm_datastore.tests.test_seamm_datastore module
- Module contents
Submodules
seamm_datastore.connect module
Class and functions for connection to database.
- class seamm_datastore.connect.SEAMMDatastore(database_uri: str = 'sqlite:///:memory:', initialize: bool = False, permissions: dict = None, username: str = None, password: str = None, datastore_location: str = None, default_project: str = 'default', timeout: float = 20.0)[source]
Bases:
object- add_job(id, flowchart_filename, project_names=['default'], path=None, title='', description='', submitted=None, started=None, finished=None, parameters=None, status='submitted')[source]
- finish_job(job_id, finish_time, status='finished')[source]
Set the status and time that the job finished.
- Parameters:
job_id (int) – The ID of the job, eg. 209
finish_time (datetime.datetime) – The UTC time when the job finished.
status (str) – The status, such as “error” or the default, “finished”
as_json (bool = False) – Ignored
current_user (str or User = None) – Ignored
- Returns:
True if the finish time was successfully set, False otherwise.
- Return type:
bool
- seamm_datastore.connect.login_required(method)[source]
Decorator for actions requiring current user
- seamm_datastore.connect.manage_session(function)[source]
Decorator for closing sqlalchemy sessions when attached to SEAMMDatastore class.
- seamm_datastore.connect.session_scope(session, timeout=20.0)[source]
Provide a transactional scope around a series of operations.
- Parameters:
session (callable) – A session factory (e.g. a
scoped_session) returning a new session.timeout (float) – Seconds to keep retrying the commit while the (SQLite) database is locked by another process. Together with the connection-level
PRAGMA busy_timeoutthis lets many jobs register in the datastore at the same time – e.g. a batch of SLURM jobs starting together – without failing with “database is locked”. Default: 20 s.
seamm_datastore.util module
Util Functions and classes
Module contents
seamm_datastore The database models for the seamm datastore
- seamm_datastore.connect
alias of
SEAMMDatastore