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

Parameterize key query fields in riem_measures() #48

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ee51f9e
Parameterize 'data' field in riem_measures()
JElchison Dec 16, 2024
e95c3ec
Add comment linking field documentation
JElchison Dec 16, 2024
2f6a39c
Parameterize 'elev' field in riem_measures()
JElchison Dec 16, 2024
695875d
Parameterize 'latlon' field in riem_measures()
JElchison Dec 16, 2024
ca212f2
Parameterize 'report_type' field in riem_measures(); Skip HFMETAR by …
JElchison Dec 16, 2024
2a5f27e
Choose a safer default date_start
JElchison Dec 16, 2024
3c358b4
Speficy nometa = no, since parsing counts on column names
JElchison Dec 16, 2024
60d8c28
Update self-documentation for riem_measures()
JElchison Dec 16, 2024
d5a7f4c
Update test fixtures files since default endpoint query changed
JElchison Dec 16, 2024
8737611
Document
JElchison Dec 16, 2024
1c8a136
Preserve order of riem_measures() positional arguments; Remove defaul…
JElchison Dec 17, 2024
a75b5b9
Specify the now-required station srgument in test-measures.R
JElchison Dec 17, 2024
3b082f0
Correct copy/paste error
JElchison Dec 17, 2024
12aeea5
Specify the now-required date_start argument in test-measures.R
JElchison Dec 17, 2024
540fb46
Add call to rlang::check_dots_empty() in riem_measures()
JElchison Dec 17, 2024
fe048f4
Add better validation for new riem_measures() args
JElchison Dec 17, 2024
b14e790
Specify the now-required station srgument in test-measures.R
JElchison Dec 17, 2024
3b8bc96
Correct order of args in documentation
JElchison Dec 17, 2024
ae205a3
refactor: use `rlang::is_character()`
maelle Dec 19, 2024
2f0c7f9
refactor: make report_type's input more readable
maelle Dec 19, 2024
b3c5dd4
test: add test for new parameters
maelle Dec 19, 2024
115a373
Address lintr warnings
JElchison Dec 19, 2024
045b229
Add new tests; Address lintr warnings
JElchison Dec 19, 2024
780b9e3
fix: remove duplicate import
maelle Dec 20, 2024
ceddc25
docs: improve documentation of `report_type`
maelle Dec 20, 2024
54b0ac5
refactor: remove unnecessary lambda
maelle Dec 20, 2024
cc05590
docs: update NEWS.md
maelle Dec 20, 2024
6b8995b
formatting
maelle Dec 20, 2024
6202c2f
latlon
maelle Dec 20, 2024
bc561e2
docs: clarify report
maelle Dec 20, 2024
4cc6e72
refactor: validate data
maelle Dec 20, 2024
06db10d
Permit new 'data' arg validation to accept multiple fields (and add a…
JElchison Dec 20, 2024
e28c762
Update param documentation to contain default values; Correct report_…
JElchison Dec 20, 2024
25a0092
Address lintr warnings
JElchison Dec 20, 2024
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
Prev Previous commit
Next Next commit
Address lintr warnings
  • Loading branch information
JElchison committed Dec 19, 2024
commit 115a3734eed6c468e6d3ac901fddfa76ec834634
12 changes: 4 additions & 8 deletions R/measures.R
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ riem_measures <- function(
elev = FALSE,
latlon = TRUE,
report_type = NULL) {
if (!rlang::is_character(station, n = 1)) {
if (!rlang::is_character(station, n = 1L)) {
cli::cli_abort("{.arg station} must be a string.")
}
date_start <- format_and_check_date(date_start, "date_start")
@@ -86,7 +86,7 @@ riem_measures <- function(
if (date_end < date_start) {
cli::cli_abort("{.arg date_end} must be bigger than {.arg date_start}.")
}
if (!rlang::is_character(data, n = 1)) {
if (!rlang::is_character(data, n = 1L)) {
cli::cli_abort("{.arg data} must be a string.")
}
if (!is.logical(elev)) {
@@ -104,12 +104,8 @@ riem_measures <- function(
multiple = TRUE
)
report_type <- purrr::map_int(
report_type, \(x) switch(
x, # nolint: fixed_regex_linter
hfmetar = 1L,
routine = 3L,
specials = 4L
)
report_type,
\(x) switch(x, hfmetar = 1L, routine = 3L, specials = 4L) # nolint: unnecessary_lambda_linter
)
report_type <- paste(report_type, collapse = ",")