Issue #688 - Reorganise validate_forecast()#778
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #778 +/- ##
==========================================
+ Coverage 95.53% 95.60% +0.06%
==========================================
Files 21 21
Lines 1567 1569 +2
==========================================
+ Hits 1497 1500 +3
+ Misses 70 69 -1 ☔ View full report in Codecov by Sentry. |
seabbs
requested changes
Apr 4, 2024
Contributor
seabbs
left a comment
There was a problem hiding this comment.
I think I really like this. A few questions/comments
Contributor
I think if we rename it to be |
Collaborator
Author
|
Latest update:
|
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR closes #688.
This PR closes #689.
This PR closes #773.
In #688 and in particular in #753 we discussed the relationship between
validate_forecast()andas_forecast()and decided on the following:as_forecast()converts from a non-forecastobject to aforecastobject, validates it and returns the objectassert_forecast()re-validates an existingforecastobject and returnsinvisble(NULL)validate_forecast()is likeassert_forecast(), but returns the object so it can be used in a pipe.This PR
validate_forecast()toassert_forecast()and changed it to returninvisble(NULL)silentargument tovalidate_forecast()(that effectively prevents one single message from being thrown)silentargument, e.g. when printingvalidate_forecast()function that callsassert_forecast()and returns the datavalidate_general()toassert_forecast_generic()Further question:
Should
as_forecast()get asilentargument as well? We have quite a large number ofsuppressMessages()calls in our tests, which maybe is a hint...[Describe the changes that you made in this pull request.]
Checklist
lintr::lint_package()to check for style issues introduced by my changes.