Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setUpClass(cls):
cls.sub_status = SubmissionStatus()
cls.database = DatabaseAccess('sqlite:///test_sub_status.db', 'simulation')
par_dict = {'chemicalformula': 'H',
'computer': 'localhost#1#3',
'hamilton': 'Test',
'hamversion': '0.1',
'job': 'testing',
'parentid': 0,
'project': 'database.testing',
'projectpath': '/TESTING',
'status': 'suspended',
'timestart': datetime(2016, 5, 2, 11, 31, 4, 253377),
'timestop': datetime(2016, 5, 2, 11, 31, 4, 371165),
'totalcputime': 0.117788,
'username': 'Test'}
cls.job_id = cls.database.add_item_dict(par_dict)
cls.sub_status_database = SubmissionStatus(db=cls.database, job_id=cls.job_id)
cls.database = DatabaseAccess('sqlite:///test_sub_status.db', 'simulation')
par_dict = {'chemicalformula': 'H',
'computer': 'localhost#1#3',
'hamilton': 'Test',
'hamversion': '0.1',
'job': 'testing',
'parentid': 0,
'project': 'database.testing',
'projectpath': '/TESTING',
'status': 'suspended',
'timestart': datetime(2016, 5, 2, 11, 31, 4, 253377),
'timestop': datetime(2016, 5, 2, 11, 31, 4, 371165),
'totalcputime': 0.117788,
'username': 'Test'}
cls.job_id = cls.database.add_item_dict(par_dict)
cls.sub_status_database = SubmissionStatus(db=cls.database, job_id=cls.job_id)
def refresh_submission_status(self):
"""
Refresh the submission status - if a job ID job_id is set then the submission status is loaded from the
database.
"""
if self.job_id:
self.submission_status = SubmissionStatus(
db=self._hdf5.db, job_id=self.job_id
)
self.submission_status.refresh()
def refresh_submission_status(self):
"""
Refresh the submission status - if a job ID job_id is set then the submission status is loaded from the
database.
"""
if self.job_id:
self.submission_status = SubmissionStatus(
db=self.project.db, job_id=self.job_id
)
self.submission_status.refresh()
def __init__(self, project, job_name):
self._input = GenericParameters("parameters")
super(ListMaster, self).__init__(project, job_name=job_name)
self.__name__ = "ListMaster"
self.__version__ = "0.1"
self._input["mode"] = "parallel"
self.submission_status = SubmissionStatus(db=project.db, job_id=self.job_id)
self.refresh_submission_status()
def refresh_submission_status(self):
"""
Refresh the submission status - if a job ID job_id is set then the submission status is loaded from the
database.
"""
if self.job_id:
self.submission_status = SubmissionStatus(
db=self.project.db, job_id=self.job_id
)
self.submission_status.refresh()