Skip to content

Commit

Permalink
Update submission.py (#499)
Browse files Browse the repository at this point in the history
Cleanup some unused comments

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
	- Enhanced submission state recovery through improved JSON handling.
- Improved job state management with refined error handling and logging.

- **Bug Fixes**
	- Updated methods to better manage unexpected job states.

- **Documentation**
- Clarified method signatures and functionality in the `Submission` and
`Job` classes for better understanding.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
yzhong52 authored Oct 1, 2024
1 parent 819eddf commit 9efc5c0
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions dpdispatcher/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def __init__(
*,
task_list=[],
):
# self.submission_list = submission_list
self.local_root = None
self.work_base = work_base
self._abs_work_base = os.path.abspath(work_base)
Expand Down Expand Up @@ -515,12 +514,9 @@ def submission_to_json(self):
def submission_from_json(cls, json_file_name="submission.json"):
with open(json_file_name) as f:
submission_dict = json.load(f)
# submission_dict = machine.context.read_file(json_file_name)
submission = cls.deserialize(submission_dict=submission_dict, machine=None)
return submission

# def check_if_recover()

def try_recover_from_json(self):
submission_file_name = f"{self.submission_hash}.json"
if_recover = self.machine.context.check_file_exists(submission_file_name)
Expand All @@ -545,7 +541,6 @@ def try_recover_from_json(self):
f"machine.context.remote_root:{self.machine.context.remote_root}; "
f"submission.work_base:{submission.work_base};"
)
# self = submission.bind_machine(machine=self.machine)
else:
print(self.serialize())
print(submission.serialize())
Expand Down Expand Up @@ -759,7 +754,6 @@ def __init__(
self.fail_count = 0
self.job_uuid = uuid.uuid4()

# self.job_hash = self.get_hash()
self.job_hash = self.get_hash()
self.script_file_name = self.job_hash + ".sub"

Expand Down

0 comments on commit 9efc5c0

Please sign in to comment.