AtlasOfLivingAustralia / ALA4R

Access data and resources hosted by the Atlas of Living Australia (ALA)
https://atlasoflivingaustralia.github.io/ALA4R/
41 stars 8 forks source link

Example in vignette fails #21

Closed AugustT closed 7 years ago

AugustT commented 7 years ago

I'm trying to get this package to pass devtools::check() and there are a few issues cropping up.

I cannot get line 173 in the vignette to pass:

tx=taxinfo_download("family:SPHENISCIDAE",fields=c("guid","genus","nameComplete","rank"))

I get

Error in taxinfo_download("family:SPHENISCIDAE", fields = c("guid", "genus",  : 
  invalid fields requested: genus. See ala_fields("general",as_is=TRUE)

If I remove "genus" from the fields argument I still get an error

 Error in check_status_code(h$value()[["status"]], on_redirect = on_redirect,  : 
  ALA4R: HTTP status code 500 received.
  Either there was an error with the request, or the ALA service may be down (try again later). Notify the package maintainers if you still have problems.

Any ideas?

AugustT commented 7 years ago

It appears that naming conventions have changed, this works

tx=taxinfo_download("rk_family:SPHENISCIDAE",fields=c("guid","rk_genus","nameComplete","rank"))

I'm working on a number of changes to make the package CRAN friendly and will put in a PR for review later

raymondben commented 7 years ago

The taxonomic field names in the underlying ALA service got changed during a recent rewrite. "genus" can be replaced with "rkid_genus" as a temporary workaround, but we're still trying to resolve the field name change issue.

As for the 500 error, I think it's a server problem, will check ...

AugustT commented 7 years ago

Additionally tx does not contain a column guid so the following lines dont work

tx=taxinfo_download("rk_family:SPHENISCIDAE",fields=c("guid","rk_genus","nameComplete","rank"))
tx=tx[tx$rank %in% c("species","subspecies"),] ## restrict to species and subspecies
s=lapply(tx$guid,function(z){ species_info(guid=z) })
imfiles=sapply(s,function(z){ 
  ifelse(any(grepl("(\\.jpg)",z$images$smallImageUrl,ignore.case=TRUE)),
  ALA4R:::cached_get(z$images$smallImageUrl[grepl("(\\.jpg)",z$images$smallImageUrl,
  ignore.case=TRUE)][1],type="binary_filename"),"") 
})

Any ideas how I can get this column to appear, or has it been renamed?

AugustT commented 7 years ago

Actually it doesn't look like the field argument is having any effect on the results returned

raymondben commented 7 years ago

See https://github.com/AtlasOfLivingAustralia/bie-index/issues/107 - something's gone awry with the underlying ALA web service. I'll wait for that to be resolved first.

AugustT commented 7 years ago

vignette now works fine