Skip to content

Commit

Permalink
Fix linting issue, update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosbosse authored and seabbs committed Feb 26, 2024
1 parent 842feac commit 23b708e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
16 changes: 7 additions & 9 deletions R/validate.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,15 @@ as_forecast.default <- function(data,
}

# find forecast type
desired_forecast_type <- forecast_type
desired <- forecast_type
forecast_type <- get_forecast_type(data)

if (!is.null(desired_forecast_type)) {
if (forecast_type != desired_forecast_type) {
stop(
"Forecast type determined by scoringutils based on input: `",
forecast_type,
"`. Desired forecast type: `", desired_forecast_type, "`."
)
}
if (!is.null(desired) && desired != forecast_type) {
stop(
"Forecast type determined by scoringutils based on input: `",
forecast_type,
"`. Desired forecast type: `", desired, "`."
)
}

# construct class
Expand Down
6 changes: 6 additions & 0 deletions man/as_forecast.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 23b708e

Please sign in to comment.