Repository navigation
BGZF RecursionError - #1767
BGZF RecursionError#1767
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1767 +/- ##
==========================================
- Coverage 85.43% 85.43% -0.01%
==========================================
Files 331 331
Lines 50204 50203 -1
==========================================
- Hits 42891 42889 -2
- Misses 7313 7314 +1
Continue to review full report at Codecov.
|
|
|
||
| h.close() | ||
|
|
||
| def test_bug_1701(self): |
There was a problem hiding this comment.
Can you rename that to something like test_many_blocks_in_one_read_call?
|
This looks great - the fix is along the lines I was expecting/hoping would work, but you've made a nice reproducible test case which it the bit I was blocked on. I noticed you haven't added your self to the NEWS and CONTRIB file, and don't put your name on your GitHub profile. If you want to be acknowledged as just @rtf-const that's fine - or leave it as is. @mdshw5 is it easy for you to test this fix locally with pyfaidx, or would you prefer I merge it first? |
|
I'll test this locally, but it looks like this will provide a fix for BGZF in pyfaidx, so feel free to merge. |
|
Thanks @mdshw5 - I'll look forward to your test results 👍 |
| # (lazy loading, don't load the next block unless we have too) | ||
| data = self._buffer[self._within_block_offset:self._within_block_offset + size] | ||
| self._within_block_offset += size | ||
| assert data # Must be at least 1 byte |
There was a problem hiding this comment.
In the future it might be nice to have an Exception here in case the assertion is false. Something like ValueError("Expected data at byte %d." % self.tell()). For now I think this looks fine.
|
|
||
| h.close() | ||
|
|
||
| def test_bug_1701(self): |
There was a problem hiding this comment.
Thanks for writing this test. I've had this in the back of my mind for almost a year and always procrastinated. This is really helpful!
No, I have no special issues with that. I added my name to CONTRIB and NEWS and renamed the test method |
|
Thank you 👍 |
Original author Lenna X. Peterson (and Thomas Hamelryck on whose Bio.PDB tests this was in part based), and all the contributors since as tracked with version control have agreed: - Carlos Pena (@carlosp420) biopython#898 (comment) - Christian Brueffer (@cbrueffer) biopython#898 (comment) - Fábio Madeira (@biomadeira) biopython#898 (comment) - Francesco Gastaldello (@Gasta88) biopython#1063 - João Rodrigues (@JoaoRodrigues) biopython#898 (comment) - Lenna Peterson (@lennax) biopython#898 (comment) - Michiel de Hoon (@mdehoon) biopython#898 (comment) - Peter Cock (@peterjc) biopython#898 (comment) - Konstantin Vdovkin (@rtf-const) biopython#1767 - Stefans Mezulis (@StefansM) biopython#1445 - Sunhwan Jo (@sunhwan) biopython#898 (comment) - Thomas Hamelryck (CVS username nisse) https://mailman.open-bio.org/pipermail/biopython/2018-September/016546.html
Original author Bertrand Frottier, named copyright holders, and all contributors since as tracked with version control have agreed: - Bertrand Frottier https://mailman.open-bio.org/pipermail/biopython/2019-August/016662.html - Brad Chapman (@chapmanb) http://mailman.open-bio.org/pipermail/biopython-dev/2013-July/019903.html - Carlos Pena (@carlosp420) biopython#898 (comment) - Christian Brueffer (@cbrueffer) biopython#898 (comment) - Francesco Gastaldello (@Gasta88) biopython#1063 - Iddo Friedberg (@idoerg) biopython#898 (comment) - Konstantin Vdovkin (@rtf-const) biopython#1767 - Lenna Peterson (@lennax) biopython#898 (comment) - Michiel de Hoon (@mdehoon) biopython#898 (comment) - @morrme biopython#1172 (comment) - Nick Negretti (@nimne) biopython#1768 (comment) - Nick Semenkovich (@semenko) biopython#898 (comment) - Peter Cock (@peterjc) biopython#898 (comment) - Sergei Lebedev (@superbobry) biopython#898 (comment) - Sergio Valqui (@svalqui) biopython#1749 - Terry Jones (@terrycojones) biopython#898 (comment) - Travis Wrightsman (@twrightsman) biopython#898 (comment)
Original author Bertrand Frottier, named copyright holders, and all contributors since as tracked with version control have agreed: - Bertrand Frottier https://mailman.open-bio.org/pipermail/biopython/2019-August/016662.html - Brad Chapman (@chapmanb) http://mailman.open-bio.org/pipermail/biopython-dev/2013-July/019903.html - Carlos Pena (@carlosp420) biopython#898 (comment) - Christian Brueffer (@cbrueffer) biopython#898 (comment) - Christof Winter (@winterschlaefer) biopython#898 (comment) - Francesco Gastaldello (@Gasta88) biopython#1063 - Iddo Friedberg (@idoerg) biopython#898 (comment) - Konstantin Vdovkin (@rtf-const) biopython#1767 - Lenna Peterson (@lennax) biopython#898 (comment) - Michiel de Hoon (@mdehoon) biopython#898 (comment) - @morrme biopython#1172 (comment) - Nick Negretti (@nimne) biopython#1768 (comment) - Nick Semenkovich (@semenko) biopython#898 (comment) - Peter Cock (@peterjc) biopython#898 (comment) - Sergei Lebedev (@superbobry) biopython#898 (comment) - Sergio Valqui (@svalqui) biopython#1749 - Terry Jones (@terrycojones) biopython#898 (comment) - Travis Wrightsman (@twrightsman) biopython#898 (comment)
Original author Bertrand Frottier, named copyright holders, and all contributors since as tracked with version control have agreed: - Bertrand Frottier https://mailman.open-bio.org/pipermail/biopython/2019-August/016662.html - Brad Chapman (@chapmanb) http://mailman.open-bio.org/pipermail/biopython-dev/2013-July/019903.html - Carlos Pena (@carlosp420) #898 (comment) - Christian Brueffer (@cbrueffer) #898 (comment) - Christof Winter (@winterschlaefer) #898 (comment) - Francesco Gastaldello (@Gasta88) #1063 - Iddo Friedberg (@idoerg) #898 (comment) - Konstantin Vdovkin (@rtf-const) #1767 - Lenna Peterson (@lennax) #898 (comment) - Michiel de Hoon (@mdehoon) #898 (comment) - @morrme #1172 (comment) - Nick Negretti (@nimne) #1768 (comment) - Nick Semenkovich (@semenko) #898 (comment) - Peter Cock (@peterjc) #898 (comment) - Sergei Lebedev (@superbobry) #898 (comment) - Sergio Valqui (@svalqui) #1749 - Terry Jones (@terrycojones) #898 (comment) - Travis Wrightsman (@twrightsman) #898 (comment)
Original author Lenna X. Peterson (and Thomas Hamelryck on whose Bio.PDB tests this was in part based), and all the contributors since as tracked with version control have agreed: - Carlos Pena (@carlosp420) #898 (comment) - Christian Brueffer (@cbrueffer) #898 (comment) - Fábio Madeira (@biomadeira) #898 (comment) - Francesco Gastaldello (@Gasta88) #1063 - João Rodrigues (@JoaoRodrigues) #898 (comment) - Lenna Peterson (@lennax) #898 (comment) - Michiel de Hoon (@mdehoon) #898 (comment) - Peter Cock (@peterjc) #898 (comment) - Konstantin Vdovkin (@rtf-const) #1767 - Stefans Mezulis (@StefansM) #1445 - Sunhwan Jo (@sunhwan) #898 (comment) - Thomas Hamelryck (CVS username nisse) https://mailman.open-bio.org/pipermail/biopython/2018-September/016546.html
This pull request addresses issue #1701
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.rstfile and understand that AppVeyor andTravisCI will be used to confirm the Biopython unit tests and
flake8stylechecks pass with these changes.
I have added my name to the alphabetical contributors listings in the files
NEWS.rstandCONTRIB.rstas part of this pull request, am listedalready, or do not wish to be listed. (This acknowledgement is optional.)