Fix #3743: Modernize deprecated test assertions in hydrogen bond tests#5400
Fix #3743: Modernize deprecated test assertions in hydrogen bond tests#5400ShivansGupta25 wants to merge 2 commits into
Conversation
|
@ShivansGupta25 Thanks for opening this PR. However, before we can review we ask you put back and answer the AI declaration which was the in the PR template. |
IAlibay
left a comment
There was a problem hiding this comment.
Blocking until relevant declarations are added back into the PR description.
I've restored and completed the AI declaration section. All changes were reviewed and tested locally. Thanks for pointing it out sir. |
814a445 to
cec6637
Compare
|
|
||
| counts = h.count_by_time() | ||
| assert_array_almost_equal(h.times, ref_times) | ||
| assert_allclose(h.times, ref_times) |
There was a problem hiding this comment.
assert_allclose without args is actually stricter than the old assert_array_almost_equal. In a similar PR (#5156), the fix was to add atol=1e-6, rtol=0 to match the old tolerance. Might be worth doing the same here
| assert_allclose(h.times, ref_times) | |
| assert_allclose(h.times, ref_times, atol=1e-6, rtol=0) |
Summary
Modernize test assertions in
test_hydrogenbonds_analysis.pyby replacing deprecated NumPy testing helpers with current testing practices.Changes
assert_almost_equalimport.assert_almost_equalassertions with more appropriate modern alternatives.numpy.testing.assert_allclosewhere applicable.Testing
Result:
AI Declaration
AI was used for:
All suggested changes were manually reviewed, verified, and tested by me before submission.