Skip to content

Commit

Permalink
Version 1.0.3 Release Candidate
Browse files Browse the repository at this point in the history
Added better checks for time input.  Added _pkgdown to improve how the References are displayed.
  • Loading branch information
rmendels committed Jun 7, 2023
1 parent b5de651 commit bff25e2
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 11 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Expand Up @@ -3,6 +3,7 @@
.travis.yml
README.Rmd
README.md
_pkgdown.yml
appveyor.yml
Makefile
cran-comments.md
Expand Down
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
@@ -1,3 +1,3 @@
Version: 1.0.1
Date: 2022-12-11 16:47:03 UTC
SHA: 4aeb758c4163058461a701b5888180d67b4a3e94
Version: 1.0.2
Date: 2023-02-07 16:16:42 UTC
SHA: b5de651f0186ddfbee6a2f33387b2c07093d348e
4 changes: 2 additions & 2 deletions DESCRIPTION
Expand Up @@ -5,8 +5,8 @@ Description: General purpose R client for 'ERDDAP' servers. Includes
'datasets', and fetch 'datasets', in either 'csv' or 'netCDF' format.
'ERDDAP' information:
<https://upwell.pfeg.noaa.gov/erddap/information.html>.
Version: 1.0.2
Date: 2023-02-08
Version: 1.0.3
Date: 2023-06-09
License: MIT + file LICENSE
Authors@R: c(
person("Scott", "Chamberlain", role = "aut"),
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
@@ -1,3 +1,8 @@
rerddap 1.0.3
=============
This version provides exta checks on time bounds.


rerddap 1.0.2
=============
Ensure '[' and ']' properly encoded in URL
Expand Down
30 changes: 30 additions & 0 deletions R/grid.R
Expand Up @@ -25,6 +25,9 @@ griddap <- function(datasetx, ..., fields = 'all', stride = 1, fmt = "nc",
if (attr(x, "type") != "griddap")
stop("datasetid '", attr(x, "datasetid"), "' not of type griddap")
check_dims(dimargs, x)
if (!is.null(dimargs$time)) {
check_time_range(dimargs, x)
}
check_lat_text(dimargs)
check_lon_text(dimargs)
dimargs <- fix_dims(dimargs, .info = x)
Expand Down Expand Up @@ -128,6 +131,12 @@ field_handler <- function(x, y){
}

check_dims <- function(dimargs, .info) {
if (any(lengths(dimargs )!= 2)) {
print("All coordinate bounds must be of length 2, even if same value")
print("Present values are:")
print(dimargs)
stop("rerddap halted", call. = FALSE)
}
if (!all(names(dimargs) %in% dimvars(.info))) {
stop(sprintf("Some input dimensions (%s) don't match those in dataset (%s)",
paste0(names(dimargs), collapse = ", "),
Expand Down Expand Up @@ -169,6 +178,27 @@ is_lat_text <- function(dimargs) {
}
}

check_time_range <- function(dimargs, x) {
# if(!class(dimargs$time) == 'character'){
if(!is.character(dimargs$time)){
print('time must be given as character strings')
print('you are passing ', paste0(class(dimargs$time)))
stop('rerddap halted', call. = FALSE)
}
global <- x$alldata$NC_GLOBAL
tt <- global[ global$attribute_name %in%c('time_coverage_end','time_coverage_start'), "value", ]
tt <- rev(tt)
if((dimargs$time[1] < tt[1]) | (dimargs$time[2] > tt[2])) {
print('time bounds are out of range')
print('You gave: ')
print(dimargs$time)
print("Dataset times are: ")
print(tt)
stop('rerddap halted', call. = FALSE)
}
}


check_lon_data_range <- function(dimargs, .info) {
if (!is.null(dimargs$longitude)) {
val <- .info$alldata$longitude[ .info$alldata$longitude$attribute_name == "actual_range", "value"]
Expand Down
77 changes: 77 additions & 0 deletions _pkgdown.yml
@@ -0,0 +1,77 @@
reference:
- title: rerddap Package Description
contents:
- rerddap-package

- title: Search
desc: >
Functions to search for ERDDAP servers as well as to search
ERDDAP for datasets whose metadata match the given search.
contents:
- ed_search
- ed_search_adv
- global_search
- servers

- title: Obtain basic dataset metadata

desc: >
Obtain the basic dataset metadata to help in subsetting and downloading.
contents:
- info
- browse


- title: Subset and Download Data

desc: >
Functions to subset and download ERDDAP grids and tables.
contents:
- griddap
- tabledap

- title: Optional Settings for Data Download

desc: >
Optional settings for functions that subset and download ERDDAP grids and tables.
contents:
- disk
- eurl
- memory

- title: Cache Handling

desc: >
Functions for dealing with 'rerddap' cache.
contents:
- cache_delete
- cache_delete_all
- cache_details
- cache_info
- cache_list
- cache_setup

- title: Various ERDDAP Based Utilities

desc: >
Various ERDDAP based utilities for converting parameters.
contents:
- convert_time
- convert_units
- fipscounty
- key_words
- version

- title: Datasets

desc: >
Datasets used in the the functions nd vignette.
contents:
- colors
- institutions
- ioos_categories
- keywords
- longnames
- standardnames
- variablenames

6 changes: 3 additions & 3 deletions codemeta.json
Expand Up @@ -8,13 +8,13 @@
"codeRepository": "https://github.com/ropensci/rerddap",
"issueTracker": "https://github.com/ropensci/rerddap/issues",
"license": "https://spdx.org/licenses/MIT",
"version": "1.0.1",
"version": "1.0.3",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.2.2 (2022-10-31)",
"runtimePlatform": "R version 4.3.0 (2023-04-21)",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down Expand Up @@ -207,7 +207,7 @@
"applicationCategory": "Climate",
"isPartOf": "https://ropensci.org",
"keywords": ["earth", "science", "climate", "precipitation", "temperature", "storm", "buoy", "NOAA", "rstats", "erddap", "noaa-data", "api-client", "r", "r-package"],
"fileSize": "3003.519KB",
"fileSize": "3004.714KB",
"releaseNotes": "https://github.com/ropensci/rerddap/blob/master/NEWS.md",
"readme": "https://github.com/ropensci/rerddap/blob/master/README.md",
"contIntegration": ["https://github.com/ropensci/rerddap/actions", "https://codecov.io/github/ropensci/rerddap?branch=master"]
Expand Down
5 changes: 2 additions & 3 deletions cran-comments.md
@@ -1,6 +1,6 @@
## Test environments

* local macOS install, R 4.2.2
* local macOS install, R 4.3.0
* rhub (devtools::check_rhub())
* macOS Builder (devtools::check_mac_release())
* win-builder (devel and release - devtools::check_win_*())
Expand All @@ -12,11 +12,10 @@ OK from all checks
## Reverse dependencies

* I am maintainer of plotdap and rerddapXracto - they check out
* The maintainer of PAMmisc tested new version wih no problem

---

This version adds extra guarantees that cacheing behaves properly
This version provides exta checks on time bounds.

Thanks!
Roy Mendelssohn

0 comments on commit bff25e2

Please sign in to comment.