deepmodeling / deepmodeling/dpti
[Code scan] Short Simpson HTI ranges swap statistical and integration errors
- 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
`integrate_range_simpson()` normally returns `(x, integral, integration_error, statistical_error)`, and the long-range branch follows that order. However, the `len(xx) < 5` branch returns `(x, integral, stat_err, zeros)`. `integrate_range_hti()` then reads the returned values as `i_e` and `s_e`, so short Simpson ranges can report zero statistical error and put propagated statistical error in the systematic/integration-error slot.
Code references
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/lib/utils.py#L348
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/lib/utils.py#L352
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/lib/utils.py#L371
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/lib/utils.py#L413
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/lib/utils.py#L425
Reproduction
Use three lambda points with nonzero `de_err` and call `integrate_range_hti(..., scheme='s')`. The reported statistical error should be nonzero, but the current short-range branch returns it through `sys_err` while `stt_err` becomes zero.
Expected result
The short-range branch should preserve the same return order as the long-range branch.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in dpti/lib/utils.py at integrate_range_simpson() and integrate_range_hti(), especially the len(xx) < 5 branch and the callers around the referenced lines. Reproduce the issue with three lambda points and nonzero de_err using scheme='s'. Done means the short-range branch preserves the long-range return order and reports the statistical error through stt_err rather than sys_err.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100