eliocamp / metR

Tools for Easier Analysis of Meteorological Fields
https://eliocamp.github.io/metR/
139 stars 22 forks source link

Update metR for incoming ggplot2 version #185

Closed teunbrand closed 7 months ago

teunbrand commented 7 months ago

Hi Elio,

We have been preparing a new release of ggplot2 and during a reverse dependency check, it became apparent that the prospective ggplot2 3.5.0 would break metR.

In a sense, this PR is a follow-up on #177 in that it aims to make metR compatible with both the old an new versions of ggplot2. A few things of note:

To test the code changes with the release candidate, you can install it with the code below:

remotes::install_github("tidyverse/ggplot2", ref = remotes::github_pull("5592"))

The release of ggplot2 3.5.0 is scheduled for the 12th of February. The progress of the release can be tracked in https://github.com/tidyverse/ggplot2/issues/5588. We hope that this PR might help metR get out a fix if necessary.

eliocamp commented 7 months ago

Thank you! Looks good.

What is the best source to learn about the guide system? I had to fumble around the source code before and now that things are changing, I probably don't understand half of what's going on.

teunbrand commented 7 months ago

Yeah there still isn't good guide to guides. I suppose the Guides section of the ggproto documentation is the closest thing, which you can find here. There is also this WIP blog post that talks about it a little bit.

The currently tricky bit about the guides in metR is that they maintain compatibility with both old and new versions of ggplot2, so it is a bit of a Frankenstein's monster between the S3 and ggproto systems. If you at some point decide to bump the required version of ggplot2 to >= 3.5.0, you wouldn't have to deal with the S3 part anymore.

eliocamp commented 7 months ago

If you at some point decide to bump the required version of ggplot2 to >= 3.5.0, you wouldn't have to deal with the S3 part anymore.

Yes. What I actually need to do is to move all the ggplo2-extension stuff to another package and have that package follow ggplot2, while the other functionality can be agnostic to ggplot2 versions.

teunbrand commented 6 months ago

That makes sense to me. This is just friendly reminder that the release is due soon.

eliocamp commented 6 months ago

New version of metR is now on CRAN 🎉