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 #562: Reorganise/rename files #705

Merged
merged 14 commits into from
Mar 12, 2024
Merged

Issue #562: Reorganise/rename files #705

merged 14 commits into from
Mar 12, 2024

Conversation

nikosbosse
Copy link
Contributor

@nikosbosse nikosbosse commented Mar 8, 2024

Description

This PR closes #562

As discussed in #562, the current file structure doesn't always make a lot of sense. This PR is a first step towards addressing that. Specifically, it

  • moves the function get_coverage() to get_-functions.R and deletes the file add_coverage.R (+ adapts the tests accordingly)
  • Renames validate.R to as_forecast.R
  • moves the function get_forecast_counts() to get_-functions.R and deletes the existing available_forecasts.R (+ updates tests)
  • moves the print methods to a new file R/print.R (+ tests)
  • moves add_pairwise_comparison() from summarise_scores.R to R/pairwise-comparison.R (+ tests)

As Sam can testify, unrelated changes are my signature move. Alas, there is an unrelated change in this PR:
we (meaning I...) didn't update the docs when merging #692. So there also some updated .Rd files in here. Sorry!

Additional thoughts: We might want to split the get_-functions.R file into one file per function. By now, there are quite a few functions in there and maybe they deserve a nice home for themselves. I suggest addressing that + further changes in a different issue/PR (mostly so that I can continue developing without producing lots of merge conflicts)

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.

Copy link

codecov bot commented Mar 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.28%. Comparing base (3e434e4) to head (5b95366).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #705   +/-   ##
=======================================
  Coverage   95.28%   95.28%           
=======================================
  Files          21       21           
  Lines        1632     1632           
=======================================
  Hits         1555     1555           
  Misses         77       77           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Merge branch 'main' into reorganise-files

# Conflicts:
#	R/summarise_scores.R
#	tests/testthat/test-summarise_scores.R
Copy link
Contributor

@jamesmbaazam jamesmbaazam left a comment

Choose a reason for hiding this comment

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

Thanks, Nikos. This is looking good. Let me suggest a few "move-arounds" and let's engage.

  • validate_metrics() should be moved out of as_forecast.R. Maybe to metrics-validate.R?
  • as_forecast() should be renamed to forecast.R. Why? because that script is about creating <forecast> objects, coercing to <forecast>, and validating <forecast> objects. This will be similar to how score.R is structured. That script is currently quite long so we may want to move the validate_*() functions to validate.R
  • convenience-functions.R should probably be split up into 3 scripts, one for each function. Else, what's the difference between convenience-functions more broadly, and utils/helpers, etc?

@nikosbosse
Copy link
Contributor Author

nikosbosse commented Mar 11, 2024

Good suggestions! I did the first two now - how would you feel about addressing the other changes in a separate PR, along with the get_-functions?

@jamesmbaazam
Copy link
Contributor

Nice work, Nikos. I'm happy with the suggestion. LGTM.

@nikosbosse nikosbosse merged commit ce8720b into main Mar 12, 2024
11 checks passed
@nikosbosse nikosbosse deleted the reorganise-files branch March 12, 2024 09:16
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.

Rename/Reorganise files and functions
2 participants