Skip to content

Commit 4eec65c

Browse files
authored
Merge pull request #68 from ropensci/cran
updates for #59 cran re-submission
2 parents 5e7b266 + 7da9424 commit 4eec65c

19 files changed

+145
-124
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
13
on:
24
push:
3-
branches:
4-
- main
5+
branches: [main, master]
56
pull_request:
6-
branches:
7-
- main
87

9-
name: R-CMD-check
8+
name: R-CMD-check.yaml
109

11-
jobs:
10+
permissions: read-all
1211

12+
jobs:
1313
R-CMD-check:
14-
1514
runs-on: ${{ matrix.config.os }}
1615

1716
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
@@ -20,19 +19,17 @@ jobs:
2019
fail-fast: false
2120
matrix:
2221
config:
23-
- {os: macOS-latest, r: 'release'}
22+
- {os: macos-latest, r: 'release'}
2423
- {os: windows-latest, r: 'release'}
2524
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
2625
- {os: ubuntu-latest, r: 'release'}
2726
- {os: ubuntu-latest, r: 'oldrel-1'}
2827

2928
env:
30-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
31-
R_KEEP_PKG_SOURCE: yes
3229
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
30+
R_KEEP_PKG_SOURCE: yes
3331

3432
steps:
35-
3633
- uses: actions/checkout@v4
3734

3835
- uses: r-lib/actions/setup-pandoc@v2
@@ -49,3 +46,6 @@ jobs:
4946
needs: check
5047

5148
- uses: r-lib/actions/check-r-package@v2
49+
with:
50+
upload-snapshots: true
51+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
13
on:
24
push:
3-
branches:
4-
- main
5+
branches: [main, master]
56
pull_request:
6-
branches:
7-
- main
87

9-
name: test-coverage
8+
name: test-coverage.yaml
109

11-
jobs:
10+
permissions: read-all
1211

12+
jobs:
1313
test-coverage:
14-
15-
1614
runs-on: ubuntu-latest
17-
1815
env:
19-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
2016
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
2117

2218
steps:
23-
2419
- uses: actions/checkout@v4
2520

2621
- uses: r-lib/actions/setup-r@v2
@@ -29,9 +24,38 @@ jobs:
2924

3025
- uses: r-lib/actions/setup-r-dependencies@v2
3126
with:
32-
extra-packages: any::covr
27+
extra-packages: any::covr, any::xml2
3328
needs: coverage
3429

