Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #981: Convert as_forecast_ to s3 #982

Merged
merged 3 commits into from
Jan 13, 2025
Merged

Issue #981: Convert as_forecast_ to s3 #982

merged 3 commits into from
Jan 13, 2025

Conversation

seabbs
Copy link
Contributor

@seabbs seabbs commented Jan 13, 2025

Description

This PR closes #981

Checklist

  • My PR is based on a package issue and I have explicitly linked it.
  • I have included the target issue or issues in the PR title as follows: issue-number: PR title
  • I have tested my changes locally.
  • I have added or updated unit tests where necessary.
  • I have updated the documentation if required.
  • I have built the package locally and run rebuilt docs using roxygen2.
  • My code follows the established coding standards and I have run lintr::lint_package() to check for style issues introduced by my changes.
  • I have added a news item linked to this PR.
  • I have reviewed CI checks for this PR and addressed them as far as I am able.

@seabbs seabbs requested review from nikosbosse and sbfnk January 13, 2025 16:17
@seabbs seabbs enabled auto-merge (squash) January 13, 2025 16:18
Copy link
Contributor

@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.

Nice! 2 thoughts:

  • as_forecast_binary is missing "default method", i.e. The input needs to be a data.frame or similar for the default method (it's a bit annoying that gh doesn't allow you to suggest changes for old code)
  • we could just make all methods .data.frame rather than default. My intuition is that would be cleaner, but not a hill I'm going to die on

@seabbs seabbs merged commit dbe5da6 into main Jan 13, 2025
9 checks passed
@seabbs seabbs deleted the seabbs/issue981 branch January 13, 2025 20:00
@nikosbosse
Copy link
Contributor

oh. Argh. That was an auto-merge branch :P

@nikosbosse
Copy link
Contributor

@seabbs
Copy link
Contributor Author

seabbs commented Jan 14, 2025

we could just make all methods .data.frame rather than default. My intuition is that would be cleaner, but not a hill I'm going to die on

I think you need a default method but yeah could update to have that dispatch to the data.frame method. IMO this would be its own PT as this was just making sure everything was the sabe i.e had a default method.

@seabbs
Copy link
Contributor Author

seabbs commented Jan 14, 2025

is missing "default method",

i.e. you mean docs for it? I think the docs are creaking a bit for these methods

@nikosbosse
Copy link
Contributor

i.e. you mean docs for it? I think the docs are creaking a bit for these methods

yeah just meant that for all other methods you added the clarifying words "default method", but not the binary function.

I think you need a default method but yeah could update to have that dispatch to the data.frame method. IMO this would be its own PT as this was just making sure everything was the sabe i.e had a default method.

I'll open an issue

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.

Most as_forecast_ functions are not s3 making it hard to build on them outside the package
2 participants