Closed nikosbosse closed 5 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 95.37%. Comparing base (
1a51fa8
) to head (232a832
). Report is 4 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
As discussed in #750, it would be nice to have a way in
validate_forecast()
to check the type is exactly what you want.This PR therefore
forecast_type
argument invalidate_forecast()
, analogously to the one that already exists inas_forecast()
.assert_forecast_type()
that does exactly that, simplifying the code inas_forecast()
and minimising repetitive code invalidate_forecast()
. The rationale for the slightly odd design withactual
anddesired
is that that avoids runningget_forecast_type()
again in situations where the forecast type is already determined by the class of the object. An earlier version only had a single argumentforecast_type()
for the desired type and the actual type was determined automatically. This, however, presumes that validation works. I think both versions are fine if you have a preference 🤷Checklist
lintr::lint_package()
to check for style issues introduced by my changes.