dsilvestro / PyRate

PyRate is a program to estimate speciation, extinction, and preservation rates from fossil occurrence data using a Bayesian framework.
GNU Affero General Public License v3.0
76 stars 34 forks source link

IndexError (index out of bounds) #33

Closed zhangchicool closed 1 year ago

zhangchicool commented 1 year ago

Hi Daniele,

Command "python PyRate.py -ginput .../Canidae_1_G_mcmc.log -b 100 -resample 10" in tutorial 2, section "Multiple samples of times of origination and extinction", generates an error of "IndexError: index 955 is out of bounds for axis 0 with size 899".

I think it is due to line 130-131 in pyrate_lib/lib_utilities.py: TS= list(t_file[burnin:shape_f[0],i].astype(float)[indx]) TE= list(t_file[burnin:shape_f[0],ind_te0+j].astype(float)[indx])

and should be fixed with: TS= list(t_file[0:shape_f[0],i].astype(float)[indx]) TE= list(t_file[0:shape_f[0],ind_te0+j].astype(float)[indx]

Chi

thauffe commented 1 year ago

Hi Chi,

thanks for reporting the issue. We will have a look into this asap!

thauffe commented 1 year ago

Thanks Chi,

this was indeed incorrect and is now fixed by: TS = list(t_file[indx, i].astype(float)) TE = list(t_file[indx, ind_te0 + j].astype(float))