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

Doc for keyword *bonds* of PDBWriter is wrong #1246

Closed
jbarnoud opened this issue Mar 19, 2017 · 3 comments · Fixed by #1329
Closed

Doc for keyword *bonds* of PDBWriter is wrong #1246

jbarnoud opened this issue Mar 19, 2017 · 3 comments · Fixed by #1329

Comments

@jbarnoud
Copy link
Contributor

The documentation of PDBWriter.__init__ tells:

*bonds*
           write bonds to the PDB file as CONECT_ records [``False``]

This is in contradiction with the signature of the signature that tells that the default value for the argument is "conect". It is also in contradiction with the code of PDBWriter._write_pdb_bonds:

        # Write out only the bonds that were defined in CONECT records
        if self.bonds == "conect":
            bonds = ((bond[0].index, bond[1].index) for bond in bondset if not bond.is_guessed)
        elif self.bonds == "all":
            bonds = ((bond[0].index, bond[1].index) for bond in bondset)
        else:
            raise ValueError("bonds has to be either None, 'conect' or 'all'")
@orbeckst
Copy link
Member

So basically just change the docs (while changing to numpy style):

bonds : {"conect", "all", None} (optional)
     If set to "conect", then write those bonds to the output file that were already defined in an input PDB file as PDB CONECT_ records. If set to "all", write all bonds (including guessed ones) to the file. ``None`` does not write any bonds. The default is "conect". 

Have we got a test case?

@orbeckst orbeckst mentioned this issue Mar 31, 2017
4 tasks
@Shtkddud123
Copy link
Contributor

Shtkddud123 commented Apr 2, 2017

Dear all,

Hopefully I've done things as requested, and I apologise again for my rookie-ness. I've updated the doc in a numpy style, and written it here:

https://github.com/Shtkddud123/mdanalysis/blob/develop/package/MDAnalysis/coordinates/PDB.py

Please let me know if this is satisfactory. I'm still committed to the curvature studies, whether part of GSOC or not; I'll try to get a preliminary code on it working out a simple x-y plane meshgrid style hopefully sometime next week.

Thanks

Yours Sincerely

Sang

@jbarnoud
Copy link
Contributor Author

jbarnoud commented Apr 2, 2017

Rookie-ness is normal when you begin. Don't worry about that, you will learn.

I've seen that you updated the documentation for the PDB writer in the pull request about the distance calculation. Since these are two unrelated issues, they should be tackled in two different pull request. Could you create a new branch for your change in the PDB documentation, and submit a new pull request on that issue?

@orbeckst orbeckst modified the milestone: 0.16.x Apr 17, 2017
orbeckst pushed a commit that referenced this issue May 1, 2017
- fixes #1246
- supercedes and closes PR #1279 by @Shtkddud123
- added @Shtkddud123 to AUTHORS
- updated CHANGELOG
orbeckst pushed a commit that referenced this issue May 1, 2017
- fixes #1246
- supercedes and closes PR #1279 by @Shtkddud123
- added @Shtkddud123 to AUTHORS
- updated CHANGELOG
kain88-de pushed a commit that referenced this issue May 2, 2017
- fixes #1246
- supercedes and closes PR #1279 by @Shtkddud123
- added @Shtkddud123 to AUTHORS
- updated CHANGELOG
kain88-de pushed a commit that referenced this issue May 2, 2017
- fixes #1246
- supercedes and closes PR #1279 by @Shtkddud123
- added @Shtkddud123 to AUTHORS
- updated CHANGELOG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants