Rule refine error: ValueError: x and y arrays must have at least 2 entries


Is anyone familiar with this error message during the rule refine? Does it have anything to do with the parameter clock_filter_iqd ?

1001.75 FINAL ROUND - confidence estimation via marginal
Traceback (most recent call last):
  File "/anaconda3/envs/nextstrain/bin/augur", line 8, in <module>
  File "/anaconda3/envs/nextstrain/lib/python3.6/site-packages/augur/", line 10, in main
    return argv[1:] )
  File "/anaconda3/envs/nextstrain/lib/python3.6/site-packages/augur/", line 74, in run
  File "/anaconda3/envs/nextstrain/lib/python3.6/site-packages/augur/", line 207, in run
    covariance=args.covariance, resolve_polytomies=(not args.keep_polytomies))
  File "/anaconda3/envs/nextstrain/lib/python3.6/site-packages/augur/", line 74, in refine
    n.num_date_confidence = list(tt.get_max_posterior_region(n, 0.9))
  File "/anaconda3/envs/nextstrain/lib/python3.6/site-packages/treetime/", line 877, in get_max_posterior_region
    kind='linear', fill_value=min_max[0], bounds_error=False)
  File "/anaconda3/envs/nextstrain/lib/python3.6/site-packages/scipy/interpolate/", line 543, in __init__
    "least %d entries" % minval)
ValueError: x and y arrays must have at least 2 entries

Hi @andersonbrito! Very interesting to see this error popping up again. This is a rare error that sometimes happens with TreeTime during the refine step. It’s usually a one-off and restarting that step clears it - but clearly that’s still irritating if it’s been running for a while! Can I ask, what version of Treetime are you running? We had hoped that the latest updates had cleared this error. I’ll tag in @rneher as well, as he’s been the one tracking down the error!

This issue appears to have been resolved in TreeTime’s master branch by checking for a minimum number of entries in the array before trying to interpolate. This change was made on May 5 and the latest release (0.7.5) was made on April 13.

Maybe a new release of TreeTime would resolve this issue, @rneher?

I made a release 0.7.6 on May 5 on pypi – forgot on github.

@andersonbrito Before upgrading, could you confirm your existing TreeTime version so we know for sure that the bug isn’t still present in version 0.7.6?

This command should tell you the version:

python3 -c 'import treetime; print(treetime.version)'

Hi all,

Thank you for your feedback.
The current version available in my system is the 0.7.4.

I’ll try to upgrade to the latest version. If I experience the same error again, I’ll let you know in this thread.

1 Like