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

Py3fy webagg/nbagg.#10708

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

Merged
jklymak merged 1 commit intomatplotlib:masterfromanntzer:py3webagg
Mar 24, 2018
Merged

Py3fy webagg/nbagg.#10708

jklymak merged 1 commit intomatplotlib:masterfromanntzer:py3webagg
Mar 24, 2018

Conversation

anntzer
Copy link
Contributor

(The locking of RendererAgg is already done by the super class, and thus
redundant here.)

PR Summary

PR Checklist

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

@anntzeranntzer added the Py3k labelMar 7, 2018
@anntzeranntzer added this to thev3.0 milestoneMar 7, 2018
@jklymak
Copy link
Member

Do we not test any of NBAgg?

@anntzer
Copy link
ContributorAuthor

No idea whether we do...

@QuLogic
Copy link
Member

I think that might be what the notebook in theweb_backend directory is for?

@anntzer
Copy link
ContributorAuthor

Now there are some tests :)

try:
self.figure.draw(renderer)
super().draw()
Copy link
Member

Choose a reason for hiding this comment

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

... this is pretty different. Does it do the same thing? Why just call super draw instead of the figure? Just trying to understand, not saying its wrong....

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

If you're using Agg, this resolves tohttps://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/backends/backend_agg.py#L414 which gets a cleared renderer, handles the locking and callsself.figure.draw(self.renderer).

Of course the not-so-secret objective here is to make it possible to swap in mplcairo's renderer. For that, the idea is as usual to push as much the renderer-specific code back to the super-class.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense. I did findsuper().draw() a bit opaque.; ie. why not justself.draw()?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

well that would be an infinite loop...
super().draw() means (approximately) "call the draw method but don't look it up on this class, look it up on the base class [in this case, FigureCanvasAgg] instead" (check up e.g. "python super mro" for details)

Copy link
Member

Choose a reason for hiding this comment

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

ooops. duh.

@jklymak
Copy link
Member

If you rebase this so your new tests are included, will the codecov go up? Did you test this w/ your new tests?

(The locking of RendererAgg is already done by the super class, and thusredundant here.)
@anntzer
Copy link
ContributorAuthor

rebased.
The tests actually touch a completely different part of webagg (because I don't know enough websockets to actually trigger a draw...) so I doubt that changes anything.

@jklymakjklymak merged commit2164417 intomatplotlib:masterMar 24, 2018
@anntzeranntzer deleted the py3webagg branchMarch 24, 2018 21:10
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jklymakjklymakjklymak approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

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

Successfully merging this pull request may close these issues.

4 participants
@anntzer@jklymak@QuLogic@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp