Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

FIX: set_url() without effect in the plot for instances of Tick#9696

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
khyox wants to merge2 commits intomatplotlib:masterfromkhyox:patch-1

Conversation

khyox
Copy link
Contributor

PR Summary

In the class Tick, the url attribute is not passed to any of the objects that are to be drawn, so it is useless, as detailed in issue#9695. Suggested solution is to override theset_url() method in Tick to transfer the url attribute content to the tick labels, that are to be drawn.

Fixes issue#9695.

PR Checklist

  • [N/A] Has Pytest style unit tests
  • [OK] Code is PEP 8 compliant
  • [N/A] New features are documented, with examples if plot related
  • [OK] Documentation is sphinx and numpydoc compliant
  • [N/A] Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • [N/A] Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

In the class Tick, the url attribute is not passed to any of the objects that are to be drawn. Suggested solution is to override the set_url() method in Tick to transfer the url attribute content to the tick labels, that are to be drawn.
@jklymak
Copy link
Member

Why are tests N/A for this? If it had a test, this funtionality wouldn't break in the future...

Copy link
Member

@tacaswelltacaswell left a comment

Choose a reason for hiding this comment

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

Please add the super call to not remove any existing functionality.

Set the url of label1 and label2

ACCEPTS: str
"""
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 also callsuper(self, Tick).set_label(s)?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Hi Thomas, if you meant to add a call tosuper(Tick, self).set_url(s), I just added it, if not, I don't get it, sorry.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Travis is failing with that addition with someImageComparisonFailure: images not close errors. When calling the parent Artist's set_url() method it just doesself._url = url! Amazing.

Copy link
Member

Choose a reason for hiding this comment

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

That is what I meant, thanks.

Can you reproduce the failures locally?

@tacaswell
Copy link
Member

How can we add a test for this? Can we parse the XML that is svg well using only our current dependencies to verify that the url is there?

@tacaswelltacaswell added this to thev2.2 milestoneNov 7, 2017
@jklymak
Copy link
Member

@tacaswell, I was only thinking a test could be devised to make sure the url was attached to the tick. Whether its embeded or not is another issue.

@anntzer
Copy link
Contributor

anntzer commentedNov 9, 2017
edited
Loading

For testing one can probably extract the node with the right XPath query (https://docs.python.org/3.6/library/xml.etree.elementtree.html#xpath-support) and do the right assert on it...

Or more simply one can just compare the resulting svg with manually setting the url onto the label (tick.label1.set_url(...); tick.label2.set_url(...)); they should be exactly identical.

@QuLogicQuLogic mentioned this pull requestMay 6, 2020
4 tasks
@QuLogic
Copy link
Member

I've incorporated this into#17338 and added a test.

@QuLogicQuLogic closed thisMay 6, 2020
@khyox
Copy link
ContributorAuthor

Many thanks,@QuLogic, and sorry, it seems that this fell off my radar at some point :(

@tacaswell
Copy link
Member

@khyox It fell off ours too 😞

@QuLogicQuLogic modified the milestones:needs sorting,v3.3.0May 27, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell requested changes

@dopplershiftdopplershiftdopplershift approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.3.0
Development

Successfully merging this pull request may close these issues.

6 participants
@khyox@jklymak@tacaswell@anntzer@QuLogic@dopplershift

[8]ページ先頭

©2009-2025 Movatter.jp