Skip to content

yet another contour algorithm bug fix #2091

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

Merged
merged 3 commits into from
Oct 17, 2017
Merged

yet another contour algorithm bug fix #2091

merged 3 commits into from
Oct 17, 2017

Conversation

alexcjohnson
Copy link
Collaborator

I'm always amazed how many edge cases (literal edge cases in fact 🖼 ) there are with contour plots, and that our tests still hadn't (is that too optimistic a word? should I say haven't?) covered them all.

Fixes #2088

@alexcjohnson
Copy link
Collaborator Author

Ah crap - it's not that simple 😢
screen shot 2017-10-16 at 1 54 32 pm

- and move the test to an image, since it passed before and after this change
pi.edgepaths[edgei2] =
pi.edgepaths[edgei2].concat(pts, edgepath2);
if(j > i) j--;
pi.edgepaths[j] = edgepathj.concat(pts, edgepathi);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the end it was all about these two lines - getting the right index (if(j > i) j--;) and using the right paths (previously we were doubling up edgepath2 <-> edgepathj but because of the poor usage it was hard to tell that. Surprising that we hadn't hit this before in our tests, but now we do!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Then this also applies to carpet contour plots which use the same function. 🎉

@etpinard
Copy link
Contributor

Nicely done 💃

@alexcjohnson alexcjohnson merged commit 86e7135 into master Oct 17, 2017
@alexcjohnson alexcjohnson deleted the contour-edge-bug branch October 17, 2017 12:13
@etpinard etpinard mentioned this pull request Oct 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants