-
Notifications
You must be signed in to change notification settings - Fork 664
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
Fix for issue #4655 Removing mutable data structures and function calls as default arguments in the entire codebase #4810
Conversation
…s as default arguments in the entire codebase
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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4810 +/- ##
===========================================
- Coverage 93.68% 93.62% -0.07%
===========================================
Files 177 189 +12
Lines 21743 22833 +1090
Branches 3055 3067 +12
===========================================
+ Hits 20370 21377 +1007
- Misses 927 1003 +76
- Partials 446 453 +7 ☔ View full report in Codecov by Sentry. |
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.
Can you please detail how the error raised in #4810 (comment) is related to the changes?
@@ -387,11 +388,13 @@ class HELANAL(AnalysisBase): | |||
'local_screw_angles': (-2,), | |||
} | |||
|
|||
def __init__(self, universe, select='name CA', ref_axis=[0, 0, 1], | |||
def __init__(self, universe, select='name CA', ref_axis=None, |
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.
What about using a tuple instead of a list?
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.
Sure I can do that
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.
I meant using it as an argument (instead of adding the logic with None
). Because tuples are immutable (while lists are mutable).
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.
I meant using it as an argument (instead of adding the logic with
None
). Because tuples are immutable (while lists are mutable).
Oh that makes sense
I am not sure why the error got resolved, but after making the changes it got solved. According to the file test_encore from which the error was generated from, the function can result in failure sometimes because the function involves generating random numbers. |
shortened the fixes in the changelog
using tuples instead of list for ref_axis
I have added the changes that you have mentioned @RMeli |
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.
I'm "ok" with the diff modulo one or two outstanding comments from Rocco.
Any chance folks would be on board to "enforce" this in CI with ruff check package --select B006,B008
? ruff
is pretty fast and widely adopted now, and that would only check for these two rules and nothing else. Eventually using a ruff.toml
might make sense, but maybe one step at a time...
The CI fails are all unrelated--the usual |
+1 for adding |
@tanishy7777 Why did you close this PR? Besides #4810 (comment) I think it was in a pretty good shape. |
@RMeli I am really sorry I was trying to creating a new fork, and deleted the old one. I think that may have closed the PR |
No worries @tanishy7777, that happens. Are you going to re-open the PR from the new fork? I think it was almost ready to be merged, so it would be good to have. But if you don't want to work on it anymore, no worries at all. |
Thanks for understanding. I will open the new PR from the new fork. I plan to just make all the changes locally on my pc again and then push that in the PR. I don't think there is a better way right? Since I deleted the old repo? @RMeli |
Also just to clarify the reason u merged git checkout -b <new-branch-name> instead of git checkout -b <new-branch-name> develop Which also explains why the codecov percentage was so different? Is that right? |
@tanishy7777 I merged develop in this PR because #4640 fixed some issues with the tests, and therefore was needed to fix the tests running for this PR. With
Unfortunately, I don't think so. If you can't be bothered no worries, I can fix these issues myself if we decide to go ahead with #4825. Up to you if you want to spend more time on this. |
Oh ok got it!
|
Fixes #4655
Changes made in this Pull Request:
PR Checklist
Developers certificate of origin
📚 Documentation preview 📚: https://mdanalysis--4810.org.readthedocs.build/en/4810/