-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from BirdStudiesCanada/sandbox
# naturecounts 0.2.0 * Clarified access in `nc_counts()` * Added extra event columns to `format_zero_fill()` * No funny dates in Databases and no warnings for data frames when missing `survey_year`, `survey_month` or `survey_day` in `format_dates()`
- Loading branch information
Showing
150 changed files
with
14,514 additions
and
2,723 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,6 @@ | |
^\.Rproj\.user$ | ||
^RELEASE.R$ | ||
^pkgdown$ | ||
^CODE_DESIGN.md$ | ||
^\.travis\.yml$ | ||
^appveyor\.yml$ |
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,10 @@ | ||
language: R | ||
cache: packages | ||
before_install: | ||
- sudo apt-get -y install libudunits2-dev gdal-bin libgdal1-dev libproj-dev | ||
env: | ||
global: | ||
secure: PpldXRYEeEjF0mmR3Kv04WJZiE3w7e48K2Bc5PkP/jK7rrqnswbrvNAe0nuchwEEd8ZruDnU0Ac5ptVOIXTLU2XJ8zF3ZAsIKHcSaGxoHG7Y33+vfcy3Zk4dor3bNC2pyTPCfdaoSU7rotcpmCWDPYBQMGZODBBPT5KkGO1e9vVrCPrTjR9WKORiIf1TkaiPLR4tgNHZFcvZ2yETIoFdyZ6Sjab/TMBrVHuNAK91L5yzgHrnyLl/jHd5Jscr6W+2JBUpQkpQeu8DI8MbHxFi5sMApLeVOMP5EYT5zXHccQJlOR0GpwcvDjAk0UnomyCjO5cLYjLWHItqsiMWkUX8fkQzIw8eQ1c/guLuUYlSVxYoJBsB8QNGI52U3HOCrNE5lPZyJkahc9vgYseClZJtRSUtN+EuQKYOUpiXPSSCu5V4P7zgp2zvfz5FKejYPlGzvtsYe4Yqd4d75nwqisKug9WcLt0ZoQi/v3Zr6e5O6g99yGlb+vUJwdjNLzo7xjWA5yz7pIuFzFyRBWUJKVWkFgggc7Mh856yWxFe6MtsmgF1Qz0TnBBRVl9cu4vKtFp0bNsas2Pe7uGCNbQwArRWXgGpmAjvNJ7FOZD0GZcMF0eoznbExdhq/CQXMcXKU8V4LCP6n80dKB03ID4iZFiYy2T2U4ahfwem0fT2ldOfK5Y= | ||
|
||
r_build_args: "--no-build-vignettes" | ||
r_check_args: "--no-build-vignettes --ignore-vignettes" |
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,39 @@ | ||
# naturecounts design principles | ||
|
||
## Fields returned by the API | ||
|
||
#### Desired behaviour | ||
Required and extra fields returned by the API are expected and treated, respectively, as follows: | ||
|
||
Function | API Entry Point | Required fields | Extra fields | ||
------------------ |-------------------------- | -------------------------- | ------------ | ||
`nc_count()` | `data/list_collections` | `collection`, `nrecords` | Ignored | ||
`nc_count()` | `data/list_permissions` | `collection`, `akn_level` | Ignored | ||
`nc_count()` | `metadata/collections` | `collection`, `akn_level` | Ignored | ||
`nc_permissions()` | `data/list_permissions` | `collection`, `akn_level` | Ignored | ||
`srv_auth()` | `data/authenticate` | `token` | Ignored | ||
`nc_data_dl()` | `data/release_request_id` | None (close request only) | Ignored | ||
`nc_data_dl()` | `data/get_data` | Any | Added | ||
`meta_XXX()` | `metadata/XXX` | Any | Added | ||
|
||
#### What will break the package | ||
- Missing "Required fields" | ||
- Missing/renamed "container" | ||
Some API entry points return data in a container, for example, | ||
|
||
- `data/get_data` -> `results` (holds main data) | ||
- `data/list_collections` -> `results` (holds counts); `request_id` (holds request id) | ||
- `data/list_requests` -> `requests` (holds details on individual requests) | ||
|
||
If these "containers" change names, the package will break. | ||
|
||
#### Coding Principles | ||
- In package, after accessing the API, explictly `select()` the fields/columns expected. This way extra fields won't break existing code | ||
- Missing fields **will** the code, but at least they will break the code early! | ||
- Do **not** do this for data downloads (i.e. `nc_single_dl()` under `nc_data_dl()`) or metadata downloads (i.e. `meta_XXX()`) | ||
- **Unless**, using a `meta_XXX()` download internally. Then always `select()` the fields required | ||
|
||
## Testing | ||
- Tests are run using the user "testuser" | ||
- Locally password can be stored in .Renviron as naturecounts_testuser = PASSWORD | ||
- For remote testing, password is supplied as encrypted values |
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,7 +1,7 @@ | ||
Package: naturecounts | ||
Type: Package | ||
Title: Access and download data on plant and animal populations from NatureCounts | ||
Version: 0.1.0 | ||
Version: 0.2.0 | ||
Authors@R: c( | ||
person("Steffi", "LaZerte", email = "[email protected]", role = "aut"), | ||
person("Denis", "LePage", email = "[email protected]", role = c("aut", "cre"))) | ||
|
@@ -16,24 +16,28 @@ Depends: | |
Imports: | ||
askpass (>= 1.1), | ||
DBI (>= 1.0.0), | ||
dbplyr (>= 1.4.4), | ||
dplyr (>= 0.7.8), | ||
httr (>= 1.4.0), | ||
jsonlite (>= 1.6), | ||
lubridate (>= 1.7.4), | ||
magrittr, | ||
purrr(>= 0.3.2), | ||
memoise (>= 1.1.0), | ||
purrr (>= 0.3.2), | ||
readr (>= 1.3.1), | ||
rlang (>= 0.1.2), | ||
RSQLite (>= 2.1.1), | ||
stringi (>= 1.2.4), | ||
stringr (>= 1.3.1), | ||
tidyr (>= 0.8.2) | ||
tidyr (>= 0.8.2), | ||
tidyselect (>= 1.0.0) | ||
Suggests: | ||
ggplot2, | ||
ggmap, | ||
here, | ||
knitr, | ||
mapview, | ||
rgeos, | ||
rnaturalearth, | ||
roxygen2, | ||
rmarkdown, | ||
|
@@ -42,6 +46,6 @@ Suggests: | |
testthat | ||
Language: en-US | ||
Roxygen: list(markdown = TRUE) | ||
RoxygenNote: 6.1.1 | ||
RoxygenNote: 7.1.1 | ||
URL: https://github.com/BirdStudiesCanada/naturecounts, https://naturecounts.ca | ||
VignetteBuilder: knitr |
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,3 +1,10 @@ | ||
# naturecounts 0.2.0 | ||
|
||
* Clarified access in `nc_counts()` | ||
* Added extra event columns to `format_zero_fill()` | ||
* No funny dates in Databases and no warnings for data frames when missing | ||
`survey_year`, `survey_month` or `survey_day` in `format_dates()` | ||
|
||
# naturecounts 0.1.0 | ||
|
||
* Initial package development |
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.