Skip to content

Declare Bio.Aplhabet obsolete with PendingDeprecationWarning - #2050

Merged
peterjc merged 1 commit into
biopython:masterfrom
peterjc:alpha_pending_deprecation
May 6, 2019
Merged

peterjc merged 1 commit into
biopython:masterfrom
peterjc:alpha_pending_deprecation

Conversation

@peterjc

@peterjc peterjc commented May 5, 2019

Copy link
Copy Markdown
Member

This pull request addresses issue #2046

TODO: Follow up with changes to the tutorial to downplay usage of Bio.Aphabet

  • I hereby agree to dual licence this and any previous contributions under both
    the Biopython License Agreement AND the BSD 3-Clause License.

  • I have read the CONTRIBUTING.rst file and understand that AppVeyor and
    TravisCI will be used to confirm the Biopython unit tests and flake8 style
    checks pass with these changes.

  • I have added my name to the alphabetical contributors listings in the files
    NEWS.rst and CONTRIB.rst as part of this pull request, am listed
    already, or do not wish to be listed. (This acknowledgement is optional.)

TODO: Follow up with changes to the tutorial to downplay
usage of Bio.Aphabet
@codecov

codecov Bot commented May 5, 2019

Copy link
Copy Markdown

Codecov Report

Merging #2050 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2050      +/-   ##
==========================================
+ Coverage   84.92%   84.92%   +<.01%     
==========================================
  Files         315      315              
  Lines       50545    50547       +2     
==========================================
+ Hits        42924    42926       +2     
  Misses       7621     7621
Impacted Files Coverage Δ
Bio/Alphabet/__init__.py 87.69% <100%> (+0.12%) ⬆️

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 feb97e2...8c2b664. Read the comment docs.

@peterjc
peterjc merged commit 4d21227 into biopython:master May 6, 2019
@peterjc
peterjc deleted the alpha_pending_deprecation branch May 6, 2019 12:36
@bede

bede commented Aug 20, 2019 •

Copy link
Copy Markdown

Should the following code be triggering this warning?

def consensus_seqrecord(consensus, ref_id):
    return SeqRecord(Seq(consensus), id=ref_id + '_cns')

I am not, after all, using Bio.Alphabet explicitly.

@peterjc

peterjc commented Aug 20, 2019

Copy link
Copy Markdown
Member Author

Lots of Biopython indirectly imports Bio.Alphabet, so would trigger the PendingDeprecationWarning - including your example - however that class of warning is silent by default. Something in your code is likely changing the default warning filters?

A next step for us would be to add some (non-silent by default) BiopythonDeprecationWarning cases, but this is going to be tricky to avoid code like your example triggering it. My current thinking is specific alphabet methods or attributes (like .letters or .gap_char) could start triggering warnings.

@bede

bede commented Aug 20, 2019

Copy link
Copy Markdown

Thanks Peter. It'll be Pytest that's changing the warning filters. Hardly a major issue – I just wanted to check I wasn't doing something deprecated.

@peterjc

peterjc commented Aug 20, 2019

Copy link
Copy Markdown
Member Author

No, your example is the kind of thing which should not need any changes (if we do the deprecation and removal/replacement right). Thanks for checking!

@zoldello

Copy link
Copy Markdown

@peterjc What is the alternative to Bio.Alphabet? I see it used on the biopython tutorial page. Do you know a more current tutorial?

@peterjc

peterjc commented May 31, 2020

Copy link
Copy Markdown
Member Author

Now that Biopython 1.77 is out, we are working on this now. The scale of the job may make some small breaks in backward compatibility almost unavoidable - but hopefully only in rarely used corner cases.

@zoldello

Copy link
Copy Markdown

@peterjc Thanks. Normally, code is deprecated after an alternative is released and not before. I assumed Biopython followed that unwritten rule. Thanks for explaining to me the plan.

@mdehoon

mdehoon commented Jun 1, 2020

Copy link
Copy Markdown
Contributor

Down with DeprecationWarning!

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.

4 participants