[Code scan] HTI systematic-error tests compare a value to itself
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
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.
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.
- Dominant language
- Python
- Stars
- 42
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from deepmodeling/dpti
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
deepmodeling/dpti#148 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
deepmodeling/dpti#147 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
deepmodeling/dpti#144 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
deepmodeling/dpti#143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deepmodeling/dpti#141 ·
All issues in deepmodeling/dpti
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100