def calculated_status(self): master_status = self.jobs.filter(role=TaskType.MASTER)[0].last_status calculated_status = master_status if JobLifeCycle.is_done(master_status) else None if calculated_status is None: calculated_status = ExperimentLifeCycle.jobs_status(self.last_job_statuses) if calculated_status is None: return self.last_status return calculated_status
def calculated_status(self): master_status = self.jobs.filter(role=TaskType.MASTER)[0].last_status calculated_status = master_status if JobLifeCycle.is_done(master_status) else None if calculated_status is None: calculated_status = ExperimentLifeCycle.jobs_status(self.last_job_statuses) if calculated_status is None: return self.last_status return calculated_status
def calculated_status(self) -> str: master_status = self.jobs.order_by('created_at').first().last_status calculated_status = master_status if JobLifeCycle.is_done( master_status) else None if calculated_status is None: calculated_status = ExperimentLifeCycle.jobs_status( self.last_job_statuses) if calculated_status is None: return self.last_status return calculated_status