Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix for issue #4180 trirefiner not dealing with fortran contiguous triangles #4184

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

Conversation

ianthomas23
Copy link
Member

One-line fix for issue #4180, plus new test based on OP's report.

Should also be ported to master branch as although master doesn't suffer from the bug, we may as well include the test to ensure it isn't accidentally added in the future.

@WeatherGod
Copy link
Member

+1 from me. Just a quick thought... do we have any similar concerns with the contouring code? If one passes in a fortran ordered image, would the code still work properly?

efiring added a commit that referenced this pull request Mar 3, 2015
…tiguous_triangles

Fix for issue #4180 trirefiner not dealing with fortran contiguous triangles
@efiring efiring merged commit 98d1d24 into matplotlib:color_overhaul Mar 3, 2015
@efiring
Copy link
Member

efiring commented Mar 3, 2015

Cherry-picked to master as 2077a46

@tacaswell
Copy link
Member

Thanks @ianthomas23 !

@ianthomas23
Copy link
Member Author

@WeatherGod: I've checked contouring and it is fine.

@OceanWolf
Copy link
Member

Gah, this breaks the Travis on the python 2.6 build because it uses numpy 1.6 which doesn't support the order keyword on np.copy (it only came in on 1.7 I think). I don't know why Travis missed that environment variable off when it tested this PR.

Do we still support numpy 1.6? If so then we can replace:

np.copy(a, order=order)

with

np.array(a, copy=True, order=order)

@jenshnielsen
Copy link
Member

@OceanWolf You are right. This wasn't discovered because we don't test with Numpy 1.6 on the maintenance branch. The changes to Travis that specifically enabled Numpy 1.6 (with Python 2.6) have not been back ported to that branch. I think your solution is fine. AFAIK we would like to continue supporting Numpy 1.6 since it is the default version on a number of Linux distributions

@tacaswell
Copy link
Member

@OceanWolf Can you put in a PR with that change?

Is there any plan on the np side to deprecate the copy kwarg to array?

@OceanWolf
Copy link
Member

Okay, I now see that this got merged into color-overhaul which doesn't have that environment option, though I would have thought a separate Travis check should happen before merging into master, as they have different criteria for passing (not just numpy version).

@tacaswell not quite sure how to do this, although the actual code fix looks straight forward enough, it goes against two different branches, I imagine that the color-overhaul branch should get the Travis numpy1.6 check backported to prevent similar incident.

I have no idea if numpy has a plan to deprecate the copy kw, when I saw the problem on Travis, I just turned to the docs for 1.6 http://docs.scipy.org/doc/numpy-1.6.0/reference/generated/numpy.copy.html which says:

numpy.copy(a)

Notes

This is equivalent to

>>> np.array(a, copy=True)                              

I would hope numpy don't deprecate this until 1.6 has disappeared from the various distros.

@jenshnielsen
Copy link
Member

@OceanWolf Yes in principle the code should be tested on both branches before merging but that requires opening a new PR against the other branch. Back porting the changes to Travis makes sense

I don't see anything in the numpy docs about deprecating copy=True so I think that is fine.

The easiest is to open a PR with the fix against color-overhaul and we can then cherrypick the change onto master.

@efiring
Copy link
Member

efiring commented Mar 4, 2015

The copy kwarg is fundamental to the array() function; I can't imagine it ever going away.

@QuLogic QuLogic added this to the v1.5.0 milestone Oct 16, 2016
@ianthomas23 ianthomas23 deleted the 4180_trirefiner_fortran_contiguous_triangles branch July 8, 2021 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants