-
Notifications
You must be signed in to change notification settings - Fork 764
Fixes #3743: Modernize test assertions in test_base.py #4951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #3743: Modernize test assertions in test_base.py #4951
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello there first time contributor! Welcome to the MDAnalysis community! We ask that all contributors abide by our Code of Conduct and that first time contributors introduce themselves on GitHub Discussions so we can get to know you. You can learn more about participating here. Please also add yourself to package/AUTHORS as part of this PR.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4951 +/- ##
========================================
Coverage 93.61% 93.61%
========================================
Files 177 177
Lines 21894 21894
Branches 3095 3095
========================================
Hits 20495 20495
Misses 946 946
Partials 453 453 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tylerjereddy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm misreading something, but I don't understand the direct connection between the changes here and the referenced ticket, gh-3743, which focuses on modernizing old test constructs like assert_almost_equal().
It is true that most (though not all) of the tolerance changes here are in the "right" direction (stricter instead of looser), but that seems like a separate matter from the issue above.
Hi @tylerjereddy, thank you for the review! I reviewed Best regards, |
RMeli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I'm not a big fan of changing the tolerances, especially towards looser values. Could you please explain why this was necessary?
Using tighter tolerances might be good, but it is also possible that people with slightly different configurations will see more test failures. CI seems happy with them, but if they are strict enough, maybe it's better not to make them even stricter.
@RMeli, Regarding the changes in I completely agree that loosening the tolerances can reduce the precision of the tests, and I apologize for this oversight. To fix this, I’ll revert the tolerances back to their original values ( For the stricter tolerances in other tests (like On the I’ll push the changes to revert the looser tolerances shortly. Looking forward to your feedback on this approach! |
@RMeli, |
|
Thanks @Abdulrahman-PROG. As mentioned, I have some reservations on making the tests stricter. @MDAnalysis/coredevs, any opinions? |
|
For consistency, I'd try to keep it as close to the original as possible. |
|
@RMeli @orbeckst @tylerjereddy |
|
@RMeli could you please look after this PR and clarify any change requests if necessary? Thanks. |
|
I thought the previous discussion meant that we should revert all the changes on tolerances that are not related to #3743. These changes have not been reverted yet. @Abdulrahman-PROG can you please only make the changes that would address #3743? Thanks. |
Hi @RMeli, Thank you for your feedback! I’ve addressed your request by removing all changes to The CI checks have completed, and all tests are passing (except for a minor 0.02% drop in Codecov coverage, which I believe is negligible—please let me know if this needs to be addressed further). I’ve also updated the PR description to reflect the current changes. Could you please review the updated PR and provide your final approval for merging? I’m happy to make any additional adjustments if needed! Looking forward to your feedback! |
|
@RMeli could you have a quick look again? It's only 2 line changes. |
orbeckst
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Abdulrahman-PROG can you please resolve the conflicts on this PR? Your name should simply show up at the bottom of AUTHORS.
Also add your GitHub handle to the contributors in CHANGELOG for 2.10.0. You don't need an explicit entry as this is not a user-facing change but we want to acknowledge any contributions.
4f5ad3d to
90e3a19
Compare
RMeli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RMeli could you have a quick look again? It's only 2 line changes.
Unfortunately it looks like this is no longer the case. I see a lot of changes not related with this PR. All the unrelated changes need to be reverted @Abdulrahman-PROG.
fc67e3e to
3c2240b
Compare
|
Thank you for your feedback! I’ve addressed the concerns raised:
All CI checks are passing (except for the |
RMeli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Abdulrahman-PROG, much better now! But you should really add yourself to AUTHORS and CHANGELOG as part of this PR. Once it is done, I can approve and we can finally merge.
Hi @RMeli
I couldn’t find the "Re-run" button, possibly because some tests are still in progress. However, these failures seem unrelated to my changes, as the tests passed before adding my name to Can we proceed with the merge despite these known issues, or should I wait for the tests to finish and try re-running them again? I’m happy to assist further if needed! |
|
@Abdulrahman-PROG I restarted the failed jobs, let's see how it goes. |
Hi @RMeli I believe the PR is now ready to be merged. Could you please provide your final approval? I’m happy to make any additional adjustments if needed! |
|
@RMeli |
orbeckst
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the contribution.
@RMeli — I think the PR will auto-close the linked issue but I don't think that this should happen as there are probably more instances of assert_almost_equal left over. We have to remember to manually reopen the issue.
|
Good point @orbeckst, thanks for rising it! Thanks @Abdulrahman-PROG for your contribution. |
Fixes #3743
Changes made in this Pull Request:
test_base.pyby replacingassert_almost_equalwithassert_allcloseto align with the goal of modernize testing code #3743.test_base.pyto ensure compliance with the project's linting standards.test_align.py(e.g., adjusting tolerances), but these were removed to focus the PR on modernize testing code #3743, as requested by @RMeli.package/AUTHORSas part of this PR.PR Checklist
test_base.py)Developers Certificate of Origin
I certify that I can submit this code contribution as described in the Developer Certificate of Origin, under the MDAnalysis LICENSE.