ExtSlice Support
stefdoerr opened this issue · comments
I am playing around a bit with tangent after your helpful reply in reddit ;)
So I was trying to reshape an array. First I had:
File "<stdin>", line 2
r2 = np.sum(wrapped ** 2, axis=1)[:, np.newaxis]
^
TangentParseError: Extended Slices are not supported
Then I tried with reshape
r2 = np.sum(wrapped ** 2, axis=1).reshape(-1, 1)
and it gave: AttributeError: 'NoneType' object has no attribute 'reshape'
Then I tried
r2 = np.sum(wrapped ** 2, axis=1)
r2 = r2.reshape(-1, 1)
which gave AttributeError: module 'builtins' has no attribute 'r2'
and there I finally got the hint and did:
r2 = np.sum(wrapped ** 2, axis=1)
r2 = np.reshape(r2, (-1, 1))
Which worked. I guess it would be nice for new users to add a line to the docs not to use the array methods and instead use directly numpy functions.
Good point. We don't currently have the machinery to detect that r2
is an object with methods. I'll add a line to the docs soon making this clear.
We should support ExtSlice, though, that should have worked off the bat.
Requires supporting it in our ANF transform, probably minimal change:
Lines 109 to 123 in 01f861a
Should be fixed in 0ef0225.