Skip to content

Commit

Permalink
Ensure Biopython deprecation warnings are emitted
Browse files Browse the repository at this point in the history
These are useful but suppressed by BCBio.GFF as of version 0.7.0. See
issue linked in changes.
  • Loading branch information
victorlin committed Dec 26, 2023
1 parent ad4ed1b commit 05bff35
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions augur/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,13 @@ def _read_gff(reference, feature_names):
# one may expect, but since we raise AugurError if there are multiple
# this doesn't matter.
gff_entries = list(GFF.parse(in_handle, limit_info={'gff_type': valid_types}))

# TODO: Remove warning filter reversal after it's addressed upstream:
# <https://github.com/chapmanb/bcbb/issues/140>
import warnings
from Bio import BiopythonDeprecationWarning
warnings.simplefilter("default", BiopythonDeprecationWarning)

if len(gff_entries) == 0:
raise AugurError(f"Reference {reference!r} contains no valid data rows. Valid GFF types (3rd column) are {', '.join(valid_types)}.")
elif len(gff_entries) > 1:
Expand Down

0 comments on commit 05bff35

Please sign in to comment.