deepmodeling / deepmodeling/dpti
[Code scan] HTI systematic-error tests compare a value to itself
- 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
The HTI integration tests intend to assert the expected systematic error, but they store the expected value in `sys_err2`, overwrite `sys_err2` with the function return value, and then assert `sys_err2` against itself. This masks regressions in the third return value from `integrate_range_hti()`.
Code references
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/tests/test_lib_utils.py#L75
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/tests/test_lib_utils.py#L80
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/tests/test_lib_utils.py#L83
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/tests/test_lib_utils.py#L88
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/tests/test_lib_utils.py#L93
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/tests/test_lib_utils.py#L96
Reproduction
Change `integrate_range_hti()` to return an obviously wrong `sys_err`; these assertions can still pass because the expected value has been overwritten.
Expected result
Use distinct variable names, for example `sys_err1` for the expected value and `sys_err2` for the actual value, then assert them against each other.
Contributor guide
No contributing guide indexed for this repository
Research direction
Open tests/test_lib_utils.py at the HTI integration-test assertions around lines 75-96 and inspect the calls to integrate_range_hti(). Keep the expected and actual systematic-error values in distinct variables, then assert them against each other. Done means an obviously incorrect returned sys_err causes the test to fail.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100