Skip to content

Update Residue.py - #1227

Merged
peterjc merged 7 commits into
biopython:masterfrom
rodogi:patch-1
May 15, 2017
Merged

peterjc merged 7 commits into
biopython:masterfrom
rodogi:patch-1

Conversation

@rodogi

@rodogi rodogi commented May 11, 2017

Copy link
Copy Markdown
Contributor

get_atoms method seems more in touch with the methods used for chain, model and structure.

get_atoms method seems more in touch with the methods used for chain, model and structure.
@peterjc

peterjc commented May 11, 2017 •

Copy link
Copy Markdown
Member

You can't just remove an old API like that, it would break any script using the old function name. We'd have to have both in parallel for a while and deprecate the old name.

However, there was talk of deprecating all the PDB module's get_* methods in preference to using Python properties (e.g. .atoms instead of .get_atoms() and so on).

@JoaoRodrigues

JoaoRodrigues commented May 12, 2017 via email

Copy link
Copy Markdown
Member

@peterjc

peterjc commented May 12, 2017

Copy link
Copy Markdown
Member

So we're agreed :) - rename it but keep a backward compatible alias with a deprecation warning when used. See also http://biopython.org/wiki/Deprecation_policy

@codecov

codecov Bot commented May 12, 2017

Copy link
Copy Markdown

Codecov Report

Merging #1227 into master will increase coverage by 0.35%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1227      +/-   ##
==========================================
+ Coverage   79.56%   79.92%   +0.35%     
==========================================
  Files         323      303      -20     
  Lines       51675    46156    -5519     
==========================================
- Hits        41116    36888    -4228     
+ Misses      10559     9268    -1291
Impacted Files Coverage Δ
Bio/PDB/Residue.py 66.66% <100%> (-2.23%) ⬇️
Bio/Phylo/CDAOIO.py 5% <0%> (-80.46%) ⬇️
Bio/PDB/mmtf/__init__.py 29.41% <0%> (-58.83%) ⬇️
Bio/Graphics/__init__.py 25% <0%> (-58.34%) ⬇️
Bio/Phylo/CDAO.py 42.85% <0%> (-57.15%) ⬇️
Bio/Phylo/_utils.py 22.36% <0%> (-44.73%) ⬇️
Bio/codonalign/codonseq.py 44.01% <0%> (-43.75%) ⬇️
Bio/DocSQL.py 7.58% <0%> (-31.04%) ⬇️
Bio/_py3k/__init__.py 32% <0%> (-30%) ⬇️
BioSQL/DBUtils.py 56.16% <0%> (-23.29%) ⬇️
... and 54 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f5126f2...c9094ff. Read the comment docs.

@codecov

codecov Bot commented May 12, 2017 •

Copy link
Copy Markdown

Codecov Report

Merging #1227 into master will decrease coverage by <.01%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1227      +/-   ##
==========================================
- Coverage   79.56%   79.56%   -0.01%     
==========================================
  Files         323      323              
  Lines       51675    51681       +6     
==========================================
+ Hits        41116    41119       +3     
- Misses      10559    10562       +3
Impacted Files Coverage Δ
Bio/PDB/Residue.py 67.7% <83.33%> (-1.19%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f5126f2...19e9e4f. Read the comment docs.

@rodogi

rodogi commented May 12, 2017

Copy link
Copy Markdown
Contributor Author

I added the new method get_atoms while keeping the old one get_atom with a deprecation warning.

@JoaoRodrigues

Copy link
Copy Markdown
Member

Looks good to me. Thanks @rodogi for spotting & fixing this.

@peterjc

peterjc commented May 12, 2017

Copy link
Copy Markdown
Member

The change looks great 👍

Are you happy to dual licence your contributions under both the Biopython License Agreement AND the BSD 3-Clause License? See #898.

Also, are you happy to be thanked by name in the NEWS.rst and CONTRIB.rst files?

Does this currently get triggered by any of the unit tests?

@rodogi

rodogi commented May 15, 2017

Copy link
Copy Markdown
Contributor Author

Thank you guys for your terrific work in biopython.

Does this currently get triggered by any of the unit tests?

I don't really know, I'm still a noob to github.

@peterjc

peterjc commented May 15, 2017

Copy link
Copy Markdown
Member

It looks like the old name does get used in test_mmtf.py (only):

$ grep "\.get_atom(" *.py
test_mmtf.py:            self.mmcif_atoms = [x for x in mmcif_r.get_atom()]
test_mmtf.py:            self.mmtf_atoms = [x for x in mmtf_r.get_atom()]

This is confirmed in the test suite output on TravisCI where the new deprecation warning appears:

...
test_mmtf ... /home/travis/build/biopython/biopython/build/lib.linux-x86_64-2.7/Bio/PDB/Residue.py:120: BiopythonDeprecationWarning: `get_atom` has been depcreated and we intend to remove it in a future release of Biopython. Please use `get_atoms` instead.
  BiopythonDeprecationWarning)
