[MNT]: Event loop and timer consistency
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 38/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- python
- Domínio
- backend, data-visualization
Direção de pesquisa
Comece rastreando plt.show(), FigureCanvas.start_event_loop(), stop_event_loop(), flush_events(), new_timer() e Timer nos backends interativos e, em seguida, analise as issues relacionadas #29062, #31858 e #31968. Considera-se concluído quando o comportamento de worker threads e event loops for consistente entre os backends e a política ainda não resolvida entre deprecation e erro imediato estiver definida.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Summary
Right now, our methods related to event loops and timers have inconsistent behavior across interactive backends. When called on a worker thread, or when called in a specific order, these methods will often raise internal errors from the wrapped GUI framework. In several cases, they will crash the process entirely.
The exact behavior can vary depending on platform. For example, pyplot.show() on a worker thread crashes in GTK+macOS, but works in GTK+Linux as long as you are very careful.
Proposed fix
I propose that we unify the behavior across all interactive backends by raising an error when the following are called on a worker thread:
plt.show()
FigureCanvas.start_event_loop()
FigureCanvas.stop_event_loop()
FigureCanvas.flush_events()
FigureCanvas.new_timer()
Any method of Timer (note: backends could still use Timers internally as needed)
Additionally, for consistency:
plt.show()andFigureCanvas.start_event_loop()should raise an error if an event loop is already running - this matches the existing behavior of most backends.FigureCanvas.stop_event_loop()should stop the event loop if it is running, regardless of how that event loop was started. If an event loop isn't running, it should simply return (the existing behavior of most backends).- All of the changes in #29062. I'm still auditing Timer behavior across backends - I believe that there are cases that this PR doesn't yet cover.
For now, we could add a deprecation message if the behavior doesn't already raise or crash. For behavior that currently crashes, I'm not sure of our policy. Would we print a deprecation message and then crash? Or would we raise an error now without a deprecation cycle?
Related issues: #31858, #31968
- Linguagem predominante
- Python
- Estrelas
- 23.5k
- Forks
- 8.6k
- Merge médio
- 1d 19h
- PRs com merge (30d)
- 64
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de matplotlib/matplotlib
-
[Bug]: Saving a NonUniformImage with bbox_inches="tight" raises TypeError when extent is omittedAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
matplotlib/matplotlib#32707 ·
Mantenedores costumam responder em até 1 dia
-
[Bug]: withTickedStroke raises ValueError when the line contains NaNTalvez já em andamento @RjyavardhanSingh assumiu há 3 dias. Abertafirst-contribution topic: path handling
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
matplotlib/matplotlib#32689 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
[Bug]: Constrained layout raises ZeroDivisionError when the first height/width ratio is zeroTalvez já em andamento @yqtian-se assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
matplotlib/matplotlib#32684 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
[Bug]: twin axes ignore the navigation opt-outsTalvez já em andamento @NaumanRafay assumiu há 36 dias. Abertatopic: toolbar
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
matplotlib/matplotlib#32528 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
[Bug]: macOS font discovery raises KeyError('_items') for an incomplete system_profiler font recordAbertafirst-contribution OS: Apple status: needs clarification topic: text/fonts
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
matplotlib/matplotlib#32328 · 4 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de matplotlib/matplotlib
Issues semelhantes
-
area/network kind/documentation triage/needs-human
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 88/100
canonical/k8s-snap#3533 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area: ops bug effort: small
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 91/100
juandresrodca/AdminForge#71 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
fossasia/eventyay-exhibition#465 · 3 comentários · 1 reação ·
Mantenedores costumam responder em até 3 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Deltakit/deltakit-circuit#28 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia