Skip to content

Commit

Permalink
Fix errors reported in ropensci review
Browse files Browse the repository at this point in the history
See (ropensci/software-review#184 (comment))

- FIx bug related to new xml version 
- Fix bug related to changes in metadata retreived from lpdaac
- bumps required xml2 version to 1.2.0
  • Loading branch information
lbusett committed Jan 31, 2018
1 parent c434de8 commit 68f578e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ inst/Test_files/VI_16Days_500m_v6/MODIStsp_2017-12-05\.json
WIP/

inst/testdata/MODIStsp_2018-01-04\.json

libs/

_main\.Rmd
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Imports:
sp (>= 1.2-2),
stringr (>= 1.0.0),
xts (>= 0.9-7),
xml2
xml2 (>= 1.2.0)
Suggests:
spelling,
knitr,
Expand Down
2 changes: 1 addition & 1 deletion R/MODIStsp_download.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ MODIStsp_download <- function(modislist,
remote_filesize <- as.integer(
xml2::as_list(
httr::content(
size_string, encoding = "UTF-8"))[["GranuleURMetaData"]][["DataFiles"]][["DataFileContainer"]][["FileSize"]] #nolint
size_string, encoding = "UTF-8"))[["GranuleMetaDataFile"]][["GranuleURMetaData"]][["DataFiles"]][["DataFileContainer"]][["FileSize"]] #nolint
)
success <- TRUE
} else {
Expand Down
3 changes: 1 addition & 2 deletions R/MODIStsp_readxml.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ MODIStsp_read_xml <- function(prodopts_file,

prod_opt_list <- list()

xmldata <- xml2::as_list(xml2::read_xml(xml_file) )

xmldata <- xml2::as_list(xml2::read_xml(xml_file))[["products"]]
# names of the single products
names_products <- names(xmldata)
names_products <- names_products[names_products != "comment"]
Expand Down

0 comments on commit 68f578e

Please sign in to comment.