ok
...

So, could you also update test_mmtf.py to use the new .get_atoms() version please. With that I'd be happy to merge this pull request.

Separately this shows the old method was not being deliberately tested in test_PDB.py, and it (or rather the new version) ought to be. If you'd like to tackle that as well @rodogi that would be most welcome.

Comment thread Bio/PDB/Residue.py Outdated
yield a

def get_atom(self):
warnings.warn("`get_atom` has been depcreated and we intend to remove it"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: depcreated --> deprecated

@peterjc

peterjc commented May 15, 2017

Copy link
Copy Markdown
Member

@rodogi How would you like to be named in the NEWS.rst and CONTRIB.rst files? I'm asking as you don't make this obvious on your GitHub profile, perhaps deliberately. Should you wish to remain semi-anonymous, just rodogi is fine (there is recent precedent).

You can add yourself to these files as part of the pull request if you like - note the names are sorted alphabetically and for CONTRIB.rst this is checked automatically as described in the header.

@rodogi

rodogi commented May 15, 2017

Copy link
Copy Markdown
Contributor Author

@peterjc, I'll be glad to update test_PDB.py soon with the new method. I added my real name to CONTRIB.rst and NEWS.rst files. Thanks a lot for your help.

@peterjc
peterjc merged commit c940ac9 into biopython:master May 15, 2017
@peterjc

peterjc commented May 15, 2017

Copy link
Copy Markdown
Member

Thank you 👍

@rodogi
rodogi deleted the patch-1 branch May 15, 2017 16:58
@peterjc

peterjc commented May 16, 2017

Copy link
Copy Markdown
Member

@rodogi Are you happy to dual licence your contributions under both the Biopython License Agreement AND the BSD 3-Clause License? See #898.

@rodogi

rodogi commented May 16, 2017

Copy link
Copy Markdown
Contributor Author

@peterjc Yes I agree to dual licence my contributions under both the Biopython License Agreement AND the BSD 3-Clause License.

@peterjc

peterjc commented May 16, 2017

Copy link
Copy Markdown
Member

@rodogi Thank you 👍

MarkusPiotrowski pushed a commit to MarkusPiotrowski/biopython that referenced this pull request Oct 31, 2017
peterjc added a commit to peterjc/biopython that referenced this pull request Aug 14, 2019
Original author Thomas Hamelryck and all the contributors since as tracked
with version control have agreed:

 - Adhemar Zerlotini (@azneto)
   biopython#1412 (comment)
 - Fábio Madeira (@biomadeira)
   biopython#898 (comment)
 - Brian Osborne (@bosborne)
   biopython#898 (comment)
 - Christian Brueffer (@cbrueffer)
   biopython#898 (comment)
 - Eric Talevich (@etal)
   biopython#898 (comment)
 - Francesco Gastaldello (@Gasta88)
   biopython#1063
 - João Rodrigues (@JoaoRodrigues)
   biopython#898 (comment)
 - Joe Greener (@jgreener64)
   biopython#1393
 - Joerg Schaarschmidt (@schaarj)
   biopython#1567
 - @morrme
   biopython#1172 (comment)
 - Nick Negretti (@nimne)
   biopython#1768 (comment)
 - Peter Cock (@peterjc)
   biopython#898 (comment)
 - Rodrigo Dorantes-Gilardi (@rodogi)
   biopython#1227 (comment)
 - Sergio Valqui (@svalqui)
   biopython#1749
 - Thomas Hamelryck (CVS username nisse)
   https://mailman.open-bio.org/pipermail/biopython/2018-September/016546.html
peterjc added a commit that referenced this pull request Aug 29, 2019
Original author Thomas Hamelryck and all the contributors since as tracked
with version control have agreed:

 - Adhemar Zerlotini (@azneto)
   #1412 (comment)
 - Fábio Madeira (@biomadeira)
   #898 (comment)
 - Brian Osborne (@bosborne)
   #898 (comment)
 - Christian Brueffer (@cbrueffer)
   #898 (comment)
 - Eric Talevich (@etal)
   #898 (comment)
 - Francesco Gastaldello (@Gasta88)
   #1063
 - João Rodrigues (@JoaoRodrigues)
   #898 (comment)
 - Joe Greener (@jgreener64)
   #1393
 - Joerg Schaarschmidt (@schaarj)
   #1567
 - @morrme
   #1172 (comment)
 - Nick Negretti (@nimne)
   #1768 (comment)
 - Peter Cock (@peterjc)
   #898 (comment)
 - Rodrigo Dorantes-Gilardi (@rodogi)
   #1227 (comment)
 - Sergio Valqui (@svalqui)
   #1749
 - Thomas Hamelryck (CVS username nisse)
   https://mailman.open-bio.org/pipermail/biopython/2018-September/016546.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants