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

fix: update for compatibility with epiprocess==0.9.0 #386

Merged
merged 3 commits into from
Sep 27, 2024

Conversation

dshemetov
Copy link
Contributor

@dshemetov dshemetov commented Sep 26, 2024

Checklist

Please:

  • Make sure this PR is against "dev", not "main".
  • Request a review from one of the current epipredict main reviewers:
    dajmcdon.
  • Make sure to bump the version number in DESCRIPTION and NEWS.md.
    Always increment the patch version number (the third number), unless you are
    making a release PR from dev to main, in which case increment the minor
    version number (the second number).
  • Describe changes made in NEWS.md, making sure breaking changes
    (backwards-incompatible changes to the documented interface) are noted.
    Collect the changes under the next release number (e.g. if you are on
    0.7.2, then write your changes under the 0.8 heading).
  • Consider pinning the epiprocess version in the DESCRIPTION file if
    • You anticipate breaking changes in epiprocess soon
    • You want to co-develop features in epipredict and epiprocess

Change explanations for reviewer

Updating for epiprocess changes here cmu-delphi/epiprocess#477.

The main changes are:

  • epi_df metadata reconstruction needed to change somewhat - we no longer allow duplicate time_values per epi_key group and we make this check in the constructor, so it no longer works to just do as_epi_df(result) and append the metadata. But the fix is simple as_epi_df(result, as_of = old_meta$as_of, other_keys = old_meta$other_keys).
    • removed some remaining bits of additional_metadata = list(other_keys = ...) in epi_df constructors
    • other_keys can no longer be NULL in epi_df constructors, so a few %||% character() addins
  • we changed key_colnames in epiprocess to return geo_value, other_keys, time_value (since that makes the most sense when grouping and ordering epi_dfs), so I propagated the change to the key_colnames here as much as I could.
  • epi_slide argument renames (dot prefixes) and converting from before/after to window_size/align
  • reran the canada grad student dataset because its other_keys was still stored in the additional_metadata list

Magic GitHub syntax to mark associated Issue(s) as resolved when this is merged into the default branch

  • Resolves #{issue number}

@dshemetov dshemetov requested a review from dajmcdon as a code owner September 26, 2024 19:48
@dshemetov dshemetov force-pushed the ds/epiprocess-0.9.0 branch 2 times, most recently from 42397bf to 93f4140 Compare September 27, 2024 01:19
Copy link
Contributor

@dajmcdon dajmcdon left a comment

Choose a reason for hiding this comment

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

The main things are the change in the ordering of the keys. Is there a reason for this? Preference? Were they changed on the relevant epiprocess branch?

DESCRIPTION Outdated Show resolved Hide resolved
@@ -95,7 +95,7 @@ epi_recipe.epi_df <-
keys <- key_colnames(x) # we know x is an epi_df

var_info <- tibble(variable = vars)
key_roles <- c("geo_value", "time_value", rep("key", length(keys) - 2))
key_roles <- c("geo_value", rep("key", length(keys) - 2), "time_value")
Copy link
Contributor

Choose a reason for hiding this comment

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

Trying to keep these in the same order as https://github.com/cmu-delphi/epiprocess/blob/16f38b2b386522f7f8f4880157432a3fa4a8d6ae/R/epi_df.R#L168.

Does this break something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is updated in our upcoming epiprocess PR. If this line isn't changed then the wrong columns are associated with the wrong roles.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. Is there a reason for that choice? I think the previous ordering was based on a Slack vote that @brookslogan took a while back? I can't seem to find it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the Slack vote asked for people's preference for the order to add arguments to a function, not how they want to order their epi_df.

Copy link
Contributor

Choose a reason for hiding this comment

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

(Right, and this was about API data-fetching functions, rather than epiprocess ones. In arrange_canonical I think we just borrowed this vote without doing another one... and I do wonder about my polling methodology anyway.)

R/key_colnames.R Show resolved Hide resolved
R/key_colnames.R Show resolved Hide resolved
R/step_epi_slide.R Show resolved Hide resolved
R/step_epi_slide.R Outdated Show resolved Hide resolved
vignettes/articles/sliding.Rmd Outdated Show resolved Hide resolved
vignettes/articles/sliding.Rmd Outdated Show resolved Hide resolved
vignettes/articles/sliding.Rmd Outdated Show resolved Hide resolved
R/utils-misc.R Show resolved Hide resolved
@dshemetov dshemetov requested a review from dajmcdon September 27, 2024 17:47
vignettes/articles/sliding.Rmd Outdated Show resolved Hide resolved
R/key_colnames.R Show resolved Hide resolved
R/key_colnames.R Show resolved Hide resolved
@dajmcdon
Copy link
Contributor

I'm approving, subject to resolving the remaining bits.

@dajmcdon dajmcdon mentioned this pull request Sep 27, 2024
5 tasks
@dshemetov
Copy link
Contributor Author

Did a hotfix to the date validation code in layer_forecast_date and layer_target_date for now, but I can handle this better in another PR #390.

@dshemetov dshemetov merged commit 34cb6ed into dev Sep 27, 2024
2 checks passed
@dshemetov dshemetov deleted the ds/epiprocess-0.9.0 branch September 28, 2024 17:45
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.

3 participants