Skip to content

prevent margin from changing the unit class when subclassing #3177

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

Merged
merged 1 commit into from
Mar 7, 2019

Conversation

thomasp85
Copy link
Member

I've uncovered another "bad" assumption in ggplot2's handling of units. The margin constructor will drop any unit subclasses when subclassing the unit it creates. This PR fixes it and makes it work with the experimental unit implementation in thomasp85/grid#1 in a back-compatible way

@thomasp85 thomasp85 requested a review from clauswilke March 6, 2019 13:24
@yutannihilation
Copy link
Member

yutannihilation commented Mar 7, 2019

Travis says (https://api.travis-ci.org/v3/job/502563012/log.txt):

* checking for future file timestamps ... WARNING
unable to verify current time

This warning comes from here:

                now <- tryCatch({
                    foo <- readLines("http://worldclockapi.com/api/json/utc/now",
                                     warn = FALSE)
                    as.POSIXct(gsub(".*\"currentDateTime\":\"([^Z]*).*", "\\1", foo),
                               "UTC", "%Y-%m-%dT%H:%M")
                }, error = function(e) NA)
                if (is.na(now)) {
                    any <- TRUE
                    warningLog(Log, "unable to verify current time")

But this seems unlikely to success... Probably we can ignore.

readLines("http://worldclockapi.com/api/json/utc/now",
                                     warn = FALSE)
#> Warning in file(con, "r"): cannot open URL 'http://worldclockapi.com/api/
#> json/utc/now': HTTP status was '403 Forbidden'
#> Error in file(con, "r"): cannot open the connection to 'http://worldclockapi.com/api/json/utc/now'

Created on 2019-03-07 by the reprex package (v0.2.1.9000)

@yutannihilation
Copy link
Member

I restarted the job. Let's see what will happen. If this consistently fails, it seems better to set _R_CHECK_SYSTEM_CLOCK_ to false.

c.f. https://twitter.com/krlmlr/status/1084496032187199488

@thomasp85
Copy link
Member Author

@yutannihilation this is due to upstream problems, not something in ggplot2

@thomasp85 thomasp85 merged commit 1d5a535 into tidyverse:master Mar 7, 2019
@yutannihilation
Copy link
Member

@thomasp85 Yeah, could you approve #3179?

@lock
Copy link

lock bot commented Sep 3, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Sep 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants