Skip to content

Fix for the 0-length Connection Path with Fancy Arrow bug #3930 #4103

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

Closed
wants to merge 4 commits into from
Closed

Fix for the 0-length Connection Path with Fancy Arrow bug #3930 #4103

wants to merge 4 commits into from

Conversation

yangineer
Copy link

Greetings!

I've added code to handle the NonIntersectingPathException in Fancy patches so that Connection Path of zero-length will plot as expected.
This solves the issue in #3930.

I also added an image comparison test for the fix.

@efiring
Copy link
Member

efiring commented Feb 16, 2015

Thank you! I'm not familiar with this part of the code so I'm not reviewing the actual patch, but I have a couple of suggestions for the test. First, I don't think that it is necessary to include any file type other than png; the problem being fixed should not be in any way backend-dependent, should it? You can use the extensions=['png'] kwarg in the image_comparison decorator to restrict the image formats. Second, in more recent tests we have been using the remove_text=True kwarg in the image_comparison decorator whenever text such as tick labels does not play a useful role, either directly in the test or for making the test comprehensible. You can judge whether that is the case here.

@tacaswell tacaswell added this to the 1.5.0 milestone Feb 16, 2015
@yangineer
Copy link
Author

Thank you for the suggestions!
I agree that the problem is not backend-dependent nor does it rely on any text in the images.
I was wondering, where can I find more tips on writing better tests?
The instructions on Testing in the Developer's Guide didn't cover anything about remove_text or using just the png for image comparison.

@tacaswell
Copy link
Member

Can you also use rebase to remove the svg and pdf files from the history? The repo is already very large and we should avoid making it any bigger if possible.

This is probably someplace where we need to improve our documentation as I think the best practices exist primarily in the collective heads of the current maintainers.

@yangineer
Copy link
Author

Got it. Rebase done!

Hmm... I'm having problem passing the pep8 testing on Travis CI. Most of the warnings involve files which I didn't modify. Please help.

Fixed formatting so nothing exceeds column 80
Fixed formatting, removed .pdf and .svg for image test, added remove_text option
Removed a trailing whitespace
Removed another trailing whitespace in test_patches
Rebased all commits into 2
@efiring
Copy link
Member

efiring commented Feb 16, 2015

@yangineer No worries. @tacaswell has fixed the immediate problem via #4104.

def test_patch_zerolength_fancy():
# Github issue #3930 found a bug in the Fancy patch where a zero-length
# connection path would result in no plot being shown due to a
# NoneIntersectingPathException
Copy link
Member

Choose a reason for hiding this comment

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

typo: NonIntersectingPathException

Copy link
Author

Choose a reason for hiding this comment

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

Fixed, thanks!

Renamed the vertex in CLOSEPOLY so it seems more reasonable
@@ -3758,50 +3757,64 @@ def transmute(self, path, mutation_size, linewidth):

# path for head
in_f = inside_circle(x2, y2, head_length * .8)
path_out, path_in = \
try:
path_out, path_in = \
Copy link
Member

Choose a reason for hiding this comment

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

can you get rid of the \ or is that the only option to satisfy pep8 here?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, got rid of the backslash, managed to fit within 79 columns.

@tacaswell
Copy link
Member

@efiring Who understands this bit of the code well enough to review this?

@efiring
Copy link
Member

efiring commented Feb 19, 2015

I think this is @leejjoon's domain.

@tacaswell
Copy link
Member

@yangineer This needs a re-base.

Does this conflict with #4173 ?

@tacaswell
Copy link
Member

@yangineer At a minimum this requires a re-base.

@tacaswell tacaswell modified the milestones: proposed next point release, next point release Jul 17, 2015
@dstansby
Copy link
Member

Looks like this was fixed by #4173.

@dstansby dstansby closed this Mar 17, 2017
@QuLogic QuLogic modified the milestones: v1.5.0, 2.1 (next point release) Mar 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants