behavior of KeyboardInterrupt?
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Área
- data-visualization, desktop
Línea de trabajo
Reproduce el comportamiento de Windows Ctrl-C con PythonPlot, el bucle while true y la llamada de plotting mostrada en el issue. Empieza en src/pygui.jl:199 e inspecciona la pila de temporizadores de PythonCall y tkinter; compara el resultado con el backend GR. Se considera terminado cuando se puede interrumpir el cálculo de Julia sin romper las llamadas posteriores a PythonPlot.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
During an interactive session where I am variously running computations and plotting things, when I try to keyboard interrupt a running computation, Python apparently gets interrupted instead; for example, notice what happens when I hit Ctrl-C during a while true block:
julia> using PythonPlot
julia> plot(range(0, 1, 101).^2)
Python: [<matplotlib.lines.Line2D object at 0x0000022445A5FF50>]
julia> while true # surrogate for some long computation that I decide I want to interrupt
5+2
sleep(0.1)
end
Error in Timer:
Python: KeyboardInterrupt:
Python stacktrace:
[1] __getattr__
@ tkinter C:\Users\zor_q\.julia\environments\v1.9\.CondaPkg\env\Lib\tkinter\__init__.py:2408
Stacktrace:
[1] pythrow()
@ PythonCall C:\Users\zor_q\.julia\packages\PythonCall\qTEA1\src\err.jl:94
[2] errcheck
@ C:\Users\zor_q\.julia\packages\PythonCall\qTEA1\src\err.jl:10 [inlined]
[3] pygetattr(x::PythonCall.Py, k::String)
@ PythonCall C:\Users\zor_q\.julia\packages\PythonCall\qTEA1\src\abstract\object.jl:60
[4] getproperty(x::PythonCall.Py, k::Symbol)
@ PythonCall C:\Users\zor_q\.julia\packages\PythonCall\qTEA1\src\Py.jl:261
[5] (::PythonPlot.var"#9#10"{PythonCall.Py, PythonCall.Py, PythonCall.Py})(async::Timer)
@ PythonPlot C:\Users\zor_q\.julia\packages\PythonPlot\f591M\src\pygui.jl:199
[6] macro expansion
@ .\asyncevent.jl:281 [inlined]
[7] (::Base.var"#702#703"{PythonPlot.var"#9#10"{PythonCall.Py, PythonCall.Py, PythonCall.Py}, Timer})()
@ Base .\task.jl:134
Meanwhile, the while true block continues running. If it were a computation that came to an end at some point, all future plotting would fail (I assume because the background Python process is no longer running?).
Is this the expected behavior? I would have hoped that the execution of the while true block would have been interrupted and Python would have been left alone.
For comparison, when using GR, it's the while true block that gets interrupted:
julia> using Plots # default backend is GR
julia> plot(range(0, 1, 101).^2) # plot window pops up
julia> while true # surrogate for long computation that I decide I want to interrupt
5+2
sleep(0.1)
end
ERROR: InterruptException:
Stacktrace:
[1] poptask(W::Base.IntrusiveLinkedListSynchronized{Task})
@ Base .\task.jl:974
[2] wait()
@ Base .\task.jl:983
[3] wait(c::Base.GenericCondition{Base.Threads.SpinLock}; first::Bool)
@ Base .\condition.jl:130
[4] wait
@ .\condition.jl:125 [inlined]
[5] _trywait(t::Timer)
@ Base .\asyncevent.jl:138
[6] wait
@ .\asyncevent.jl:155 [inlined]
[7] sleep
@ .\asyncevent.jl:240 [inlined]
[8] top-level scope
@ .\REPL[3]:3
julia> plot(range(0, 1, 101).^2) # still plots successfully
julia> backend()
Plots.GRBackend()
- Lenguaje dominante
- Julia
- Estrellas
- 85
- Forks
- 9
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de JuliaPy/PythonPlot.jl
-
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
JuliaPy/PythonPlot.jl#55 · 3 comentarios ·
-
plots with missing and NaN dataAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
JuliaPy/PythonPlot.jl#54 ·
-
close(fig) broken for `subplots`Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
JuliaPy/PythonPlot.jl#53 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 35/100
JuliaPy/PythonPlot.jl#52 · 2 reacciones ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
JuliaPy/PythonPlot.jl#51 ·
Todos los issues de JuliaPy/PythonPlot.jl
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
CliMA/ClimaArtifacts#184 ·
-
In-place Vern7 stiffness estimate uses mismatched stage valuesPosiblemente ocupada @devmotion la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
SciML/OrdinaryDiffEq.jl#4778 ·
Los mantenedores suelen responder en 1 día
-
`pick_batchsize` spends ~1 µs constructing `BatchSizeSettings{B}(N)` with a run-time `B`Posiblemente ocupada @devmotion la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
JuliaDiff/ReverseDiff.jl#318 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100