BOT: Fix #406: Rename get_type() to get_vector_type() and add convenience wrappers#1099
Draft
nikosbosse wants to merge 1 commit intomainfrom
Draft
BOT: Fix #406: Rename get_type() to get_vector_type() and add convenience wrappers#1099nikosbosse wants to merge 1 commit intomainfrom
nikosbosse wants to merge 1 commit intomainfrom
Conversation
… get_observed_type() and get_predicted_type() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1099 +/- ##
=======================================
Coverage 97.83% 97.83%
=======================================
Files 35 35
Lines 1845 1849 +4
=======================================
+ Hits 1805 1809 +4
Misses 40 40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
nikosbosse
commented
Feb 13, 2026
Collaborator
Author
nikosbosse
left a comment
There was a problem hiding this comment.
CLAUDE: Clean, well-scoped rename of internal get_type() to exported get_vector_type() plus two thin convenience wrappers (get_observed_type, get_predicted_type). No logic changes to the core function body. All 3 internal call sites in metrics-sample.R correctly updated. No remaining references to old name. Both wrappers properly validate input via assert_forecast(). Comprehensive test coverage with 12 test blocks covering all specs. R CMD check clean. Verdict: APPROVE.
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.
Summary
get_type()function toget_vector_type()and exports it, giving users access to the vector/matrix type detection utilityget_observed_type()wrapper that extracts theobservedcolumn from a forecast object and returns its typeget_predicted_type()wrapper that extracts thepredictedcolumn from a forecast object and returns its typeR/metrics-sample.Rto use the new nameRoot cause:
get_type()was a useful utility function marked as internal (@keywords internal), with no user-facing way to determine the type of observed or predicted values in a forecast object.Closes #406
Test plan
get_type()tests updated to useget_vector_type()name (vectors, matrices, NA handling, consistency with oldprediction_type())get_vector_type()is exported and accessible viascoringutils::get_observed_type()returns correct type for sample, binary, and discrete forecastsget_observed_type()errors on non-forecast objectsget_predicted_type()returns correct type for sample, binary, and quantile forecastsget_predicted_type()errors on non-forecast objects🤖 Generated with Claude Code