Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with pytaxonkit.name #26

Merged
merged 2 commits into from
Jun 1, 2022
Merged

Fix bug with pytaxonkit.name #26

merged 2 commits into from
Jun 1, 2022

Conversation

standage
Copy link
Member

Small bug fix for pytaxonkit.name. Also, looks like some Symplocos-ologist has been busy at work since pytaxonkit was last updated, so made some minor changes to the expected output of the test suite.

Closes #25.

wget ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz
curl -L -O ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like GitHub Actions Mac VM no longer has wget installed by default.

Comment on lines -439 to +440
idlist = '\n'.join(map(str, ids))
if idlist == '':
idlist = '\n'.join(map(str, ids)) + '\n'
if idlist == '\n':
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug fix proper

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The power of the newline

Comment on lines +562 to +566
def test_name_regression():
result = name([6])
print(result)
assert len(result) == 1
assert result.Name[0] == 'Azorhizobium'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a regression test.

@standage
Copy link
Member Author

Hi @philippbayer, can you confirm this fix works for you?

@philippbayer
Copy link

I can confirm it now works on my system!! Thanks so much

@standage
Copy link
Member Author

standage commented Jun 1, 2022

Investigated the Popen bufsize parameter as a potential alternative solution, but wasn't able to get it to work. I'm happy with this fix in any case.

I'm pretty sure the changes in this PR already address the cause of the monthly cron CI failure.

Ready for review and merge!

Copy link
Collaborator

@RyanBerger98 RyanBerger98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm that the changes fix the bug described in #26. Also confirmed that the tests pass.

@RyanBerger98
Copy link
Collaborator

LGTM! Thank you!

@RyanBerger98 RyanBerger98 merged commit 358b674 into master Jun 1, 2022
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.

Bug with taxonomy IDs < 10 not returning names
3 participants