Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Re-allow creation of progressor in the global environment

Aperta
#99 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
20/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
r
Ambito
tooling

Direzione di ricerca

Partire dal punto di ingresso progressor() e riprodurre gli esempi dell’ambiente globale, inclusi i casi di slow_sum() descritti qui. L’issue non indica file o test, e la sua domanda irrisolta è se un progressor globale esistente possa essere terminato in sicurezza da un’altra funzione. Il lavoro sarebbe completato dopo aver stabilito questo comportamento e aver convalidato la decisione con test appropriati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

In the develop branch progressr (>= 0.7.0), the progressor() function must not be created in the global environment. This was necessary in order to be able to automatically inject an on.exit() call that terminates the progressor when exiting a function, local(), etc. This approach won't work in the global environment. Because of this, progressor() now produce an error if one attempts to call it from the global environment. This helps to protect against an incomplete/interrupted progressor from blocking all future progressors.

However, it might be possible to get around this too. First, I think this is only a problem when the global progress handler is enabled. So, if there is an active progressor in the global environment and we try to create another progressor() from the global environment, then we know that the previous one is no longer of interest and we could terminate that one before creating the new one, e.g.

p1 <- progressor(3)
p1() # incomplete
p1() # still incomplete

p2 <- progressor(4) # here can terminate p1()

EDIT 2021-02-28: The above is now is implemented for the next release (0.8.0).

This leaves the case where we try to use progress updates from another function, e.g.

p1 <- progressor(3)
p1() # incomplete
p1() # still incomplete

slow_sum(1:3)

In this case, the progressor created inside slow_sum() is not created in the global environment. How can we make sure it is ok to terminate p1() in this case? Can we distinguish this case from:

p1 <- progressor(3)
for (kk in 1:2) {
  p1()
  slow_sum(1:3)
}
p1() # complete here

?

I think the answer is: we can't.

I'll leave this issue open for a while to fully digest this idea. Maybe something else will come to me/us

Lingua principale
R
Stelle
299
Fork
11
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di futureverse/progressr

Tutte le issue di futureverse/progressr

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.