Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhsparks committed Feb 1, 2022
2 parents 8669aa2 + 44f423e commit 31b57c9
Show file tree
Hide file tree
Showing 17 changed files with 147 additions and 142 deletions.
26 changes: 20 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: nasapower
Type: Package
Title: NASA POWER API Client
Version: 4.0.3.1
Version: 4.0.4
Authors@R:
c(person(given = "Adam H.",
family = "Sparks",
Expand All @@ -14,33 +14,47 @@ Authors@R:
email = "[email protected]",
comment = c(ORCID = "0000-0003-1444-9135",
"Scott Chamberlain reviewed nasapower for rOpenSci, see
https://github.com/ropensci/software-review/issues/155")
<https://github.com/ropensci/software-review/issues/155>.")
),
person(given = "Hazel",
family = "Kavili",
role = "rev",
comment = "Hazel Kavili reviewed nasapower for rOpenSci, see
https://github.com/ropensci/software-review/issues/155"),
<https://github.com/ropensci/software-review/issues/155>."),
person(given = "Alison",
family = "Boyer",
role = "rev",
comment = "Alison Boyer reviewed nasapower for rOpenSci, see
https://github.com/ropensci/software-review/issues/155"),
<https://github.com/ropensci/software-review/issues/155>."),
person(given = "Fernando",
family = "Miguez",
role = "ctb",
email = "[email protected]",
comment = c(ORCID = "0000-0002-4627-8329",
"Fernando Miguez provided assistance in identifying
improper missing value handling in the POWER data, see
<https://github.com/femiguez/apsimx/pull/26>")),
<https://github.com/femiguez/apsimx/pull/26>.")),
person(given = "Maëlle",
family = "Salmon",
role = "ctb",
comment = c(ORCID = "0000-0002-2815-0399",
"Maëlle Salmon contributed a patch to fix issues with
using the R package, 'vcr', for testing the 'API'
queries, see
https://github.com/ropensci/nasapower/pull/64.")))
<https://github.com/ropensci/nasapower/pull/64>.")),
person(given = "Phillip D.",
family = "Alderman",
role = "ctb",
email = "[email protected]",
comment = c(ORCID = "0000-0003-1467-2337",
"Phillip Alderman contributed a patch to fix an issue
with, 'The `file` argument of `vroom()` must use `I()`
for literal data as of vroom 1.5.0.', see
https://github.com/ropensci/nasapower/pull/67.")),
person(given = "Western Australia Agriculture Authority (WAAA)",
role = "cph",
comment = c("Supported the development of nasapower through Adam H.
Sparks' time.")))
URL: https://docs.ropensci.org/nasapower/
BugReports: https://github.com/ropensci/nasapower/issues
Description: Client for 'NASA' 'POWER' global meteorology, surface solar
Expand Down
8 changes: 6 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# nasapower 4.0.3.1
# nasapower 4.0.4

* Uses new version numbering for development version. The POWER server won't accept the useragent string if it's too long.
## Bug fixes

* Fixes message when importing data using _vroom_ >= 1.5.0, `The `file` argument of `vroom()` must use `I()` for literal data as of vroom 1.5.0.`. Thanks to @palderman for the fix in [Pull Request 67](https://github.com/ropensci/nasapower/pull/67).

## Minor changes

* Sets minimum version of _tibble_ necessary for use with _nasapower_.

Expand Down
4 changes: 2 additions & 2 deletions R/get_power.R
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ get_power <- function(community,
response$raise_for_status()

# create meta object
power_data <- readr::read_lines(response$parse("UTF8"))
power_data <- readr::read_lines(I(response$parse("UTF8")))

meta <- power_data[c(grep("-BEGIN HEADER-",
power_data):grep("-END HEADER-",
Expand All @@ -340,7 +340,7 @@ get_power <- function(community,

# create tibble object
power_data <- readr::read_csv(
response$parse("UTF8"),
I(response$parse("UTF8")),
col_types = readr::cols(),
na = c("-999", "-999.00", "-999.0", "-99", "-99.00", "-99.0"),
skip = length(meta) + 2
Expand Down
3 changes: 2 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ output: github_document
# _nasapower_: NASA POWER API Client <img align='right' src='man/figures/logo.png'>

<!-- badges: start -->

[![tic](https://github.com/ropensci/nasapower/workflows/tic/badge.svg?branch=main)](https://github.com/ropensci/nasapower/actions)
[![codecov](https://codecov.io/gh/ropensci/nasapower/branch/master/graph/badge.svg?token=Kq9aea0TQN)](https://codecov.io/gh/ropensci/nasapower)
[![codecov](https://codecov.io/gh/ropensci/nasapower/branch/master/graph/badge.svg?token=Kq9aea0TQN)](https://app.codecov.io/gh/ropensci/nasapower)
[![DOI](https://zenodo.org/badge/109224461.svg)](https://zenodo.org/badge/latestdoi/109224461)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![peer-review](https://badges.ropensci.org/155_status.svg)](https://github.com/ropensci/software-review/issues/155)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- badges: start -->

[![tic](https://github.com/ropensci/nasapower/workflows/tic/badge.svg?branch=main)](https://github.com/ropensci/nasapower/actions)
[![codecov](https://codecov.io/gh/ropensci/nasapower/branch/master/graph/badge.svg?token=Kq9aea0TQN)](https://codecov.io/gh/ropensci/nasapower)
[![codecov](https://codecov.io/gh/ropensci/nasapower/branch/master/graph/badge.svg?token=Kq9aea0TQN)](https://app.codecov.io/gh/ropensci/nasapower)
[![DOI](https://zenodo.org/badge/109224461.svg)](https://zenodo.org/badge/latestdoi/109224461)
[![Project Status: Active – The project has reached a stable, usable
state and is being actively
Expand Down
25 changes: 20 additions & 5 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"codeRepository": "https://github.com/ropensci/nasapower",
"issueTracker": "https://github.com/ropensci/nasapower/issues",
"license": "https://spdx.org/licenses/MIT",
"version": "4.0.3.9000",
"version": "4.0.4",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand All @@ -34,13 +34,27 @@
"@type": "Person",
"givenName": "Fernando",
"familyName": "Miguez",
"email": "[email protected]",
"@id": "https://orcid.org/0000-0002-4627-8329"
},
{
"@type": "Person",
"givenName": "Maëlle",
"familyName": "Salmon",
"@id": "https://orcid.org/0000-0002-2815-0399"
},
{
"@type": "Person",
"givenName": "Phillip D.",
"familyName": "Alderman",
"email": "[email protected]",
"@id": "https://orcid.org/0000-0003-1467-2337"
}
],
"copyrightHolder": [
{
"@type": "Organization",
"name": "Western Australia Agriculture Authority (WAAA)"
}
],
"maintainer": [
Expand Down Expand Up @@ -210,8 +224,8 @@
},
"applicationCategory": "Tools",
"isPartOf": "https://ropensci.org",
"keywords": ["NASA", "meteorological-data", "weather", "global", "weather", "weather-data", "meteorology", "NASA-POWER", "agroclimatology", "earth-science", "data-access", "climate-data"],
"fileSize": "365.409KB",
"keywords": ["NASA", "meteorological-data", "weather", "global", "weather-data", "meteorology", "NASA-POWER", "agroclimatology", "earth-science", "data-access", "climate-data", "r", "nasa-power", "nasa", "agroclimatology-data", "weather-variables", "rstats", "r-package"],
"fileSize": "366.733KB",
"citation": [
{
"@type": "ScholarlyArticle",
Expand Down Expand Up @@ -251,14 +265,15 @@
"name": "{nasapower}: NASA-POWER Data from R",
"identifier": "10.5281/zenodo.1040727",
"url": "https://CRAN.R-project.org/package=nasapower",
"description": "R package version 4.0.3.9000",
"description": "R package version 4.0.4",
"@id": "https://doi.org/10.5281/zenodo.1040727",
"sameAs": "https://doi.org/10.5281/zenodo.1040727"
}
],
"relatedLink": ["https://docs.ropensci.org/nasapower/", "https://CRAN.R-project.org/package=nasapower"],
"releaseNotes": "https://github.com/ropensci/nasapower/blob/master/NEWS.md",
"contIntegration": ["https://github.com/ropensci/nasapower/actions", "https://app.codecov.io/gh/ropensci/nasapower"],
"readme": "https://github.com/ropensci/nasapower/blob/main/README.md",
"contIntegration": ["https://github.com/ropensci/nasapower/actions", "https://codecov.io/gh/ropensci/nasapower"],
"developmentStatus": "https://www.repostatus.org/#active",
"review": {
"@type": "Review",
Expand Down
8 changes: 2 additions & 6 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# nasapower v4.0.3

This submission supersedes v4.0.2, which should not be released to CRAN due to issues in the tests.
This submission skips all tests requiring API connectivity on CRAN fixing this issue introduced with 4.0.2.
Sorry for the inconvenience, but I thought this was better to submit a new(er) version rather than causing failures on CRAN servers.
# nasapower v4.0.4

## Test environments
* local macOS, Platform: aarch64-apple-darwin20 (64-bit), R 4.1.2
* win-builder, R Under development (unstable) (2021-12-17 r81389 ucrt)
* win-builder, R Under development (unstable) (2022-01-31 r81608 ucrt)
* win-builder, R 4.1.2

## R CMD check results
Expand Down
3 changes: 2 additions & 1 deletion inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ROxygen
Rdata
SFC
Standardise
WAAA
WS
YYYY
acknowledgement
Expand Down Expand Up @@ -53,6 +54,6 @@ ropensci
sb
terra
tibble
useragent
vcr
vroom
zzz
12 changes: 7 additions & 5 deletions man/nasapower-package.Rd

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

11 changes: 6 additions & 5 deletions revdep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@

|field |value |
|:--------|:------------------------------------|
|version |R version 4.1.2 (2021-11-01) |
|os |macOS Monterey 12.0.1 |
|version |R version 4.1.0 (2021-05-18) |
|os |macOS 12.2 |
|system |x86_64, darwin17.0 |
|ui |RStudio |
|language |(EN) |
|collate |en_AU.UTF-8 |
|ctype |en_AU.UTF-8 |
|tz |Australia/Perth |
|date |2021-12-12 |
|date |2022-02-01 |
|rstudio |2021.09.0+351 Ghost Orchid (desktop) |
|pandoc |2.13 @ /usr/local/bin/pandoc |
|pandoc |2.14.0.1 @ /usr/local/bin/pandoc |

# Dependencies

|package |old |new |Δ |
|:---------|:-----|:-----|:--|
|nasapower |4.0.1 |4.0.2 |* |
|nasapower |4.0.3 |4.0.4 |* |
|readr |NA |2.1.1 |* |

# Revdeps

2 changes: 1 addition & 1 deletion tests/fixtures/API_failure.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
http_interactions:
- request:
method: get
uri: https://power.larc.nasa.gov/api/temporal/daily/point?parameters=T2M&community=ag&start=19830101&end=19830101&longitude=-179.5&latitude=-89.5&format=csv&time_standard=utc&user=nasapower4031
uri: https://power.larc.nasa.gov/api/temporal/daily/point?parameters=T2M&community=ag&start=19830101&end=19830101&longitude=-179.5&latitude=-89.5&format=csv&time_standard=utc&user=nasapower404
body:
encoding: ''
string: ''
Expand Down
19 changes: 10 additions & 9 deletions tests/fixtures/adjusted_air_pressure.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
http_interactions:
- request:
method: get
uri: https://power.larc.nasa.gov/api/temporal/daily/point?parameters=T2M%2CT2M_MIN%2CT2M_MAX%2CRH2M%2CWS10M%2CPS&community=ag&start=19830101&end=19830101&longitude=-179.5&latitude=-89.5&format=csv&time_standard=utc&user=nasapower4031
uri: https://power.larc.nasa.gov/api/temporal/daily/point?parameters=T2M%2CT2M_MIN%2CT2M_MAX%2CRH2M%2CWS10M%2CPS&community=ag&start=19830101&end=19830101&longitude=-179.5&latitude=-89.5&format=csv&time_standard=utc&user=nasapower404
body:
encoding: ''
string: ''
Expand All @@ -18,20 +18,21 @@ http_interactions:
status: HTTP/1.1 200 OK
content-type: text/csv
content-length: '473'
x-ratelimit-remaining-minute: '59'
connection: close
x-ratelimit-remaining-minute: '56'
x-ratelimit-limit-minute: '60'
ratelimit-remaining: '59'
ratelimit-remaining: '56'
ratelimit-limit: '60'
ratelimit-reset: '59'
date: Tue, 01 Feb 2022 01:13:58 GMT
ratelimit-reset: '1'
date: Tue, 01 Feb 2022 08:02:55 GMT
server: uvicorn
content-disposition: attachment; filename=POWER_Point_Daily_19830101_19830101_89d50S_179d50W_LST.csv
x-archive-time: '2.158'
x-archive-time: '2.54'
x-process-time: '0.03'
x-objects-time: '0.008'
x-objects-time: '0.006'
content-encoding: gzip
vary: Accept-Encoding
x-service-time: '2.198'
x-service-time: '2.578'
x-app-version: v2.2.17
content-language: en-US
strict-transport-security: max-age=31536000;includeSubDomains;preload
Expand All @@ -51,5 +52,5 @@ http_interactions:
(C) \r\nRH2M MERRA-2 Relative Humidity at 2 Meters (%) \r\nWS10M MERRA-2
Wind Speed at 10 Meters (m/s) \r\nPS MERRA-2 Surface Pressure (kPa)
\r\n-END HEADER-\r\nYEAR,DOY,T2M,T2M_MIN,T2M_MAX,RH2M,WS10M,PS\n1983,1,-25.24,-25.67,-24.88,94.25,2.32,69.06\n"
recorded_at: 2022-02-01 01:14:03 GMT
recorded_at: 2022-02-01 08:03:02 GMT
recorded_with: vcr/1.0.2, webmockr/0.8.0
16 changes: 8 additions & 8 deletions tests/fixtures/climatology_ag_point.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
http_interactions:
- request:
method: get
uri: https://power.larc.nasa.gov/api/temporal/climatology/point?parameters=T2M&community=ag&longitude=-179.5&latitude=-89.5&format=csv&time_standard=utc&user=nasapower4031
uri: https://power.larc.nasa.gov/api/temporal/climatology/point?parameters=T2M&community=ag&longitude=-179.5&latitude=-89.5&format=csv&time_standard=utc&user=nasapower404
body:
encoding: ''
string: ''
Expand All @@ -22,16 +22,16 @@ http_interactions:
x-ratelimit-limit-minute: '60'
ratelimit-remaining: '59'
ratelimit-limit: '60'
ratelimit-reset: '50'
date: Tue, 01 Feb 2022 01:14:10 GMT
ratelimit-reset: '51'
date: Tue, 01 Feb 2022 08:03:09 GMT
server: uvicorn
content-disposition: attachment; filename=POWER_Point_Climatology_Climatology_2001_2020_89d50S_179d50W_UTC.csv
x-archive-time: '0.518'
x-process-time: '0.06'
x-objects-time: '0.008'
x-archive-time: '0.484'
x-process-time: '0.05'
x-objects-time: '0.011'
content-encoding: gzip
vary: Accept-Encoding
x-service-time: '0.588'
x-service-time: '0.546'
x-app-version: v2.2.15
content-language: en-US
strict-transport-security: max-age=31536000;includeSubDomains;preload
Expand All @@ -48,5 +48,5 @@ http_interactions:
= 2885.03 meters\r\nValue for missing model data cannot be computed or out
of model availability range: -999 \r\nParameter(s): \r\nT2M MERRA-2 Temperature
at 2 Meters (C) \r\n-END HEADER-\r\nPARAMETER,JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC,ANN\nT2M,-29.16,-40.68,-52.56,-57.06,-57.9,-59.46,-62.02,-61.4,-60.25,-52.29,-38.76,-28.66,-50.04\n"
recorded_at: 2022-02-01 01:14:11 GMT
recorded_at: 2022-02-01 08:03:10 GMT
recorded_with: vcr/1.0.2, webmockr/0.8.0
18 changes: 9 additions & 9 deletions tests/fixtures/daily_ag_point.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
http_interactions:
- request:
method: get
uri: https://power.larc.nasa.gov/api/temporal/daily/point?parameters=T2M%2CT2M_MIN%2CT2M_MAX%2CRH2M%2CWS10M%2CPS&community=ag&start=19830101&end=19830101&longitude=-179.5&latitude=-89.5&format=csv&time_standard=utc&user=nasapower4031
uri: https://power.larc.nasa.gov/api/temporal/daily/point?parameters=T2M%2CT2M_MIN%2CT2M_MAX%2CRH2M%2CWS10M%2CPS&community=ag&start=19830101&end=19830101&longitude=-179.5&latitude=-89.5&format=csv&time_standard=utc&user=nasapower404
body:
encoding: ''
string: ''
Expand All @@ -18,20 +18,20 @@ http_interactions:
status: HTTP/1.1 200 OK
content-type: text/csv
content-length: '473'
x-ratelimit-remaining-minute: '59'
x-ratelimit-remaining-minute: '57'
x-ratelimit-limit-minute: '60'
ratelimit-remaining: '59'
ratelimit-remaining: '57'
ratelimit-limit: '60'
ratelimit-reset: '2'
date: Tue, 01 Feb 2022 01:13:58 GMT
ratelimit-reset: '4'
date: Tue, 01 Feb 2022 08:02:55 GMT
server: uvicorn
content-disposition: attachment; filename=POWER_Point_Daily_19830101_19830101_89d50S_179d50W_LST.csv
x-archive-time: '2.225'
x-archive-time: '2.483'
x-process-time: '0.03'
x-objects-time: '0.007'
x-objects-time: '0.008'
content-encoding: gzip
vary: Accept-Encoding
x-service-time: '2.263'
x-service-time: '2.523'
x-app-version: v2.2.17
content-language: en-US
strict-transport-security: max-age=31536000;includeSubDomains;preload
Expand All @@ -51,5 +51,5 @@ http_interactions:
(C) \r\nRH2M MERRA-2 Relative Humidity at 2 Meters (%) \r\nWS10M MERRA-2
Wind Speed at 10 Meters (m/s) \r\nPS MERRA-2 Surface Pressure (kPa)
\r\n-END HEADER-\r\nYEAR,DOY,T2M,T2M_MIN,T2M_MAX,RH2M,WS10M,PS\n1983,1,-25.24,-25.67,-24.88,94.25,2.32,69.06\n"
recorded_at: 2022-02-01 01:14:01 GMT
recorded_at: 2022-02-01 08:02:59 GMT
recorded_with: vcr/1.0.2, webmockr/0.8.0
Loading

0 comments on commit 31b57c9

Please sign in to comment.