status.check() fails with "duplicate 'row.names'" when a module appears twice in STATUS
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
Direzione di ricerca
Inizia leggendo status.check() e le funzioni status.start() e status.end() nel pacchetto PEcAn.utils per vedere come vengono scritti e letti i record STATUS. Aggiungi o esegui un test che ripeta una voce del modulo e verifichi il risultato sia per quel modulo sia per un modulo assente. Il lavoro è completato quando status.check() restituisce il valore di stato documentato senza fallire in presenza di record duplicati, usando il record più recente per il modulo richiesto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
PEcAn.utils::status.check() reads the STATUS file with read.table(row.names = 1). status.start() and status.end() only append to the file, so a module that is started twice (for example when a workflow is rerun in the same outdir without clearing STATUS) appears twice, and status.check() then stops with an error instead of returning 0, 1 or -1.
Reproduction (on develop)
library(PEcAn.utils)
f <- tempfile()
status.start("A", f); status.end("DONE", f)
status.start("A", f); status.end("ERROR", f)
status.check("A", f)
#> Error in read.table(...): duplicate 'row.names' are not allowed
status.check("B", f) # fails the same way: the error comes from reading the whole file
Impact
status.check() is called by do_conversions() (status.check(name) == 0) and by several workflow scripts and vignettes. The docs say the status functions should not produce errors of their own, and that status.check() returns 0, 1 or -1.
Proposed fix
Read the file without row.names, and use the most recent record for the requested module (STATUS is an append-only log). It also removes a no-op status_data[name, ] line. I have a branch ready with a small test that fails on develop and passes with the fix; happy to send a PR if wanted
- Lingua principale
- R
- Stelle
- 246
- Fork
- 322
- Merge medio
- 4g 15h
- PR unite (30g)
- 15
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PecanProject/pecan
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PecanProject/pecan#4255 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
doi_to_product_name() errors for an unknown DOI instead of reaching its "Unknown DOI" fallbackAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
PecanProject/pecan#4254 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Annual NetCDF merge writes values to the wrong ensemble members and timestepsForse già presa @ANAMASGARD l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
PecanProject/pecan#4251 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
data.land: prepare_pools fails to calculate woody biomass from TotLivBiom when AbvGrndWood is present without coarse rootsForse già presa @coder-Yash886 l’ha presa 4 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
PecanProject/pecan#4243 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PecanProject/pecan#4236 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di PecanProject/pecan
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
OHDSI/PhenotypeR#728 ·
-
DataSet inherits from DotNetWrapper but has no .NET pointer, so NetObject methods failForse già presa @PavelBal l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Open-Systems-Pharmacology/OSPSuite-R#2076 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
rfordatascience/tidytuesday#1105 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Huber-group-EMBL/remart#17 · 1 commento ·
-
teaching-followup
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
Openscapes/kyber#197 ·