Skip to content

Commit

Permalink
Add additional input check
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosbosse authored and seabbs committed Mar 25, 2024
1 parent 7da26e6 commit ea63d67
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/check-input-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ ensure_model_column <- function(data) {
#' If the number of quantiles or samples is the same for all forecasts, it
#' returns TRUE and a string with an error message otherwise.
#' @param forecast_unit Character vector denoting the unit of a single forecast.
#' @importFrom checkmate assert_subset
#' @inherit document_check_functions params return
#' @keywords internal_input_check
check_number_per_forecast <- function(data, forecast_unit) {
data <- ensure_data.table(data)
data <- na.omit(data)
assert_subset(forecast_unit, colnames(data))
# check whether there are the same number of quantiles, samples --------------
data[, scoringutils_InternalNumCheck := length(predicted), by = forecast_unit]
n <- unique(data$scoringutils_InternalNumCheck)
Expand Down

0 comments on commit ea63d67

Please sign in to comment.