Skip to content
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

Version 0.6.1 #202

Merged
merged 13 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tidyhydat
Title: Extract and Tidy Canadian 'Hydrometric' Data
Version: 0.6.0.9000
Version: 0.6.1
Authors@R: c(person("Sam", "Albers", email = "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-9270-7884")),
person("David", "Hutchinson", email = "[email protected]", role = "ctb"),
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# tidyhydat 0.6.1
- Add `...` to print methods so you can pass arguments all the way down.
- Add workaround for vroom#519 bug that prevents `realtime_*` fucntions from working
- Add workaround for vroom#519 bug that prevents `realtime_*` functions from working
- `realtime_ws` now returns the `Approval/Approbation` column as a character vector rather than a integer. ECCC is now putting non-integers in that column so this is a less strict formatting solution.

# tidyhydat 0.6.0
- Add capability to access ECCC webservice. The return of `realtime_ws`!
Expand Down
12 changes: 6 additions & 6 deletions R/realtime-webservice.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,10 @@

realtime_ws <- function(station_number, parameters = NULL,
start_date = Sys.Date() - 30, end_date = Sys.Date()) {
# if (length(station_number) >= 300) {
# stop("Only 300 stations are supported for one request. If more stations are required,
# a separate request should be issued to include the excess stations. This second request can
# be issued on the same token if it isn't required.")
# }
if (is_mac()) {
# temporary patch to work around vroom 1.6.4 bug
readr::local_edition(1)
}

if (is.null(parameters)) parameters <- c(46, 16, 52, 47, 8, 5, 41, 18)

Expand Down Expand Up @@ -146,7 +145,8 @@ realtime_ws <- function(station_number, parameters = NULL,
get_ws,
type = "text/csv",
encoding = "UTF-8",
col_types = "cTidcci")
col_types = "cTidccc"
)

