deepmodeling / deepmodeling/dpti
[Code scan] hti_ice Helmholtz compute writes undefined result variables
- 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
`hti_ice.exec_args()` defaults `--type` to `helmholtz` and prints the Helmholtz result, but `pv`, `pv_err`, `e1`, and `e1_err` are only assigned inside the Gibbs branch. The function then unconditionally stores these variables in `info`, so the default compute path will raise `UnboundLocalError` after the current import issue is fixed.
Code references
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/hti_ice.py#L30
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/hti_ice.py#L128
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/hti_ice.py#L131
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/hti_ice.py#L147
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/hti_ice.py#L152
Reproduction
After fixing the `dpti.hti` import issue, run:
```bash
python -m dpti.hti_ice compute JOB
```
Expected result
The default Helmholtz path should set result fields consistently, probably with `pv` and `pv_err` as `None` and `e1/e1_err` based on the Helmholtz free energy, before writing `result.json`.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in dpti/hti_ice.py at exec_args() and the result assembly around lines 128-152; first resolve the noted dpti.hti import issue, then run `python -m dpti.hti_ice compute JOB`. Confirm the default Helmholtz path completes without UnboundLocalError and writes result.json with consistent result fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- hpc
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100