-
Notifications
You must be signed in to change notification settings - Fork 659
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
modernize HBA to use AG as objects internally instead of selection strings #3933
Comments
Can we offer this issue to GSOC applicants? Opinion @hmacdope ? |
Why not, would be a good fix. |
Context: came up with #3848 (comment) |
Hi so i read the HydrogenBondAnalysis code and find this piece of code using selection string import MDAnalysis To convert the selected string into AtomGroup Object,we can change this code like this So here i use select_atoms() function to convert selection string to atom group object. So i m going to give pull request by converting selection string to atomgroup object in hbond_analysis.py,So if i am approaching correct. please merge my pull request so i have contribution for GSOC |
Here I convert hbond code from selection strings to atom group object issue MDAnalysis#3933.If you think my approach is correct then please let me know.I will update this full code.Please merge this pull request so i can have pull request for my gsoc
@utkarsh147-del the Additionally, you are suggesting to change code in the docstring. However, this issue concerns the changes to the code (not the documentation, which will nonetheless need to reflect the changes in the code) needed to use atom groups internally instead of selection strings. The fact that you identified In addition to the first steps described above, please familiarise yourself with the Finally, please use Code and Syntax Highlighting when writing code on GitHub, which makes it far more readable. Do not hesitate to ask questions and clarifications, before jumping into opening a PR. |
Hi,I understand what you want to convey to me except one thing what do you mean by docstring here,I try to make changes in code which the hbond.py link given>Do we need to make this change in that file or some another python fie.Please clarify me this |
@utkarsh147-del by docstring I mean the Python docstring of the
I hope this clarifies things. |
@SophiaRuan I don't see a linked PR so if you submit a PR that references this issue, we'll review it. |
No, for right now, input selection strings are ok. If you follow #3848 (comment) then you see it's about internal use of selection strings.
I don't see a linked PR. When you create a PR, make sure that you include issue number #3933 in the |
For my solution I made the HydrogenBondAnalysis class also accept a list of atom indices and positions as an alternative to selecting atoms via string. I don't know if this solves the issue |
If you have a pull request with code up then make sure that the first line of your comment reads
i.e., fill in the template that is shown to you when you create the PR. This will link your PR to this issue. And unless we see this link, we will probably not see or review a PR. |
That's not required and in fact changes the user interface. We do not change the user interface lightly because it can create incompatibilities. It's better to focus a PR on the smallest amount of changes necessary to solve the issue. If you feel that the UI should be changed, raise a specific issue for that case and then it can be discussed and addressed separately. In order to keep work (and reviewing) manageable, we very much try to keep PRs as small and as self-contained as possible. |
Thank you for reaching back. The new changes I've made, if there isn't a specific select string, the methods should use |
@yickysan , if you show your code in a PR we can comment on it; discussions with code present are more productive |
I would like to work on this issue for my GSoC application @hmacdope @orbeckst. I am thankfully familiar with both selections strings and AtomGroups from being an MDAnalysis user. I will start tackling the internal use of selection strings and converting them over to AtomGroups. I'll update this issue thread with any questions I have as they rise up. |
I am going to jot down my rough plan here before I get started on digging around in the code, to make sure I have an appropriate plan. If I disregard
Please let me know if I am missing anything crucial, otherwise I will get started tomorrow 😊 |
I would also have a question regarding this issue. Since as @lunamorrow the main cases where string selection is used are As far as i understood you would want to retain the user input, so that he could string selection as an input for HBA and don't change the input of the user to AtomGroups, which means
which would deliver you It should be possible to put a condition that would recognize such cases and split up then the input of the user into parts and them treat them separately i think. |
Yep makes sense to me.
The stored selection strings will be replaced with stored atom groups, but the user should still be able to set them IMO (to an atom group)
Should be able to check the indices on two atom groups, but lets see how we go.
You will need to do 2x PRs, 1 to deprecate current API, adding a deprecation warning, and the other to update the functionality. The update to AGs will then need to be held until the next major release cycle. This all still counts for GSOC etc even if PR not merged. |
Correct
Yes, either we will need to insist on all |
@hmacdope Thanks for the reply. I was tinkering with the |
@talagayev, I appreciate that GSOC starter issues are in short supply, however given that the work you propose is within the scope of that already proposed by @lunamorrow, I would say they have first chance at making the changes (unless you two can come to an agreement, but I would advise against this as two split PRs will be more compilicated). |
@hmacdope i agree, since the code would be in the same direction as proposed by @lunamorrow and splitting up the PRs could be tricky, it would be only fair that she works on this issue, while i would focus on the issues that you suggested. I would probably start with #3811. |
I've just finished a big day of uni, so I'll get started on these changes tomorrow now that @talagayev and I have a project each. I will make sure my PR addresses both my previous suggestions and the ones made by Valerij. To clarify/confirm, am I good to change selections across to AtomGroups (as the selection string API will be depreciated)? Therefore, we need to make sure the API reflects users being able to update selections by essentially adding a new AtomGroup (rather than passing a selection string) and combining them with no duplications. Yes? Thanks for the clarification and direction @hmacdope
Ok this makes sense, as from my usage of MDAnalysis thus far it's quite easy and user-friendly to grab and manipulate stored variables.
Oh yes true! I'll give that a go to really eliminate usage of selection strings :)
I may need some help with the fiddly aspects of this, as I am very much figuring out how to do things, like making PRs, as I go. Are there any resources that you can point me towards, so that I can ensure I do this correctly from the get go? |
@lunamorrow we the Basically,
|
@hmacdope Great, I have setup a fork on my GitHub repository already and created a new branch for the changes. I will work on the actual code change PR first and then push that, before I start on the PR for the API updates. I expect I will need some guidance with the API PR to ensure I match the format used by MDAnalysis for API depreciation warnings, but I will reach out when I get to this stage. Just checking, will I need to make a PR with extra test cases in MDAnalysisTests? I expect we may need more for user interactions with Some more questions as I go: Is there a reason that |
Is your feature request related to a problem?
modernize HBA (HydrogenBondAnalysis) to use AG (AtomGroups) as objects internally instead of selection strings to avoid the need for HBA analysis to discern the relevant atoms.
Describe the solution you'd like
AG as objects internally instead of selection strings
Additional context
See PR Hbond update #3848 (in particular #3848 (comment))
Guidance for new contributors
This is a reasonably complicated issue to solve for a beginner. We recommend you first learn about the problem. Ask questions here. The more specific your question, then better we can help.
As the first steps you should:
EDITS
The text was updated successfully, but these errors were encountered: