Visitar URL original
Backend refactor by tacaswell · Pull Request #8777 · matplotlib/matplotlib · GitHub
The Wayback Machine - https://web.archive.org/web/20210829105806/https://github.com/matplotlib/matplotlib/pull/8777
Skip to content
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

Backend refactor #8777

Draft
wants to merge 58 commits into
base: master
Choose a base branch
from
Draft

Backend refactor #8777

wants to merge 58 commits into from

Conversation

@tacaswell
Copy link
Member

@tacaswell tacaswell commented Jun 19, 2017

This is a rebase of #4143

@tacaswell tacaswell force-pushed the tacaswell:backend-refactor branch from 5ffd1c0 to 072c47a Jun 19, 2017
If begin / end are _blocking_ then these changes make sense, if they
are non-blocking then these changes do not make sense.

This means we can not use the global counter on this class to detect
when all of the open figures are closed.
@tacaswell
Copy link
Member Author

@tacaswell tacaswell commented Jun 25, 2017

On a bit more thought, I think the problem that the MainLoop classes are solving is knowing when under a blocking call to the GUI main loop all of the user windows are closed and it is safe to un-block and return control. As implemented by @OceanWolf this was done via a class level counter that was incremented and decremented as the instances were instantiated and garbage collected.

It is probably a better path to count the number of figures we show in Gcf.show_all() and then register a callback on to the manager to decrement that count and exit the event loop when it reaches 0.

@OceanWolf
Copy link
Contributor

@OceanWolf OceanWolf commented Jun 25, 2017

Pretty much yes, but I also wanted to make Gcf as thin as possible and thus give as much flexibility to the down-the-line developer as we can.

One more week and then hopefully I will get back to this :).

@tacaswell
Copy link
Member Author

@tacaswell tacaswell commented Jun 25, 2017

I have a bunch of code re-working the MainLoop stuff on my laptop. Needs a bit more work but I will push it up here sometime today.

@anntzer
Copy link
Contributor

@anntzer anntzer commented Jun 26, 2017

@tacaswell Point 1.ii ("The conflation of these two tasks etc.") is a bit confusing (xref today's call).

This will get rebased out of existence
@tacaswell tacaswell modified the milestones: 2.2 (next next feature release), 2.1 (next point release) Jul 25, 2017
@fariza
Copy link
Member

@fariza fariza commented Nov 14, 2017

@tacaswell @OceanWolf can we try to give a final push to this?

@jklymak
Copy link
Contributor

@jklymak jklymak commented May 30, 2018

Re-milestoning. This looks like something someone will have to sit down with for a few days....

@leycec
Copy link

@leycec leycec commented Dec 13, 2018

This was amazing – and desperately needed. Given the growing laundry list of conflicts, this also seems decreasingly likely to ever hit the mainline. This would only be the latest in a chain of similar pull requests to ultimately fail: first #2617, then #2624, then #4143, and now this.

Throwing essential volunteer contributions away year-after-year isn't the best recipe for success. Is the core issue here the practical infeasibility of refactoring the pyplot API in this extravagant manner without breaking backward compatibility? If so, would creating a parallel object-oriented API resolving these issues while preserving the existing pyplot API as is possibly be a more pragmatic solution?

The merit of the latter approach is that it would permit the new API to be constructed iteratively over the course of multiple pull requests rather than all-at-once over the course of a single pull request, as has been the case until now. In theory, an evolutionary rather than revolutionary approach should substantially reduce the likelihood of volunteer burnout and inevitable abandonment.

Of course, any solution is going to be heavyweight, highly non-trivial, and prone to misery. But our current approach doesn't appear to be working at all. Perhaps it's time to contemplate alternate thought patterns.

@anntzer
Copy link
Contributor

@anntzer anntzer commented Dec 13, 2018

FWIW I have read through the PR a few times and I still don't understand its fundamental motivation (what does it solve?). Can you describe why you consider this "desperately needed"?

@jklymak jklymak modified the milestones: v3.1.0, v3.2.0 Feb 7, 2019
@tacaswell tacaswell modified the milestones: v3.2.0, needs sorting Aug 19, 2019
@jklymak jklymak marked this pull request as draft Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants