write.config.PEPRMT() errors when the event file has no supported events for the site
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
- 78/100
Direzione di ricerca
Inizia da write.config.PEPRMT() e segui come vengono filtrati e ordinati gli eventi supportati; l’issue indica questa funzione, ma non specifica alcun file sorgente né percorso di test. Riproduci il problema con un elenco di eventi contenente solo planting, poi aggiungi un test di regressione mirato e conferma che l’esecuzione produce lo stesso run_data.csv di un’esecuzione senza eventi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
write.config.PEPRMT() keeps only the supported event types (salinity, elevation) and then sorts the remaining events by date:
evt_order <- sapply(evts, \(x) x$date) |> as.Date() |> order()
If no supported event remains, evts is an empty list, sapply() returns list(), and as.Date(list()) stops with an error.
When this happens
- the site's
eventsarray is empty, or - every event is of a type PEPRMT does not use (for example only
planting). The events JSON is shared between models, so a file with only other models' events is a realistic input.
Reproduction (on develop)
Run write.config.PEPRMT() with run$inputs$event_json pointing at
[{"site_id": "S1", "events": [{"event_type": "planting", "date": "2020-01-02"}]}]
INFO Ignoring unsupported event types 'planting'. Supported event types are: 'salinity', 'elevation'
Error in as.Date.default(sapply(evts, function(x) x$date)) :
do not know how to convert 'sapply(evts, function(x) x$date)' to class "Date"
With no event input at all, or with a mix of supported and unsupported events, it works.
Proposed fix
Only sort when length(evts) > 0. The run then produces the same run_data.csv as a run with no events. I have a branch 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
-
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
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
PecanProject/pecan#4253 · 2 commenti ·
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 ·