Closed dmcglinn closed 10 years ago
Just pushed a new version of test.py the I can't figure out how to fix the runtime error although I was successful at making the paths relative and providing a command line option for testing for bias or not.
Give me a minute to look at it.
On Mon, Dec 9, 2013 at 11:54 AM, Dan McGlinn notifications@github.comwrote:
Just pushed a new version of test.py the I can't figure out how to fix the runtime error although I was successful at making the paths relative and providing a command line option for testing for bias or not.
— Reply to this email directly or view it on GitHubhttps://github.com/klocey/partitions/issues/17#issuecomment-30160523 .
Working on a different project at the moment.
On Mon, Dec 9, 2013 at 11:55 AM, Ken Locey ken@weecology.org wrote:
Give me a minute to look at it.
On Mon, Dec 9, 2013 at 11:54 AM, Dan McGlinn notifications@github.comwrote:
Just pushed a new version of test.py the I can't figure out how to fix the runtime error although I was successful at making the paths relative and providing a command line option for testing for bias or not.
— Reply to this email directly or view it on GitHubhttps://github.com/klocey/partitions/issues/17#issuecomment-30160523 .
RunTimeWarning: invalid value encoutered in subractreturn var(axis, dtype, out, ddof)
This because the partition has zeros and we're asking numpy to convert the array to log abundances:
for partition in partitions: # zeros = True partition = np.log(partition) var = np.var(partition, ddof=1)
We can just use arithmetic abundances. i.e. comment out or remove the line "partitions = np.log(partition)" for the two time where zeros = True (i.e. lines 316 and 299).
This problem should NOT occur for line 354 because the partition can't have zeros. Likewise, it only occurs (for me) at lines 316 and 299.
Ken
On Mon, Dec 9, 2013 at 11:55 AM, Ken Locey ken@weecology.org wrote:
Working on a different project at the moment.
On Mon, Dec 9, 2013 at 11:55 AM, Ken Locey ken@weecology.org wrote:
Give me a minute to look at it.
On Mon, Dec 9, 2013 at 11:54 AM, Dan McGlinn notifications@github.comwrote:
Just pushed a new version of test.py the I can't figure out how to fix the runtime error although I was successful at making the paths relative and providing a command line option for testing for bias or not.
— Reply to this email directly or view it on GitHubhttps://github.com/klocey/partitions/issues/17#issuecomment-30160523 .
If you tinker with the code, you'll see the warning goes away if you don't try converting an array with zeros to log abundances.
Executive decision: Use arithmetic abundances. Remove the lines "partition = np.log(partition)". Lines 299, 316, 336, 353
Sounds good I'll make this change.
Dan
On Mon, Dec 9, 2013 at 12:41 PM, Kenneth John Locey < notifications@github.com> wrote:
Executive decision: Use arithmetic abundances. Remove the lines "partition = np.log(partition)". Lines 299, 316, 336, 353
— Reply to this email directly or view it on GitHubhttps://github.com/klocey/partitions/issues/17#issuecomment-30165897 .
Daniel J. McGlinn, PhD Postdoctoral Researcher Utah State University Department of Biology, BNR 132 Logan, UT 84322-5305 http://mcglinn.web.unc.edu/ cell: 405-612-1780
Sweet. Gracias.
RunTimeWarning: invalid value encountered in subtract return var(axis, dtype, out, ddof)
This error makes me think something is wrong in line 354 of test.py