deepmodeling / deepmodeling/dpti

[Code scan] Remote job submission crashes when resources are omitted

Open Beginner friendly
#133 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
42
Forks
27
PR merge metrics
No merged PRs in 30d

Description

Source: Codex global repository scan of deepmodeling/dpti at commit b719828e7eeb571bd26411430197cd74ea78e38c.
Project: https://github.com/orgs/deepmodeling/projects/27

Problem
`_set_default_resource(None)` creates a local dict but does not return it. Public remote-job script generation paths call `_set_default_resource(resources)` or `_set_default_resource(res)` and then immediately dereference the original argument, which is still `None`. Omitted resources therefore crash instead of using defaults.

Code references
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/lib/RemoteJob.py#L18
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/lib/RemoteJob.py#L36
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/lib/RemoteJob.py#L236
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/lib/RemoteJob.py#L347
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/lib/RemoteJob.py#L479

Reproduction
Call `_make_script(..., resources=None)` on `CloudMachineJob`, or `_make_script(..., res=None)` on `SlurmJob` or `PBSJob`.

Expected result
Default resources should be returned and assigned before any dictionary access, or `None` should be rejected with a clear validation error.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in dpti/lib/RemoteJob.py at _set_default_resource and the _make_script methods referenced for CloudMachineJob, SlurmJob, and PBSJob. Reproduce the failure with resources=None or res=None, then verify that omitted resources no longer crash and either use defaults or produce the documented validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.