Skip to content

BOT: Fix #406: Rename get_type() to get_vector_type() and add convenience wrappers#1099

Draft
nikosbosse wants to merge 1 commit intomainfrom
fix/406-expose-get-type
Draft

BOT: Fix #406: Rename get_type() to get_vector_type() and add convenience wrappers#1099
nikosbosse wants to merge 1 commit intomainfrom
fix/406-expose-get-type

Conversation

@nikosbosse
Copy link
Collaborator

Summary

  • Renames the internal get_type() function to get_vector_type() and exports it, giving users access to the vector/matrix type detection utility
  • Adds get_observed_type() wrapper that extracts the observed column from a forecast object and returns its type
  • Adds get_predicted_type() wrapper that extracts the predicted column from a forecast object and returns its type
  • Updates all 3 internal call sites in R/metrics-sample.R to use the new name

Root 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

  • Existing get_type() tests updated to use get_vector_type() name (vectors, matrices, NA handling, consistency with old prediction_type())
  • New test: get_vector_type() is exported and accessible via scoringutils::
  • New test: get_observed_type() returns correct type for sample, binary, and discrete forecasts
  • New test: get_observed_type() errors on non-forecast objects
  • New test: get_predicted_type() returns correct type for sample, binary, and quantile forecasts
  • New test: get_predicted_type() errors on non-forecast objects
  • Full test suite passes (690 tests, 0 failures)
  • R CMD check: 0 errors, 0 warnings, 2 notes (pre-existing)

🤖 Generated with Claude Code

… get_observed_type() and get_predicted_type()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.83%. Comparing base (ac0c01a) to head (e3c73f2).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator Author

@nikosbosse nikosbosse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@nikosbosse nikosbosse marked this pull request as draft February 13, 2026 08:28
@nikosbosse nikosbosse changed the title Fix #406: Rename get_type() to get_vector_type() and add convenience wrappers BOT: Fix #406: Rename get_type() to get_vector_type() and add convenience wrappers Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maybe expose get_type().

1 participant

Comments