mdshw5 / pyfaidx

Efficient pythonic random access to fasta subsequences
https://pypi.python.org/pypi/pyfaidx
Other
459 stars 75 forks source link

Minor improvement in integer indexing Fasta class. #163

Closed C-nit closed 4 years ago

C-nit commented 4 years ago

With the change in __getitem__, not the full length of key() is iterated, but just as many elements as necessary. When at it, __iter__ calls here avoid the type check by not calling __getitem__. Also, the imports were sorted.

Signed-off-by: Joris Cadow joriscadow@gmail.com

mdshw5 commented 4 years ago

Hey @C-nit - this looks really good. The tests are failing because of a biopython dependency for producing the test data. I wasn't aware that they recently dropped support for python < 3.6. Once I fix the tests I'll merge these changes.

mdshw5 commented 4 years ago

@C-nit thanks for your contribution! I'm looking for ways to take advantage of more modern python features so if you spot anything else you'd like to change let me know!