onnela-lab / forest

Forest is a library for analyzing smartphone-based high-throughput digital phenotyping data
https://forest.beiwe.org
BSD 3-Clause "New" or "Revised" License
28 stars 16 forks source link

ValueError in SciPy interpolate.interp1d when running Oak #234

Closed biblicabeebli closed 9 months ago

biblicabeebli commented 9 months ago

I think its just a bounds check to fix.

scroll down, second-to-bottom issue on https://studies.beiwe.org/studies/951/forest/tasks task id is 4b5891ca-940f-4a2a-bfac-c28391f6bb5c

commit hash should be fcc49a74057f98b1b26079a0257b3e9d7c27a98f - its a commit on my beiwe-taskrunner branch.

ValueError: x and y arrays must have at least 2 entries
  File "services/celery_forest.py", line 165, in run_forest_task
    run_forest(task)
  File "services/celery_forest.py", line 216, in run_forest
    TREE_TO_FOREST_FUNCTION[forest_task.forest_tree](**params_dict)
  File "forest/oak/base.py", line 620, in run
    t_bout_interp, vm_bout = preprocess_bout(timestamp, x, y, z)
  File "forest/oak/base.py", line 62, in preprocess_bout
    f = interpolate.interp1d(t_bout, x_bout)
  File "scipy/interpolate/_interpolate.py", line 579, in __init__
    raise ValueError("x and y arrays must have at "