[Feature Request]: Improve reporting of qenv code

Aperta
#305 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
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
r
Ambito
backend

Direzione di ricerca

Read the issue's example using globals::globalsOf and the warning produced for subset(iris, Species == species). Start by identifying how qenv code is evaluated and how its environment is isolated; the issue names no files or tests, so locate those entry points in the repository. Done means missing variables or external dependencies are reported more accurately without gaining access to objects from unloaded packages through .GlobalEnv.

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

Descrizione

enhancement
Feature description

During #303 for #272 it was suggested to use globals package for finding issues with the code supplied.

Using code like this:

g2 <- globals::globalsOf(parsed_code, method = "conservative", mustExist = FALSE, envir = [email protected])
    missing <- globals::cleanup(g2, drop = c("nativesymbolinfo", "base-packages"))
    if (length(missing)) {
      warn <- warningCondition(
        message = sprintf(
          "When evaluating qenv code:\n%s\nMissing objects %s",
          parsed_code,
          toString(sQuote(names(missing), "'"))
        ),
        class = c("qenv.warn", "simpleWarning")
      )
      warning(warn, call. = FALSE)
    }

Lead to warnings like this on tests:

When evaluating qenv code:
i <- subset(iris, Species == species)
Missing objects 'Species', 'species'

There wasn't an optimal method that would find those variables that cannot be created. It would be great if there were a better way to find the missing variables or external dependencies than to evaluate the code with the .GlobalEnv as this provides access to objects from packages that are not loaded inside the qenv.

Code of Conduct
  • I agree to follow this project's Code of Conduct.
Contribution Guidelines
  • I agree to follow this project's Contribution Guidelines.
Security Policy
  • I agree to follow this project's Security Policy.
Lingua principale
R
Stelle
12
Fork
12
Merge medio
4g 22h
PR unite (30g)
3

Preparare l'ambiente

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 pharmaverse/teal.code

Tutte le issue di pharmaverse/teal.code

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.