`get_forecast_counts()`: misleading output with the default `by`, with type id columns in `by`, and for missing observations
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 57/100
Research direction
Start with R/get-forecast-counts.R and trace how get_forecast_counts() handles by, collapse, missing observed values, and the generated count column; then inspect the related plot_forecast_counts() behavior. Run the package tests covering forecast counts and plots, adding cases for each reported example. Done when the reported inputs return correct counts and plots give clear errors or build successfully.
Written by the indexing model from the issue text.
Description
CLAUDE: Several problems in get_forecast_counts() and plot_forecast_counts() (R/get-forecast-counts.R):
- Default
bygives a Cartesian product of impossible combinations.bydefaults to the whole forecast unit and the result is expanded over all unique values of every column, including nested (location,location_name) and derived (forecast_date,horizon,target_end_date) ones.cnt <- get_forecast_counts(example_quantile); nrow(cnt); table(cnt$count) #> 50688 #> 0 1 #> 49801 887plot_forecast_counts()then shows these rows as missing forecasts. Suggestion: do not zero-fill by default, or only fill over dimensions the user names. -
quantile_levelorsample_idinbyreturns only the first level, because the defaultcollapsestill collapses them:get_forecast_counts(example_quantile, by = c("model", "quantile_level"))returns 4 rows, all for level 0.01. Suggestion:collapse <- setdiff(collapse, by)or an error. - Forecasts whose
observedisNAare not counted (na.omiton all columns), i.e. the function under-counts exactly when availability is checked before the data arrive. Either only drop rows withNAinpredicted, or document this. The@param bytext also says the default includesquantile_level/sample_id, which it does not. - A user column named
countbreaks the function ("x has duplicated column name [count]"). -
plot_forecast_counts()gives raw data.table errors when thecountcolumn is missing, and a plot that fails at build time when aCountcolumn already exists.
Found during a full review of the package (version 2.3.0.9000, main at 779d7d68).
- Dominant language
- R
- Stars
- 67
- Forks
- 24
- Avg merge
- 1h 24m
- Merged PRs (30d)
- 2
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from epiforecasts/scoringutils
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
epiforecasts/scoringutils#1264 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
epiforecasts/scoringutils#1265 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
epiforecasts/scoringutils#1260 ·
Maintainers usually reply within 1 day
-
Incorrect guidance in `NEWS.md` re `add_relative_skill()`?Possibly taken @nikosbosse claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
epiforecasts/scoringutils#1226 · 1 comment · 2 reactions ·
Maintainers usually reply within 1 day
-
get_pit_histogram(): unsorted breaks produce negative densities; num_bins = 1 returns an empty tablePossibly taken @nikosbosse claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
epiforecasts/scoringutils#1219 ·
Maintainers usually reply within 1 day
All issues in epiforecasts/scoringutils
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
leppott/BioMonTools#162 ·
-
publications
Difficulty 1/5 Under an hour Newbie friendliness 85/100
epiforecasts/epiforecasts.github.io#161 ·
Maintainers usually reply within 1 day
-
Label `{sas}` chunk source as `sas` instead of `txt`, so it gets syntax highlightingPossibly taken @michaelmayer2 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
microbiome/OMA#1031 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ThinkR-open/golem#1265 ·