check that BminVblack
is a monotonically increasing array.
It is monotonically increasing if np.all(np.diff(BminVblack)>0)
evaluates to True
.
If it is not monotonically increasing, an 'out of range' error can be raised. The same happens if the input array is monotonically decreasing, as was your case.