You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The BGZF problem might be ARM specific - I've not run Biopython on an Raspberry Pi recently, but that might be the easiest way for me to reproduce this.
test_AlignIO ... ERROR
======================================================================
ERROR: test_AlignIO
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/python-biopython-1.71/python3/build/lib.linux-x86_64-3.7/Bio/AlignIO/NexusIO.py", line 42, in NexusIterator
n = Nexus.Nexus(handle)
File "/builddir/build/BUILD/python-biopython-1.71/python3/build/lib.linux-x86_64-3.7/Bio/Nexus/Nexus.py", line 623, in __init__
self.read(input)
File "/builddir/build/BUILD/python-biopython-1.71/python3/build/lib.linux-x86_64-3.7/Bio/Nexus/Nexus.py", line 657, in read
commandlines = _get_command_lines(file_contents)
File "/builddir/build/BUILD/python-biopython-1.71/python3/build/lib.linux-x86_64-3.7/Bio/Nexus/Nexus.py", line 1898, in _get_command_lines
lines = _kill_comments_and_break_lines(file_contents)
File "/builddir/build/BUILD/python-biopython-1.71/python3/build/lib.linux-x86_64-3.7/Bio/Nexus/Nexus.py", line 454, in _kill_comments_and_break_lines
t2 = next(contents)
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "run_tests.py", line 451, in runTest
suite = loader.loadTestsFromName(name)
File "/usr/lib64/python3.7/unittest/loader.py", line 154, in loadTestsFromName
module = __import__(module_name)
File "/builddir/build/BUILD/python-biopython-1.71/python3/Tests/test_AlignIO.py", line 237, in <module>
alignments = list(AlignIO.parse(handle, t_format))
File "/builddir/build/BUILD/python-biopython-1.71/python3/build/lib.linux-x86_64-3.7/Bio/AlignIO/__init__.py", line 376, in parse
for a in i:
RuntimeError: generator raised StopIteration
----------------------------------------------------------------------
Ran 1 test in 0.294 seconds
is from this code snippet where I just updated the comment in d59d74a
# TODO: As of Python 3.3, can write "yield from i" instead. See PEP380.# For loop imposes some overhead... wait until we drop Python 2.7 to fix it.foraini:
yielda
In this case, the StopIteration is from within the comment parsing with Bio/Nexus/Nexus.py - which is currently puzzling me.
I can reproduce the reported (non-ARM) failures under macOS with Python 3.7.0rc1,
======================================================================
ERROR: test_AlignIO
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/pc40583/repositories/biopython/build/lib.macosx-10.9-x86_64-3.7/Bio/AlignIO/NexusIO.py", line 42, in NexusIterator
n = Nexus.Nexus(handle)
File "/Users/pc40583/repositories/biopython/build/lib.macosx-10.9-x86_64-3.7/Bio/Nexus/Nexus.py", line 623, in __init__
self.read(input)
File "/Users/pc40583/repositories/biopython/build/lib.macosx-10.9-x86_64-3.7/Bio/Nexus/Nexus.py", line 657, in read
commandlines = _get_command_lines(file_contents)
File "/Users/pc40583/repositories/biopython/build/lib.macosx-10.9-x86_64-3.7/Bio/Nexus/Nexus.py", line 1898, in _get_command_lines
lines = _kill_comments_and_break_lines(file_contents)
File "/Users/pc40583/repositories/biopython/build/lib.macosx-10.9-x86_64-3.7/Bio/Nexus/Nexus.py", line 454, in _kill_comments_and_break_lines
t2 = next(contents)
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "run_tests.py", line 458, in runTest
suite = loader.loadTestsFromName(name)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/loader.py", line 154, in loadTestsFromName
module = __import__(module_name)
File "/Users/pc40583/repositories/biopython/Tests/test_AlignIO.py", line 238, in <module>
alignments = list(AlignIO.parse(handle, t_format))
File "/Users/pc40583/repositories/biopython/build/lib.macosx-10.9-x86_64-3.7/Bio/AlignIO/__init__.py", line 380, in parse
yield from i
RuntimeError: generator raised StopIteration
======================================================================
ERROR: test_empty_file_read (test_Nexus.TestSelf)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/pc40583/repositories/biopython/build/lib.macosx-10.9-x86_64-3.7/Bio/AlignIO/NexusIO.py", line 42, in NexusIterator
n = Nexus.Nexus(handle)
File "/Users/pc40583/repositories/biopython/build/lib.macosx-10.9-x86_64-3.7/Bio/Nexus/Nexus.py", line 623, in __init__
self.read(input)
File "/Users/pc40583/repositories/biopython/build/lib.macosx-10.9-x86_64-3.7/Bio/Nexus/Nexus.py", line 657, in read
commandlines = _get_command_lines(file_contents)
File "/Users/pc40583/repositories/biopython/build/lib.macosx-10.9-x86_64-3.7/Bio/Nexus/Nexus.py", line 1898, in _get_command_lines
lines = _kill_comments_and_break_lines(file_contents)
File "/Users/pc40583/repositories/biopython/build/lib.macosx-10.9-x86_64-3.7/Bio/Nexus/Nexus.py", line 454, in _kill_comments_and_break_lines
t2 = next(contents)
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/pc40583/repositories/biopython/Tests/test_Nexus.py", line 668, in test_empty_file_read
self.assertEqual([], list(NexusIterator(StringIO())))
RuntimeError: generator raised StopIteration
----------------------------------------------------------------------
Ran 273 tests in 578.328 seconds
The AlignIO error is exposed via this snippet of code, where I just updated the comment in d59d74a
# TODO: As of Python 3.3, can write "yield from i" instead. See PEP380.# For loop imposes some overhead... wait until we drop Python 2.7 to fix it.foraini:
yielda
However, both stem from the same issue in the Nexus comment parsing.
I have a possible fix in #1695, which might also fix the ARM-specific BGZF issue which I have not yet been able to reproduce.
For the Nexus/AlignIO fix, if you wanted to patch this for Fedora, all you need is:
diff --git a/Bio/Nexus/Nexus.py b/Bio/Nexus/Nexus.py
index 18b0a9f9c7..6faf95e569 100644
--- a/Bio/Nexus/Nexus.py+++ b/Bio/Nexus/Nexus.py@@ -444,6 +444,8 @@ def _kill_comments_and_break_lines(text):
NOTE: this function is very slow for large files, and obsolete when using C extension cnexus
"""
+ if not text:+ return ""
contents = iter(text)
newtext = []
newline = []
Could you point me at the Fedora package recipe source? I am puzzled by the lines like this in your output which seems to be deliberately skipping lots of our tests (and explains why your logs didn't report the test_Nexus.py failure):
for test in `ls test_*.py | grep -v chapter | grep -v NCBIXML | grep -v Nexus | grep -v Phylo | grep -v SeqIO | grep -v Tutorial`
Could you point me at the Fedora package recipe source? I am puzzled by the lines like this in your output which seems to be deliberately skipping lots of our tests (and explains why your logs didn't report the test_Nexus.py failure):
for test in ls test_*.py | grep -v chapter | grep -v NCBIXML | grep -v Nexus | grep -v Phylo | grep -v SeqIO | grep -v Tutorial
Excellent, thank you for confirming #1695 fixes AlignIO test failure for you too. That is further encouragement for us to include it in Biopython 1.72.
Thank you also for the Fedora packing details. Regarding to the tests you are skipping, the specific UnicodeDecodeError you linked to, issue #855, should have been fixed by aa94ebc which was in the Biopython 1.71 release. There are other issues with UnicodeDecodeError which are still open though...
Further details of the ARM setup would be appreciated. Let's focus on that with this issue?
Thank you also for the Fedora packing details. Regarding to the tests you are skipping, the specific UnicodeDecodeError you linked to, issue #855, should have been fixed by aa94ebc which was in the Biopython 1.71 release. There are other issues with UnicodeDecodeError which are still open though...
I've logged #1696 for the ARM64 specific failure in test_bgzf.py
We should have open issues for any remaining UnicodeDecodeError cases, additional reports welcome - as is any insight into fixing them.
The other issue raised here was with the Nexus / AlignIO test failure, was fixed via #1695. I am therefore closing this. Thank you, it delayed the Biopython 1.72 release but now that ought to work on Python 3.7.0 which is good news 👍
Activity
peterjc commentedon Jun 21, 2018
Part of this is
RuntimeError: generator raised StopIterationfromtest_AlignIO,https://www.python.org/dev/peps/pep-0479/
The BGZF problem might be ARM specific - I've not run Biopython on an Raspberry Pi recently, but that might be the easiest way for me to reproduce this.
peterjc commentedon Jun 21, 2018
There is an (internal) use of
StopIterationinBio/bgzf.pywhich could be in a round-about-way causing the failing on ARM...peterjc commentedon Jun 21, 2018
Our tests seem to pass on TravisCI under Python 3.7.0a4+
https://travis-ci.org/peterjc/biopython/jobs/395027004
Which version of Python exactly are you using? Python 3.7.0 is not out yet, just a release candidate, Python 3.7.0rc1
https://www.python.org/dev/peps/pep-0537/
https://www.python.org/downloads/release/python-370rc1/
peterjc commentedon Jun 21, 2018
The reported AlignIO failure,
is from this code snippet where I just updated the comment in d59d74a
In this case, the
StopIterationis from within the comment parsing withBio/Nexus/Nexus.py- which is currently puzzling me.peterjc commentedon Jun 21, 2018
I can reproduce the reported (non-ARM) failures under macOS with Python 3.7.0rc1,
The AlignIO error is exposed via this snippet of code, where I just updated the comment in d59d74a
However, both stem from the same issue in the Nexus comment parsing.
Fix Nexus StopIteration error under Python 3.7.0rc1
peterjc commentedon Jun 21, 2018
I have a possible fix in #1695, which might also fix the ARM-specific BGZF issue which I have not yet been able to reproduce.
For the Nexus/AlignIO fix, if you wanted to patch this for Fedora, all you need is:
https://github.com/biopython/biopython/commit/86eb2275448da22aa6976c6c7c46f9779af95cf1.patch
Could you point me at the Fedora package recipe source? I am puzzled by the lines like this in your output which seems to be deliberately skipping lots of our tests (and explains why your logs didn't report the
test_Nexus.pyfailure):sagitter commentedon Jun 21, 2018
It's Python-3.7.0rc1.
test_AlignIOis fixed; ARM-specific BGZF issue is not resolved yet: https://kojipkgs.fedoraproject.org//work/tasks/9804/27769804/build.logSpec file and patches for creating Biopython RPMs: https://src.fedoraproject.org/rpms/python-biopython/tree/master
All RPM builds: https://koji.fedoraproject.org/koji/packageinfo?packageID=3567
I skipped those tests because of UnicodeDecodeError. Is it resolved in Biopython-1.71?
vielmetti commentedon Jun 21, 2018
Just to be super clear, are you targeting 32-bit armhf, or 64-bit arm64, or both?
peterjc commentedon Jun 21, 2018
Excellent, thank you for confirming #1695 fixes AlignIO test failure for you too. That is further encouragement for us to include it in Biopython 1.72.
Thank you also for the Fedora packing details. Regarding to the tests you are skipping, the specific UnicodeDecodeError you linked to, issue #855, should have been fixed by aa94ebc which was in the Biopython 1.71 release. There are other issues with UnicodeDecodeError which are still open though...
Further details of the ARM setup would be appreciated. Let's focus on that with this issue?
sagitter commentedon Jun 22, 2018
@vielmetti
Both, only ARM64 is broken: https://koji.fedoraproject.org/koji/taskinfo?taskID=27769777
@peterjc
Okay, let me test again for
UnicodeDecodeError.sagitter commentedon Jun 22, 2018
Here all RPM builds i'm doing for testing; please, follow f29-python tag.
Fix Nexus StopIteration error under Python 3.7.0rc1
peterjc commentedon Jun 22, 2018
I've logged #1696 for the ARM64 specific failure in
test_bgzf.pyWe should have open issues for any remaining
UnicodeDecodeErrorcases, additional reports welcome - as is any insight into fixing them.The other issue raised here was with the Nexus / AlignIO test failure, was fixed via #1695. I am therefore closing this. Thank you, it delayed the Biopython 1.72 release but now that ought to work on Python 3.7.0 which is good news 👍
peterjc commentedon Oct 25, 2018
As noted on #1832 (comment) a recently merged pull request #1635 (comment) has sadly reintroduced this problem under Python 3.7
It should be a simple enough fix...
chris-rands commentedon Oct 25, 2018
I am not using Python 3.7 yet myself I'm not familiar with the Biopython PDB modules, but it might be as simple as this here?
peterjc commentedon Oct 26, 2018
@chris-rands quite possibly - if you try it on a pull request, we'll find out 👍
chris-rands commentedon Dec 17, 2018
I suggest we can close this as fixed on #1835
peterjc commentedon Dec 17, 2018
Thanks, closing.