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
BUG: tri: prevent Triangulation from modifying specified input #1576
Conversation
@pv: you need to argue the case for this change. It is not clear if this is a bug - no promise is made not to modify the triangles array. Admittedly the documentation doesn't say that that the array may be modified, but it did until PR #1494 less than a month ago. Perhaps all that is needed is better documentation. |
I'd argue that triplot modifying its input argument is very unexpected behavior, and it does break things. Plotting something should never change the data provided. (Of course, you can argue that the right place to make the copy is in triplot et al.) Consider this:
Now, the Qhull invariant of how vertices relate to the neighborhood structure is broken. This causes e.g. the simplex finding code to fail spuriously later on. |
Agreed that this is a bug. While it isn't explicitly documented, and we don't explicitly test for this, it is a general rule that we don't modify input arguments in-place. We are only plotting. In general, we use the inputs to the plotting functions as-is to prevent unneeded copies, but if changes are needed, then we copy. |
Fixed blitting in Gtk3Agg backend
OK, if it is a bug the changes need to be made based on the maintenance branch, not master, as specified in the pull request check list. There are ramifications for existing uses of this code. @pv: the analysis of this bug should include information about under what circumstances the |
Very well: #1584 |
…ction_example Updated custom_projection_example.py to work with v1.2 and newer
Positional argument specifiers are required by Python 2.6
triplot(x, y, simplex) should not modify the simplex array as a side effect.
Ok, rebased against v1.2.x, replaced simplices -> triangles, and reopened. |
Fix applied to both v1.2.x and master. Thanks @pv. |
triplot(x, y, simplex) should not modify the simplex array as a side effect.