Skip to content

[Code scan] NVT TI task generation references an unset pressure #124

Description

@njzjz

Source: Codex global repository scan of deepmodeling/dpti at commit b719828.
Project: DeepModeling Agent Code Scan

Problem
The supported NVT temperature-path branch in ti.make_tasks() never assigns pres, but later passes pres=pres into _gen_lammps_input(). This makes valid ens='nvt', path='t' task generation fail with UnboundLocalError.

Code references

dpti/dpti/ti.py

Line 143 in b719828

if 'nvt' in ens :

dpti/dpti/ti.py

Line 150 in b719828

raise RuntimeError('supported path of nvt ens is \'t\'')

dpti/dpti/ti.py

Line 239 in b719828

if 'nvt' in ens and path == 't' :

dpti/dpti/ti.py

Line 248 in b719828

pres=pres,

Reproduction
Call ti.make_tasks() with minimal valid NVT/T-path settings. The branch accepts the configuration at lines 143-150, then fails when building the first task because pres was not defined.

Expected result
NVT task generation should either not pass pressure to _gen_lammps_input() or initialize a harmless/default pressure value for the generator.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions