Skip to content

Commit f90bb10

Browse files
Merge pull request #140 from ropensci/dev
v0.7.1
2 parents cadb121 + 64ffd57 commit f90bb10

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+333
-8244
lines changed

DESCRIPTION

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: weathercan
22
Type: Package
33
Title: Download Weather Data from Environment and Climate Change Canada
4-
Version: 0.7.0
4+
Version: 0.7.1
55
Authors@R: c(
66
person("Steffi", "LaZerte", email = "[email protected]", role = c("aut","cre"), comment = c(ORCID = "0000-0002-7690-8360")),
77
person("Sam", "Albers", email = "[email protected]", role = c("ctb"), comment = c(ORCID = "0000-0002-9270-7884")),
@@ -54,4 +54,4 @@ Suggests:
5454
VignetteBuilder:
5555
knitr
5656
Encoding: UTF-8
57-
Config/testthat/edition: 3
57+
Config/testthat/edition: 3

NEWS.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# weathercan 0.7.1
2+
- `stations()` now uses the most recent version of the data even if it hasn't changed
3+
(prevent message regarding age of stations data frame).
4+
- Remove startup message about deprecated stations data frame
5+
- Move Mapping Article from docs to website (https://steffilazerte.ca/posts/weathercan-mapping/)
6+
17
# weathercan 0.7.0
28
- Internal updates to tests (testthat 3rd edition)
39
- Small changes to messages

R/stations.R

+8-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,14 @@ stations_read <- function() {
7878
if (file.exists(stations_file())) {
7979
local_file <- stations_file() %>%
8080
readr::read_rds()
81-
if(pkg_file$meta$ECCC_modified < local_file$meta$ECCC_modified) return(local_file)
82-
}
83-
pkg_file
81+
# If pkg version is newer than local, use pkg else use local
82+
if(pkg_file$meta$ECCC_modified > local_file$meta$ECCC_modified) {
83+
r <- pkg_file
84+
} else {
85+
r <- local_file
86+
}
87+
} else r <- pkg_file
88+
r
8489
}
8590

8691
stations_file <- function() {

R/weathercan-pkg.R

-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
.onAttach <- function(libname, pkgname) {
2-
packageStartupMessage(
3-
"weathercan v", utils::packageVersion("weathercan"), "\n",
4-
"The internal `stations` data has been ",
5-
"deprecated in favour of the function `stations()`.\n",
6-
"See ?stations for more details.")
7-
}
8-
91
#' Easy downloading of weather data from Environment and Climate Change Canada
102
#'
113
#' \code{weathercan} is an R package for simplifying the downloading of

README.Rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This package makes it easier to search for and download multiple months/years of
2828

2929
Bear in mind that these downloads can be fairly large and performing multiple downloads may use up ECCC's bandwidth unnecessarily. Try to stick to what you need.
3030

31-
For more details and tutorials checkout the [weathercan website](https://docs.ropensci.org/weathercan/)
31+
For more details and tutorials checkout the [weathercan website](https://docs.ropensci.org/weathercan/) (or see the [development docs](http://ropensci.github.io/weathercan/))
3232

3333
> Check out the Demo weathercan shiny dashboard ([html](https://steffilazerte.shinyapps.io/weathercan_shiny/); [source](https://github.com/steffilazerte/weathercan_shiny))
3434

README.md

+6-10
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ multiple downloads may use up ECCC’s bandwidth unnecessarily. Try to
2424
stick to what you need.
2525

2626
For more details and tutorials checkout the [weathercan
27-
website](https://docs.ropensci.org/weathercan/)
27+
website](https://docs.ropensci.org/weathercan/) (or see the [development
28+
docs](http://ropensci.github.io/weathercan/))
2829

2930
> Check out the Demo weathercan shiny dashboard
3031
> ([html](https://steffilazerte.shinyapps.io/weathercan_shiny/);
@@ -115,17 +116,12 @@ You can also search by proximity:
115116
stations_search(coords = c(50.667492, -120.329049), dist = 20, interval = "hour")
116117
```
117118

118-
## The legacy packages maptools, rgdal, and rgeos, underpinning this package
119-
## will retire shortly. Please refer to R-spatial evolution reports on
120-
## https://r-spatial.org/r/2023/05/15/evolution4.html for details.
121-
## This package is now running under evolution status 0
122-
123119
## # A tibble: 3 × 17
124120
## prov station_name station_id climate_id WMO_id TC_id lat lon elev tz interval start end normals normals_1981_2010 normals_1971_2000 distance
125121
## <chr> <chr> <dbl> <chr> <dbl> <chr> <dbl> <dbl> <dbl> <chr> <chr> <dbl> <dbl> <lgl> <lgl> <lgl> <dbl>
126-
## 1 BC KAMLOOPS A 1275 1163780 71887 YKA 50.7 -120. 345. Etc/GMT+8 hour 1953 2013 TRUE TRUE TRUE 8.64
127-
## 2 BC KAMLOOPS AUT 42203 1163842 71741 ZKA 50.7 -120. 345 Etc/GMT+8 hour 2006 2023 FALSE FALSE FALSE 8.64
128-
## 3 BC KAMLOOPS A 51423 1163781 71887 YKA 50.7 -120. 345. Etc/GMT+8 hour 2013 2023 FALSE FALSE FALSE 9.28
122+
## 1 BC KAMLOOPS A 1275 1163780 71887 YKA 50.7 -120. 345. Etc/GMT+8 hour 1953 2013 TRUE TRUE TRUE 8.61
123+
## 2 BC KAMLOOPS AUT 42203 1163842 71741 ZKA 50.7 -120. 345 Etc/GMT+8 hour 2006 2023 FALSE FALSE FALSE 8.61
124+
## 3 BC KAMLOOPS A 51423 1163781 71887 YKA 50.7 -120. 345. Etc/GMT+8 hour 2013 2023 FALSE FALSE FALSE 9.26
129125

130126
You can update this list of stations with
131127

@@ -152,7 +148,7 @@ stations_meta()
152148
## [1] "2023-01-24 23:30:00 UTC"
153149
##
154150
## $weathercan_modified
155-
## [1] "2023-07-21"
151+
## [1] "2023-09-20"
156152

157153
**Note:** For reproducibility, if you are using the stations list to
158154
gather your data, it can be a good idea to take note of the ECCC date of

data-raw/metadata.R

+5-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ h <- paste0("https://www.canada.ca/en/environment-climate-change/services/",
8787
"technical-documentation-climate-normals.html") %>%
8888
xml2::read_html()
8989

90-
glossary_normals <- tibble(ECCC_name = html_nodes(h, "h3") %>% html_text(),
90+
91+
ECCC_name <- html_nodes(h, "h3") %>% html_text() %>%
92+
str_subset("(Environment and Climate Change Canada)|(Government of Canada)", negate = TRUE)
93+
94+
glossary_normals <- tibble(ECCC_name,
9195
description = html_nodes(h, "h3+p") %>% html_text()) %>%
9296
filter(!str_detect(ECCC_name, "Thank you")) %>%
9397
mutate(weathercan_name =

data/codes.rda

0 Bytes
Binary file not shown.

data/flags.rda

-6 Bytes
Binary file not shown.

data/glossary.rda

7 Bytes
Binary file not shown.

data/glossary_normals.rda

-4 Bytes
Binary file not shown.

data/kamloops.rda

-32 Bytes
Binary file not shown.

inst/extdata/stations.rds

1 Byte
Binary file not shown.

pkgdown/extra.css

-60
This file was deleted.

release_script.R

+16-14
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ devtools::build_readme()
3636
# Check/update URLS
3737
urlchecker::url_check()
3838

39+
# Precompile Vignettes
40+
source("vignettes/precompile.R")
3941

4042

4143
## Checks
4244

43-
# Precompile Vignettes
44-
source("vignettes/precompile.R")
4545

4646
# Run WITH and WITHOUT internet
4747
#devtools::run_examples(run_donttest = TRUE)
@@ -53,6 +53,20 @@ devtools::check(remote = TRUE, manual = TRUE, run_dont_test = TRUE,
5353
devtools::check(remote = TRUE, manual = TRUE, run_dont_test = TRUE)
5454

5555

56+
## Update codemeta
57+
codemetar::write_codemeta()
58+
59+
## Build site (so website uses newest version)
60+
## Update website
61+
## BUILD PACKAGE FIRST!
62+
#pkgdown::build_articles(lazy = TRUE)
63+
# pkgdown::build_home()
64+
# pkgdown::build_news()
65+
# pkgdown::build_reference()
66+
#pkgdown::build_articles(lazy = FALSE)
67+
68+
pkgdown::build_site(lazy = FALSE)
69+
5670
## Once it is released create signed release on github
5771
usethis::use_github_release()
5872

@@ -125,19 +139,7 @@ rhub::check_for_cran(path = paste0("../weathercan_", version, ".tar.gz"),
125139
# Update cran-comments
126140

127141

128-
## Update codemeta
129-
codemetar::write_codemeta()
130-
131-
## Build site (so website uses newest version)
132-
## Update website
133-
## BUILD PACKAGE FIRST!
134-
#pkgdown::build_articles(lazy = TRUE)
135-
# pkgdown::build_home()
136-
# pkgdown::build_news()
137-
# pkgdown::build_reference()
138-
#pkgdown::build_articles(lazy = FALSE)
139142

140-
pkgdown::build_site(lazy = TRUE)
141143

142144

143145
## Push to github

0 commit comments

Comments
 (0)