3530
- name: Test coverage
36-
run: covr::codecov()
31+
run: |
32+
cov <- covr::package_coverage(
33+
quiet = FALSE,
34+
clean = FALSE,
35+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
36+
)
37+
covr::to_cobertura(cov)
3738
shell: Rscript {0}
39+
40+
- uses: codecov/codecov-action@v4
41+
with:
42+
# Fail if error if not on PR, or if on PR and token is given
43+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
44+
file: ./cobertura.xml
45+
plugin: noop
46+
disable_search: true
47+
token: ${{ secrets.CODECOV_TOKEN }}
48+
49+
- name: Show testthat output
50+
if: always()
51+
run: |
52+
## --------------------------------------------------------------------
53+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
54+
shell: bash
55+
56+
- name: Upload test results
57+
if: failure()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: coverage-test-failures
61+
path: ${{ runner.temp }}/package

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: osmplotr
22
Title: Bespoke Images of 'OpenStreetMap' Data
3-
Version: 0.3.5.009
3+
Version: 0.3.5.018
44
Authors@R:
55
c(person(given = "Mark",
66
family = "Padgham",
@@ -48,4 +48,4 @@ VignetteBuilder:
4848
knitr
4949
Encoding: UTF-8
5050
LazyData: true
51-
RoxygenNote: 7.3.1
51+
RoxygenNote: 7.3.2

R/add-osm-surface.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@
6666
#' y = as.vector (t (array (y, dim = c (n, n)))),
6767
#' z = x * y
6868
#' )
69-
#' \dontrun{
7069
#' map <- osm_basemap (bbox = bbox, bg = "gray20")
7170
#' map <- add_osm_surface (map, dat_B, dat = dat, cols = heat.colors (30))
71+
#' \donttest{
7272
#' print_osm_map (map)
7373
#' }
7474
#'
@@ -77,7 +77,6 @@
7777
#' # 'dat':
7878
#' d <- sqrt ((dat$x - mean (dat$x))^2 + (dat$y - mean (dat$y))^2)
7979
#' dat <- dat [which (d < 0.01), ]
80-
#' \dontrun{
8180
#' map <- osm_basemap (bbox = bbox, bg = "gray20")
8281
#' map <- add_osm_surface (
8382
#' map,
@@ -86,6 +85,7 @@
8685
#' cols = heat.colors (30),
8786
#' bg = "gray40"
8887
#' )
88+
#' \donttest{
8989
#' print_osm_map (map)
9090
#' }
9191
#'
@@ -97,7 +97,6 @@
9797
#' # These data are also provided in
9898
#' dat_HP <- london$dat_HP
9999
#' cols <- adjust_colours (heat.colors (30), adj = -0.2) # darken by 20%
100-
#' \dontrun{
101100
#' map <- add_osm_surface (
102101
#' map,
103102
#' dat_HP,
@@ -106,14 +105,14 @@
106105
#' bg = "gray60",
107106
#' size = c (1.5, 0.5)
108107
#' )
108+
#' \donttest{
109109
#' print_osm_map (map)
110110
#' }
111111
#'
112112
#' # Adding multiple surfaces of either polygons or (lines/points) produces a
113113
#' # 'ggplot2' warning, and forces the colour gradient to revert to the last
114114
#' # given value.
115115
#' dat_T <- london$dat_T # trees
116-
#' \dontrun{
117116
#' map <- osm_basemap (bbox = bbox, bg = "gray20")
118117
#' map <- add_osm_surface (
119118
#' map,
@@ -139,11 +138,11 @@
139138
#' size = c (5, 2),
140139
#' shape = c (8, 1)
141140
#' )
141+
#' \donttest{
142142
#' print_osm_map (map) # 'dat_HP' is in 'topo.colors' not 'heat.colors'
143143
#' }
144144
#'
145145
#' # Add axes and colourbar
146-
#' \dontrun{
147146
#' map <- add_axes (map)
148147
#' map <- add_colourbar (
149148
#' map,
@@ -153,6 +152,7 @@
153152
#' barlength = c (0.6, 0.99),
154153
#' vertical = TRUE
155154
#' )
155+
#' \donttest{
156156
#' print_osm_map (map)
157157
#' }
158158
#' @family maps-with-data

R/connect-highways.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,18 @@
3131
#'
3232
#' @examples
3333
#' bbox <- get_bbox (c (-0.13, 51.5, -0.11, 51.52))
34-
#' \dontrun{
3534
#' highways <- c (
3635
#' "Monmouth.St", "Short.?s.Gardens", "Endell.St", "Long.Acre",
3736
#' "Upper.Saint.Martin"
3837
#' )
3938
#' # Note that dots signify "anything", including whitespace and apostrophes,
4039
#' # and that '?' denotes optional previous character and so here matches
4140
#' # both "Shorts Gardens" and "Short's Gardens"
41+
#' \dontrun{
4242
#' highways1 <- connect_highways (highways = highways, bbox = bbox, plot = TRUE)
4343
#' highways <- c ("Endell.St", "High.Holborn", "Drury.Lane", "Long.Acre")
4444
#' highways2 <- connect_highways (highways = highways, bbox = bbox, plot = TRUE)
45+
#' }
4546
#'
4647
#' # Use of 'connect_highways' to highlight a region on a map
4748
#' map <- osm_basemap (bbox = bbox, bg = "gray20")
@@ -50,6 +51,7 @@
5051
#' # bbox = bbox)
5152
#' # Those data are part of 'osmplotr':
5253
#' dat_BNR <- london$dat_BNR # Non-residential buildings
54+
#' \dontrun{
5355
#' groups <- list (highways1, highways2)
5456
#' map <- add_osm_groups (map,
5557
#' obj = dat_BNR, groups = groups,

R/extract-highways.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ abbreviate_hwy_names <- function (highway_names, nletters = 2) {
7171

7272
dl_hw_data <- function (highway_names, hw_abbrvs, bbox) {
7373

74-
cat ("Downloading OSM data ...\n")
74+
message ("Downloading OSM data ...")
7575
p4s <- NULL
7676
lens_old <- length (highway_names)
7777
lens <- 0

R/make-osm-map.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
#' dat <- make_osm_map (osm_data = london, structures = structs)
4343
#' # or download data automatically using a defined bounding boox
4444
#' bbox <- get_bbox (c (-0.15, 51.5, -0.10, 51.52))
45-
#' \dontrun{
4645
#' dat <- make_osm_map (bbox = bbox, structures = structs)
46+
#' \donttest{
4747
#' print_osm_map (dat$map)
4848
#' }
4949
#' @family construction
@@ -131,9 +131,9 @@ get_bbox_from_data <- function (osm_data) {
131131

132132
get_missing_osm_data <- function (osm_data, structures, bbox, dat_prefix) {
133133

134-
cat (
135-
"Downloading and extracting OSM data for",
136-
nrow (structures), "structures ...\n"
134+
message (
135+
"Downloading and extracting OSM data for ",
136+
nrow (structures), " structures ..."
137137
)
138138
pb <- txtProgressBar (max = 1, style = 3)
139139
t0 <- proc.time ()
@@ -163,7 +163,7 @@ get_missing_osm_data <- function (osm_data, structures, bbox, dat_prefix) {
163163
setTxtProgressBar (pb, i / nrow (structures))
164164
}
165165
close (pb)
166-
cat ("That took ", (proc.time () - t0) [3], "s\n", sep = "")
166+
message ("That took ", (proc.time () - t0) [3], "s\n", sep = "")
167167

168168
list ("indx" = indx, "osm_data" = osm_data)
169169
}

R/osm-structures.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
#' structures <- c ("highway", "park", "ameniiy", "tree")
2525
#' structs <- osm_structures (structures = structures, col_scheme = "light")
2626
#' # make_osm_map returns potentially modified list of data
27-
#' \dontrun{
2827
#' dat <- make_osm_map (osm_data = london, structures = structs)
2928
#' # map contains updated $osm_data and actual map in $map
29+
#' \donttest{
3030
#' print_osm_map (dat$map)
3131
#' }
3232
#' @family construction

R/print-osm-map.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#' Prints an OSM map produced with \code{osmplotr} to a specified graphics
44
#' device.
55
#'
6-
#' @param map The map to be printed; a \code{ggplot2} object produced by
6+
#' @param map The map to be printed; a \pkg{ggplot2} object produced by
77
#' \code{osmplotr}.
88
#' @param width Desired width of graphics device.
99
#' @param height Desired height of graphics device. Ignored if width specified.
@@ -12,6 +12,7 @@
1212
#' not explicitly provided).
1313
#' @param units Units for height and width of graphics device.
1414
#' @param dpi Resolution of graphics device (dots-per-inch).
15+
#' @return (Invisibly) the \pkg{ggplot2} map object.
1516
#'
1617
#' @seealso \code{\link{osm_basemap}}, \code{\link{add_osm_objects}},
1718
#' \code{\link{make_osm_map}}.
@@ -21,8 +22,9 @@
2122
#' map <- osm_basemap (bbox = bbox, bg = "gray20")
2223
#' map <- add_osm_objects (map, london$dat_BNR, col = "gray40")
2324
#' print_osm_map (map, width = 7) # prints to screen device
24-
#' \dontrun{
25+
#' \donttest{
2526
#' print_osm_map (map, file = "map.png", width = 500, units = "px")
27+
#' file.remove ("map.png")
2628
#' }
2729
#' @family construction
2830
#' @export

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"codeRepository": "https://github.com/ropensci/osmplotr",
99
"issueTracker": "https://github.com/ropensci/osmplotr/issues",
1010
"license": "https://spdx.org/licenses/GPL-3.0",
11-
"version": "0.3.5.009",
11+
"version": "0.3.5.018",
1212
"programmingLanguage": {
1313
"@type": "ComputerLanguage",
1414
"name": "R",

0 commit comments

Comments
 (0)