-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reconcile chunk_limit and single_download_limit (#332)
* Set chunk_limit default to single_download_limit * Also have check_chunk_limit return the chunk limit to avoid repeated calls to bcdc_single_download_limit. * Use check_chunk_limit in paginated requests * document * Fix check_chunk_limit * Don't use a default * Return chunk_limit early if chunk_value is NULL * Deprecate bcdata.single_download_limit option * wrapper function to consult the option and warn once per session if it is set. * Use check_chunk_limit throughout to be more efficient in checking both options * Update documentation * Document, update NEWS * Update to testthat edition 3 * Test changes to bcdata.single_download_limit option, use snapshot test * Update tests for testthat 3e * remove context() * update expect_is() to expect_s3_class() and expect_type() * Unset BCDC_KEY so doesn't affect message snapshot * Update R/bcdc_options.R Co-authored-by: Stephanie Hazlitt <[email protected]> * Update R/bcdc_options.R Co-authored-by: Stephanie Hazlitt <[email protected]> * Update R/bcdc_options.R Co-authored-by: Stephanie Hazlitt <[email protected]> * document * Comments for clarity and future cleanup --------- Co-authored-by: Stephanie Hazlitt <[email protected]>
- Loading branch information
1 parent
8a9aeda
commit 64ebee4
Showing
29 changed files
with
239 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,12 @@ | ||
# Copyright 2019 Province of British Columbia | ||
# This file is part of the standard setup for testthat. | ||
# It is recommended that you do not modify it. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and limitations under the License. | ||
# Where should you do additional test configuration? | ||
# Learn more about the roles of various files in: | ||
# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview | ||
# * https://testthat.r-lib.org/articles/special-files.html | ||
|
||
library(testthat) | ||
library(bcdata) | ||
|
||
if (require("testthat", quietly = TRUE)) { | ||
library(bcdata) | ||
library(sf) | ||
test_check("bcdata") | ||
} | ||
test_check("bcdata") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# bcdata.single_download_limit is deprecated but works | ||
|
||
Code | ||
bcdc_query_geodata(record = "76b1b7a3-2112-4444-857a-afccf7b20da8") | ||
Condition | ||
Warning: | ||
The bcdata.single_download_limit option is deprecated. Please use bcdata.chunk_limit instead. | ||
Output | ||
Querying 'bc-airports' record | ||
* Using collect() on this object will return 455 features and 41 fields | ||
* Accessing this record requires pagination and will make 455 separate | ||
* requests to the WFS. See ?bcdc_options | ||
* At most six rows of the record are printed here | ||
-------------------------------------------------------------------------------- | ||
Simple feature collection with 6 features and 41 fields | ||
Geometry type: POINT | ||
Dimension: XY | ||
Bounding box: xmin: 833323.9 ymin: 381604.1 xmax: 1198292 ymax: 1054950 | ||
Projected CRS: NAD83 / BC Albers | ||
# A tibble: 6 x 42 | ||
id CUSTODIAN_ORG_DESCRI~1 BUSINESS_CATEGORY_CL~2 BUSINESS_CATEGORY_DE~3 | ||
<chr> <chr> <chr> <chr> | ||
1 WHSE_IMA~ "Ministry of Forest, ~ airTransportation Air Transportation | ||
2 WHSE_IMA~ "Ministry of Forest, ~ airTransportation Air Transportation | ||
3 WHSE_IMA~ "Ministry of Forest, ~ airTransportation Air Transportation | ||
4 WHSE_IMA~ "Ministry of Forest, ~ airTransportation Air Transportation | ||
5 WHSE_IMA~ "Ministry of Forest, ~ airTransportation Air Transportation | ||
6 WHSE_IMA~ "Ministry of Forest, ~ airTransportation Air Transportation | ||
# i abbreviated names: 1: CUSTODIAN_ORG_DESCRIPTION, | ||
# 2: BUSINESS_CATEGORY_CLASS, 3: BUSINESS_CATEGORY_DESCRIPTION | ||
# i 38 more variables: OCCUPANT_TYPE_DESCRIPTION <chr>, SOURCE_DATA_ID <chr>, | ||
# SUPPLIED_SOURCE_ID_IND <chr>, AIRPORT_NAME <chr>, DESCRIPTION <chr>, | ||
# PHYSICAL_ADDRESS <chr>, ALIAS_ADDRESS <chr>, STREET_ADDRESS <chr>, | ||
# POSTAL_CODE <chr>, LOCALITY <chr>, CONTACT_PHONE <chr>, | ||
# CONTACT_EMAIL <chr>, CONTACT_FAX <chr>, WEBSITE_URL <chr>, ... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.