Skip to content

Commit

Permalink
Merge pull request #384 from DOI-USGS/380
Browse files Browse the repository at this point in the history
CRAN release changes and further fiz for #380
  • Loading branch information
dblodgett-usgs authored May 10, 2024
2 parents 469a4d6 + 78e079f commit b0cd256
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ cran-comments.md
CRAN-SUBMISSION
temp.R
revdep
docs/*demo*
9 changes: 2 additions & 7 deletions DISCLAIMER.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
Disclaimer
==========

This information is preliminary or provisional and is subject to revision. It is being provided to meet the need for timely best science. The information has not received final approval by the U.S. Geological Survey (USGS) and is provided on the condition that neither the USGS nor the U.S. Government shall be held liable for any damages resulting from the authorized or unauthorized use of the information.
This software has been approved for release by the U.S. Geological Survey (USGS). Although the software has been subjected to rigorous review, the USGS reserves the right to update the software as needed pursuant to further analysis and review. No warranty, expressed or implied, is made by the USGS or the U.S. Government as to the functionality of the software and related material nor shall the fact of release constitute any such warranty. Furthermore, the software is released on condition that neither the USGS nor the U.S. Government shall be held liable for any damages resulting from its authorized or unauthorized use.

From: https://www.usgs.gov/office-of-science-quality-and-integrity/fundamental-science-practices#5
From: https://www2.usgs.gov/fsp/fsp_disclaimers.asp#5

This software is in the public domain because it contains materials that originally came from the U.S. Geological Survey, an agency of the United States Department of Interior. For more information, see the [official USGS copyright policy](https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits "official USGS copyright policy")

Although this software program has been used by the USGS, no warranty, expressed or implied, is made by the USGS or the U.S. Government as to the accuracy and functioning of the program and related program material nor shall the fact of distribution constitute any such warranty, and no responsibility is assumed by the USGS in connection therewith.
This software is provided "AS IS."


2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ for more.
- Removed deprecated function `get_huc12` and `get_huc8`
- Updated documentation of `get_huc()` and other web service functions.
- added `nhdplusTools_cache_settings()` to control use of a `memoise` cache. #366
- fix minor bug related to binding nhdplushr data together. #380


nhdplusTools 1.0.0
==========
Expand Down
17 changes: 16 additions & 1 deletion R/downloading_tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,24 @@ download_nhd_internal <- function(bucket, file_list_snip, prefix, nhd_dir, hu_li
if(download_files & !dir.exists(gsub(".zip", ".gdb", out_file)) &
!(length(gdb_in_dir) > 0 && !dir.exists(gdb_in_dir))) {

if(file.exists(out_file)) {
unlink(out_file)
}

httr::RETRY("GET", url, httr::write_disk(out_file), httr::progress())

zip::unzip(out_file, exdir = out[length(out)])
tryCatch({zip::unzip(out_file, exdir = out[length(out)])},
error = function(e) {
warning("error unzipping with zip::unzip \n",
out_file, "\n", e, "\ntrying a different way", immediate. = TRUE)
files <- try(utils::unzip(out_file, exdir = out[length(out)]))
if(!inherits(files, "try-error")) {
warning("Success with utils::unzip", immediate. = TRUE)
} else {
warning("unzip of\n", out_file,
"\nfailed with utils and zip packages.\n",
"Try manually unzipping?", immediate. = TRUE)}
})

unlink(out_file)
} else if(!download_files) {
Expand Down
2 changes: 2 additions & 0 deletions R/get_vaa.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ download_vaa <- function(path = get_vaa_path(updated_network), force = FALSE, up
#' @importFrom utils read.delim
#' @export
#' @examples
#' \donttest{
#' get_characteristics_metadata()
#' }
get_characteristics_metadata <- function(search, cache = TRUE) {

out <- tryCatch({
Expand Down
39 changes: 39 additions & 0 deletions code.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
[
{
"name": "nhdplusTools",
"organization": "U.S. Geological Survey",
"description": "Tools for Using NHDPlus Data",
"version": "v1.1.0",
"status": "Production",
"permissions": {
"usageType": "openSource",
"licenses": [
{
"name": "Public Domain, CC0-1.0",
"URL": "https://code.usgs.gov/water/nhdplusTools/-/raw/v1.1.0/LICENSE.md"
}
]
},
"homepageURL": "https://code.usgs.gov/water/nhdplusTools/",
"downloadURL": "https://code.usgs.gov/water/nhdplusTools/-/archive/v1.1.0/nhdplustools-v1.1.0.zip",
"disclaimerURL": "https://code.usgs.gov/water/nhdplusTools/-/raw/v1.1.0/DISCLAIMER.md",
"repositoryURL": "https://code.usgs.gov/water/nhdplusTools.git",
"vcs": "git",
"laborHours": 1700,
"tags": [
"R",
"nhdplus",
"USGS",
"water",
"v0.6.2"
],
"languages": [
"R"
],
"contact": {
"name": "David Blodgett",
"email": "[email protected]"
},
"date": {
"metadataLastUpdated": "2024-05-09"
}
},
{
"name": "nhdplusTools",
"organization": "U.S. Geological Survey",
Expand Down
2 changes: 2 additions & 0 deletions man/get_characteristics_metadata.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b0cd256

Please sign in to comment.