Closed JoeJimFlood closed 2 months ago
The issue seems to be with the line c = np.bincount(starts[:, 0]). The np.bincount function counts the number of occurrences of each value in the input array. If the maximum value in the input array is less than the length of the array, the output of np.bincount will be shorter than the input array.
To fix this I added a minlength parameter to np.bincount to ensure that the output is of the desired length, as see in #854.
It is still a little unclear exactly why this is happening. The issue can often go away when just re-running. I believe @JoeJimFlood is the only one to hit this error so far and it is just one case in a full model run that get's lost. It seems like perhaps some person has an extremely unlikely daily pattern where the starts / stops happen to cause the (diffs == 1) to never be true.
Regardless of the root cause, the fix seems to prevent the crash.
We've had a couple of ABM3 runs fail during non-mandatory tour frequency due to a record being removed from the choosers table when doing some of the initial data processing. In both cases, it was resolved simply by starting over the full run from scratch. This is the error message that appears:
The expression that is causing the error is this one. I noticed that the expression before is identical except for
continuous=False
in the call ofperson_available_periods()
, leading me to believe that the issue is occurring in this function, as the only additional step that is added when the continuous variable is set toTrue
is that function being called.