## Check here to see if csv_df has any data in it
if (nrow(csv_df) == 0) {
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ knitr::opts_chunk$set(


<!-- badges: start -->
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/license/apache-2-0/) [![Coverage status](https://codecov.io/gh/ropensci/tidyhydat/branch/master/graph/badge.svg)](https://codecov.io/github/ropensci/tidyhydat?branch=master)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/license/apache-2-0/)ß
[![R build status](https://github.com/ropensci/tidyhydat/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/tidyhydat/actions)

[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/tidyhydat)](https://cran.r-project.org/package=tidyhydat) [![CRAN Downloads](https://cranlogs.r-pkg.org/badges/tidyhydat?color=brightgreen)](https://CRAN.R-project.org/package=tidyhydat) [![cran checks](https://badges.cranchecks.info/worst/tidyhydat.svg)](https://cran.r-project.org/web/checks/check_results_tidyhydat.html) [![r-universe](https://ropensci.r-universe.dev/badges/tidyhydat)](https://ropensci.r-universe.dev/builds)
Expand Down
82 changes: 39 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

<!-- badges: start -->

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/license/apache-2-0/)
[![Coverage
status](https://codecov.io/gh/ropensci/tidyhydat/branch/master/graph/badge.svg)](https://codecov.io/github/ropensci/tidyhydat?branch=master)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/license/apache-2-0/)ß
[![R build
status](https://github.com/ropensci/tidyhydat/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/tidyhydat/actions)

Expand Down Expand Up @@ -86,23 +84,24 @@ the same conventions discussed above. Using `realtime_dd()` we can
easily select specific stations by supplying a station of interest:

realtime_dd(station_number = "08MF005")
#> Queried on: 2023-04-04 12:54:46 (UTC)
#> Date range: 2023-03-05 to 2023-04-04
#> # A tibble: 17,118 × 8
#> STATION_NUMBER PROV_TE…¹ Date Param…² Value Grade Symbol Code
#> <chr> <chr> <dttm> <chr> <dbl> <chr> <chr> <chr>
#> 1 08MF005 BC 2023-03-05 08:00:00 Flow 571 <NA> <NA> 1
#> 2 08MF005 BC 2023-03-05 08:05:00 Flow 572 <NA> <NA> 1
#> 3 08MF005 BC 2023-03-05 08:10:00 Flow 571 <NA> <NA> 1
#> 4 08MF005 BC 2023-03-05 08:15:00 Flow 571 <NA> <NA> 1
#> 5 08MF005 BC 2023-03-05 08:20:00 Flow 571 <NA> <NA> 1
#> 6 08MF005 BC 2023-03-05 08:25:00 Flow 572 <NA> <NA> 1
#> 7 08MF005 BC 2023-03-05 08:30:00 Flow 572 <NA> <NA> 1
#> 8 08MF005 BC 2023-03-05 08:35:00 Flow 571 <NA> <NA> 1
#> 9 08MF005 BC 2023-03-05 08:40:00 Flow 572 <NA> <NA> 1
#> 10 08MF005 BC 2023-03-05 08:45:00 Flow 573 <NA> <NA> 1
#> # … with 17,108 more rows, and abbreviated variable names ¹​PROV_TERR_STATE_LOC,
#> # ²​Parameter
#> Queried on: 2024-01-09 05:08:33.18974 (UTC)
#> Date range: 2023-12-10 to 2024-01-09
#> # A tibble: 10,972 × 8
#> STATION_NUMBER PROV_TERR_STATE_LOC Date
#> <chr> <chr> <dttm>
#> 1 08MF005 BC 2023-12-10 08:00:00
#> 2 08MF005 BC 2023-12-10 08:05:00
#> 3 08MF005 BC 2023-12-10 08:10:00
#> 4 08MF005 BC 2023-12-10 08:15:00
#> 5 08MF005 BC 2023-12-10 08:20:00
#> 6 08MF005 BC 2023-12-10 08:25:00
#> 7 08MF005 BC 2023-12-10 08:30:00
#> 8 08MF005 BC 2023-12-10 08:35:00
#> 9 08MF005 BC 2023-12-10 08:40:00
#> 10 08MF005 BC 2023-12-10 08:45:00
#> # ℹ 10,962 more rows
#> # ℹ 5 more variables: Parameter <chr>, Value <dbl>,
#> # Grade <chr>, Symbol <chr>, Code <chr>

Or we can use `realtime_ws`:

Expand All @@ -112,27 +111,24 @@ Or we can use `realtime_ws`:
start_date = Sys.Date() - 14,
end_date = Sys.Date()
)
#> Warning: One or more parsing issues, call `problems()` on your data frame for details,
#> e.g.:
#> dat <- vroom(...)
#> problems(dat)
#> All station successfully retrieved
#> All parameters successfully retrieved
#> # A tibble: 4,384 × 10
#> STATIO…¹ Date Name_En Value Unit Grade Symbol Appro…² Param…³
#> <chr> <dttm> <chr> <dbl> <chr> <chr> <chr> <int> <dbl>
#> 1 08MF005 2023-03-21 00:00:00 Water … 5.06 °C -1 <NA> NA 5
#> 2 08MF005 2023-03-21 01:00:00 Water … 4.65 °C -1 <NA> NA 5
#> 3 08MF005 2023-03-21 02:00:00 Water … 4.63 °C -1 <NA> NA 5
#> 4 08MF005 2023-03-21 03:00:00 Water … 4.22 °C -1 <NA> NA 5
#> 5 08MF005 2023-03-21 04:00:00 Water … 4.4 °C -1 <NA> NA 5
#> 6 08MF005 2023-03-21 05:00:00 Water … 3.94 °C -1 <NA> NA 5
#> 7 08MF005 2023-03-21 06:00:00 Water … 4 °C -1 <NA> NA 5
#> 8 08MF005 2023-03-21 07:00:00 Water … 4 °C -1 <NA> NA 5
#> 9 08MF005 2023-03-21 08:00:00 Water … 3.76 °C -1 <NA> NA 5
#> 10 08MF005 2023-03-21 09:00:00 Water … 3.7 °C -1 <NA> NA 5
#> # … with 4,374 more rows, 1 more variable: Code <chr>, and abbreviated variable
#> # names ¹​STATION_NUMBER, ²​Approval, ³​Parameter
#> # A tibble: 1,323 × 10
#> STATION_NUMBER Date Name_En Value Unit
#> <chr> <dttm> <chr> <dbl> <chr>
#> 1 08MF005 2023-12-25 00:00:00 Water tem… 5.14 °C
#> 2 08MF005 2023-12-25 01:00:00 Water tem… 5.12 °C
#> 3 08MF005 2023-12-25 02:00:00 Water tem… 5.11 °C
#> 4 08MF005 2023-12-25 03:00:00 Water tem… 5.1 °C
#> 5 08MF005 2023-12-25 04:00:00 Water tem… 5.1 °C
#> 6 08MF005 2023-12-25 05:00:00 Water tem… 5.07 °C
#> 7 08MF005 2023-12-25 06:00:00 Water tem… 5.06 °C
#> 8 08MF005 2023-12-25 07:00:00 Water tem… 5.04 °C
#> 9 08MF005 2023-12-25 08:00:00 Water tem… 5.02 °C
#> 10 08MF005 2023-12-25 09:00:00 Water tem… 5 °C
#> # ℹ 1,313 more rows
#> # ℹ 5 more variables: Grade <chr>, Symbol <chr>,
#> # Approval <chr>, Parameter <dbl>, Code <chr>

## Compare realtime\_ws and realtime\_dd

Expand Down Expand Up @@ -195,12 +191,12 @@ By participating in this project you agree to abide by its terms.

Get citation information for `tidyhydat` in R by running:


To cite package 'tidyhydat' in publications use:

Albers S (2017). "tidyhydat: Extract and Tidy Canadian Hydrometric
Data." _The Journal of Open Source Software_, *2*(20).
doi:10.21105/joss.00511 <https://doi.org/10.21105/joss.00511>,
Albers S (2017). "tidyhydat: Extract and Tidy
Canadian Hydrometric Data." _The Journal of Open
Source Software_, *2*(20). doi:10.21105/joss.00511
<https://doi.org/10.21105/joss.00511>,
<http://dx.doi.org/10.21105/joss.00511>.

A BibTeX entry for LaTeX users is
Expand Down
3 changes: 2 additions & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ There were zero WARNINGS and zero ERRORS.

## NEWS
- Add `...` to print methods so you can pass arguments all the way down.
- Add workaround for vroom#519 bug that prevents `realtime_*` fucntions from working
- Add workaround for vroom#519 bug that prevents `realtime_*` functions from working
- `realtime_ws` now returns the `Approval/Approbation` column as a character vector rather than a integer. ECCC is now putting non-integers in that column so this is a less strict formatting solution.

## Test environments
* win-builder (via `devtools::check_win_devel()` and `devtools::check_win_release()`)
Expand Down
Loading