-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Fancy slicing inconsistent behaviour with lists of lists and arrays of arrays #7909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Lists of lists are interpreted as high dimensional indices. It is something that comes up every once in a while, though nice tracking it down even to the magic 32 number ;). Got even an open PR to deprecate non-tuple multi dimensional indices. The most annoying part of which is that it is even used in NumPy a gazillion times (and weeding out all the warnings is hell). Also I guess since nobody tried, we don't know how much people use the list thing. It is quite common, since sometimes you want to change the indexing tuples, and then using lists instead of tuples happens quickly. For reference see gh-4434 please feel free to keep discussing, but will close this anyway. |
If this annoys you, the solution is to do |
"It's such a nice bug, it's almost like a feature..." Well, I don't have any problems with that, and tracking it down wasn't hard, but it could be made clearer in the Advanced Slicing documentation that there is a difference if you use ndarrays or lists... Thanks for the quick answer |
Heh feature.... It really annoys me, but it is a feature explicitly put in at some point ;). If you have some time or proposals, documentation improvements are always welcome! |
Hello !
I am working on some triangular mesh processing, and I've stumbled on some weird behaviour for some of our smaller geometry tests.
Apparently, lists of lists and arrays of arrays behave very differently for fancy queries up to a length of 32.
Here is some code to reproduce the issue:
I don't use numpy arrays for my faces for reasons that are not relevant here, and I hadn't run into this issue until I've tested my solution on very tiny meshes.
I can easily contour this problem by making a numpy copy of the faces list (since it's so small in this case), so I don't actually need a fix, but I do think it's a bug.
I'm running on Ubuntu 14.4, Python 3.4, and np.version.version == '1.8.2'
Good luck, and thanks for your hard work
The text was updated successfully, but these errors were encountered: