Skip to content
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

replace atoms.coordinates() with atoms.positions #3467

Closed
2 tasks
orbeckst opened this issue Nov 23, 2021 · 14 comments
Closed
2 tasks

replace atoms.coordinates() with atoms.positions #3467

orbeckst opened this issue Nov 23, 2021 · 14 comments

Comments

@orbeckst
Copy link
Member

orbeckst commented Nov 23, 2021

Since 2.0, atoms does not have coordinates() anymore and only positions is supported.

@orbeckst
Copy link
Member Author

Output from git grep 'coordinates():

benchmarks/benchmarks/analysis/rms.py:        # ag.coordinates()
benchmarks/benchmarks/analysis/rms.py:            self.A = self.u.atoms.coordinates().copy()[:num_atoms]
benchmarks/benchmarks/analysis/rms.py:            self.B = self.u.atoms.coordinates().copy()[:num_atoms]
package/CHANGELOG:    'get_positions()' can be used instead of the 'coordinates()'
package/MDAnalysis/analysis/encore/covariance.py:        reference_coordinates = reference_atom_selection.atoms.coordinates()
package/MDAnalysis/coordinates/PDB.py:        self._check_pdb_coordinates()
testsuite/MDAnalysisTests/coordinates/test_timestep_api.py:            self.Timestep.from_coordinates()

@Atharva7K
Copy link
Contributor

Hey, I'm very new to open source and would like to try my hands on this, so any pointers for this fix would be highly appreciated. For the first fix, I just have to replace the function calls for coordinates() by get_positions()? Or there's more to it than this?

@orbeckst
Copy link
Member Author

orbeckst commented Dec 5, 2021

Hello @Atharva7K , you'd replace .coordinates() with .positions. If this is in code that wasn't tested before then we'd want to add a test exercising this code but we can give guidance on how to do this.

@Atharva7K
Copy link
Contributor

Thank you for replying @orbeckst . Apparently, rms.py has already been tested so I can directly do the replacement there. But for covariance.py, I will require guidance to add the tests as you said so please advice me on how to get started. Should I first create a PR fixing the issue in rms.py and create a separate PR for adding the tests?

pranjii added a commit to pranjii/mdanalysis that referenced this issue Dec 8, 2021
pranjii added a commit to pranjii/mdanalysis that referenced this issue Dec 10, 2021
@manishsaini6421
Copy link
Contributor

I am outreachy applicant and want to do this. I am new in opensource so can you guide me please how can i do this?
And How to start contributing?

@orbeckst
Copy link
Member Author

@manishsaini6421 , the User Guide has a section Contributing Code to the Main Codebase. In short, you need to learn how to use git and GitHub. You'd fork the MDAnalysis repository. Then you fix the code in your fork of MDAnalysis (in your own account). Then you create a pull request (PR) against the main MDAnalysis repository. Then we review your PR and discuss it with you. Once everything looks good (typically after multiple rounds of discussions and improvements) we merge your code into the main repository.

@orbeckst
Copy link
Member Author

In order to work on this issue, you need to make a PR that references this issue number. We don't have people "reserve" issues to work on, we just look at the first work that comes in.

@manishsaini6421
Copy link
Contributor

@orbeckst Thanks for detailed discription i'll do it now.

@manishsaini6421
Copy link
Contributor

@orbeckst Sir, i have fixed this issue, can you check it once please.

@orbeckst
Copy link
Member Author

@manishsaini6421 I can see that you created PR #3576. — very good. One of our core developers already reviewed your PR so your next step is to address their comments.

@manishsaini6421
Copy link
Contributor

@orbeckst I have made some changes but still 2 test cases fails , what should i do now?

@orbeckst orbeckst linked a pull request Apr 1, 2022 that will close this issue
4 tasks
@Davichet-e
Copy link

Shouldn't this issue be closed? I think it was fixed by this commit: 51661637ee1444a15eec331e8777cbc60c9c9836^^

@orbeckst
Copy link
Member Author

It was actually fixed in PR #3621 as a side-effect — we should have added it to CHANGELOG, I suppose.

@orbeckst
Copy link
Member Author

I am going to raise a separate issue for the benchmarks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment