Skip to content

Add private API retrieving the current event loop and backend GUI info. #11520

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 1 commit into from
Jul 4, 2018

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jun 27, 2018

Work towards implementation of backend switching (#9795).

Note that the API is kept private for now as the lack of extensibility
is a bit unsatisfying; perhaps we'll figure out a better way to do it
if other custom implementers (e.g., code editors?) get interested in
looking into it.

The required_event_loop variable could be made private for now, or
not...

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

@anntzer anntzer added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Jun 27, 2018
@anntzer anntzer added this to the v3.0 milestone Jun 27, 2018
@@ -14,6 +16,49 @@
if not line.startswith(' File "<frozen importlib._bootstrap'))


def _get_current_event_loop():
Copy link
Member

Choose a reason for hiding this comment

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

This should be something like _get_interactive_framework_name. _get_current_event_loop makes me think it will return to me an object I can use as an event loop (ala asyncio.get_event_loop()).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, see below.

@tacaswell
Copy link
Member

I like the direction this is heading.

@anntzer anntzer force-pushed the getcurrenteventloop branch from f1e925f to 8bb7bea Compare June 29, 2018 22:12
@anntzer
Copy link
Contributor Author

anntzer commented Jun 29, 2018

Comment handled, and documented the required_interactive_framework global.

edit: As for tests, I'll probably have something globally testing switchability once everything gets in (e.g. together with the last commit).

Work towards implementation of backend switching.

Note that the API is kept private for now as the lack of extensibility
is a bit unsatisfying; perhaps we'll figure out a better way to do it
if other custom implementers (e.g., code editors?) get interested in
looking into it.

The `required_event_loop` variable could be made private for now, or
not...
@anntzer anntzer force-pushed the getcurrenteventloop branch from 8bb7bea to 93ebee6 Compare June 30, 2018 12:54
Copy link
Member

@efiring efiring left a comment

Choose a reason for hiding this comment

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

I don't understand every detail, but overall it looks fine, and I don't see how it could hurt anything.

@jklymak jklymak merged commit d762d6d into matplotlib:master Jul 4, 2018
@anntzer anntzer deleted the getcurrenteventloop branch July 4, 2018 18:13
@tacaswell tacaswell mentioned this pull request Jul 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants