Closed carterbox closed 7 years ago
@johnyf you assigned this to yourself, but it appears that @carterbox already provided a candidate fix in PR #36. I am reviewing it now.
Thanks for the notification. Yes, I have noticed that a PR is under review, so I only reviewed this issue and confirmed that it is an error.
Fixed in commit 47f0dc0fd988f51bd99e32f873e8a1204e9d85f0, introduced via PR #36
Bug
The following deprecation warning shows when running the test script with
python==3.5.2
andnumpy==1.11.1
.VisibleDeprecationWarning: converting an array with ndim > 0 to an index will result in an error in the future
range(beg_mi[j],beg_mi[j]+mi[j])
This warning is occurring because
mi[j]
is being used to define a range, but it is a list of size 1 instead of an integer. i.e.[10]
instead of10
. The cause is thatmi
is defined as a 2D column array:mi = np.zeros([N,1], dtype=int)
such that 1D indexing ofmi
returns a row instead of an element.Fix
Define
mi
as an(N,0)
array instead. Sincemi
is not involved in matrix muliplications, it shouldn't matter if it is a column or row vector.