caporaso-lab / sourcetracker2

SourceTracker2
BSD 3-Clause "New" or "Revised" License
62 stars 45 forks source link

_gibbs fails on dataframes with floats #41

Closed lkursell closed 8 years ago

lkursell commented 8 years ago

_gibbs fails with: IndexError: index 6283 is out of bounds for axis 0 with size 6283 When the are floats in the sink_df. The error occurs when trying to create the order to walk through the sequences.

Probably want to add a check so that a less cryptic error message is given to the user.

wdwvt1 commented 8 years ago

Can you post the dataset + command that causes this. I thought I had every error where an index error occurs isolated, but definitely need to see what slipped through.

wdwvt1 commented 8 years ago

this can be resolved by changing line 529 in sourcetracker2/sourcetracker.py to be sink_sum = np.int(sink.sum()). alternatively we can floor or ceiling this value, but we just need to ensure its not non-integer.

lkursell commented 8 years ago

Should we make the user address their int problem? or just call floor and add a note saying that is what we do?

On Apr 26, 2016, at 3:52 PM, Will Van Treuren notifications@github.com wrote:

this can be resolved by changing line 529 in sourcetracker2/sourcetracker.py to be sink_sum = np.int(sink.sum()). alternatively we can floor or ceiling this value, but we just need to ensure its not non-integer.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/biota/sourcetracker2/issues/41#issuecomment-214911824

wdwvt1 commented 8 years ago

This is now resolved in PR #51 and noted in the readme.md.