Skip to content

Conversation

@dajmcdon
Copy link
Contributor

Checklist

Please:

  • Make sure this PR is against "dev", not "main" (unless this is a release
    PR).
  • Request a review from one of the current main reviewers:
    brookslogan, nmdefries.
  • Makes sure to bump the version number in DESCRIPTION. 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
    1.7.2, then write your changes under the 1.8 heading).

Change explanations for reviewer

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

@dsweber2 dsweber2 force-pushed the autoplot-archive-selector branch from 3bfc32c to 33a735e Compare March 31, 2025 17:20
Copy link
Contributor

@dsweber2 dsweber2 left a comment

Choose a reason for hiding this comment

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

Some minor nits, and a potential bit of user annoyance.

dplyr::mutate(
.colours = switch(.color_by,
all_keys = interaction(!!!all_keys, sep = "/"),
all_keys = interaction(!!!all_keys, sep = " / "),
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these "/" to " / " conversions are for printing the titles in facets/colors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I thought the old version without the space was ugly.

#' )
autoplot.epi_archive <- function(object, ...,
.base_color = "black",
.versions = NULL,
Copy link
Contributor

Choose a reason for hiding this comment

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

It occurs to me that defaulting to daily could result in a large memory footprint for large datasets because of the construction of snapshots. maybe we should default to monthly for dates? I guess that means integer time_types will behave differently.

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 an ideal default would be "aggregate up one level", (so daily to weekly, weekly to monthly) but that's less clear and more overhead than this. I think it's easy enough for the user to change, and you might want to see every version if there aren't too many time_values.

@brookslogan
Copy link
Contributor

Thanks for handling review, @dsweber2. I'm going to place some wishlist items here, probably for future PRs.

  • autoplot(archive_cases_dv_subset_all_states)
    • Looks pretty good on my monitor, but takes a long time to render. We can improve epix_slide performance but it may only partially help if this is fully decompactifying. For sparse updates we should be able to limit the amount of plot data created.
    • We should add a demonstration in a vignette. Maybe as part of https://github.com/cmu-delphi/forecasting-team-meta/issues/29.
    • plotly::ggplotly seems to work nicely in combination with this; we should probably document that.
    • It'd be nice if plot forwarded to autoplot for epi_dfs and epi_archives.
  • autoplot(archive_cases_dv_subset) is good for showing the extrema of revisions, but not detailed revision patterns or reporting lag
    • ggplotly seems like the only full convenient resolution, with its zoom & hover-label features. But it seems to have even more performance issues.
    • I'm going to try to throw together a filter implementation to help get a closer look at certain geo_values but it's still not enough without .versions = etc.
    • Color scheme is not very good when going for a detailed look as nearby versions are hard to distinguish. But it's excellent for an overview.
    • It'd help to have something spelling out the plotted signal at the top of the plot; especially with the long wait times, it's easy to forget that this is just one (potentially-automatically-selected) signal of multiple.

dajmcdon and others added 5 commits March 31, 2025 13:23
Merge branch 'autoplot-archive-selector' of https://github.com/cmu-delphi/epiprocess into autoplot-archive-selector

# Conflicts:
#	R/autoplot.R
#	man/autoplot.epi_archive.Rd
@dajmcdon
Copy link
Contributor Author

dajmcdon commented Mar 31, 2025

@dshemetov One of the GHA processes is erroneously changing Roxygen autolinks. These should be written as [stats::median()] but they keep getting changed to `[stats::median()]`. That removes the link in the .Rd file.

@dshemetov
Copy link
Contributor

dshemetov commented Mar 31, 2025

Couple thoughts:

  • we could make those opt-in in this repo, like in epipredict @brookslogan do you have objections?
  • can you identify a commit with a change like that? I looked through a few of the styler/document ones above and couldn't catch that behavior, will help debug later

@brookslogan
Copy link
Contributor

brookslogan commented Mar 31, 2025

Auto-styling to manual styling... sure. I've also been annoyed by conflicting histories from auto-styling, though I guess the flip side is forgetting a style before merging and having styling commits belonging to an earlier PR leaking into other PR changelogs, or necessitating separate styling PRs. Maybe in the PR template we can include a step to run the manual styler before merging. (Manual style procedure might also simplify a transition to air if we want to do that?)

[`stats::median()`] should produce a link properly; are you sure you're not confusing it with that? Though I've also never noticed [a conversion to] this [format] happen automatically in the past.

@dsweber2
Copy link
Contributor

dsweber2 commented Apr 1, 2025

So I may be responsible for this. When I rebased, I thought dev had switched to `[stats::median()]`, so I used that instead. Sorry for the confusion

@dajmcdon
Copy link
Contributor Author

dajmcdon commented Apr 1, 2025

Ah! Not an action, just cross-purpose commits! Each time I went to push, I'd get a conflict message, then pull, then my links would be broken, so I assumed it was an action.

To get .Rd files to cross link to another function's documentation, you need to do either [pkg::fun()] (or in the current package, just [fun()]) or [`pkg::fun()`], but not `[pkg::fun()]`.

@dajmcdon dajmcdon merged commit 125098d into dev Apr 4, 2025
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.

Add epi_archive plotting (and animation?) functionality Should we implement autoplot for epi_archive?

5 participants