Closed paulr-bv closed 3 years ago
Possibly related to https://github.com/ropensci/bomrang/issues/119
Yes. Apologies for not seeing #199 :-( Possible solution included here though incase the BOM issue remains
@rensa, how far did you get with your bug fix?
I didn't get to it today, unfortunately! However, we do need it fixed for our work, so I'll 100% be taking a swing at it on Monday morning.
No worries, I'm otherwise occupied at the moment.
I've submitted a PR with a fix to the immediate problem, although I've had it drop a warning if any of the station lists are empty (which may be confusing if you, say, request temperature and it says the rain list is missing). It can be merged as-is (although CI will fail, as it's expecting output from get_historical_weather
), or we could rework the function to only request the station list for the requested data type.
I've incorporated @rensa's PR and updated tests to handle this. If rain
is requested, this will automatically error out, all others still receive the warning message about lack of availability for rain data.
I need to update the tests for the min
, max
and solar
to reflect the warning message if any of them goes offline as rain
currently has.
I've another new function I'm working on to fetch sub-daily timescales using stationaRy::get_met()
. Once I've incorporated that, I'll get a new release pushed to CRAN. In the meantime, you should be able to install and use the latest version now from GitHub using:
if (!require("remotes")) {
install.packages("remotes", repos = "http://cran.rstudio.com/")
library("remotes")
}
install_github("ropensci/bomrang", build_vignettes = TRUE)
Adam,
Thanks for the heads up on this being available to install from GitHub. I have just done that and it mostly works. ☺
The issue is:
Here is an example (my bolding obviously):
Canberra_mintemps <- get_historical(latlon = c(-35.2809, 149.1300),
- type = "min") Error in get_historical(latlon = c(-35.2809, 149.13), type = "min") : could not find function "get_historical"
In the new version (v 0.7.0.9000):
I refer to the current documentation on CRAN for v0.7.0 which shows “get_historical()” should be there (and code snippet above is from the example)
I tweaked my code to point to get_historical_weather() and it worked fine, with the rain station data not being available.
Thanks again for all your work on this.
Cheers, Paul.
From: "Adam H. Sparks" notifications@github.com Reply to: ropensci/bomrang reply@reply.github.com Date: Sunday, 30 August 2020 at 8:10 pm To: ropensci/bomrang bomrang@noreply.github.com Cc: Paul Robertson paulr@beovista.com.au, Author author@noreply.github.com Subject: Re: [ropensci/bomrang] get_historical crashing when no BOM Stations returned from call in .get_ncc (#120)
I've incorporated @rensahttps://github.com/rensa's PR and updated tests to handle this. If rain is requested, this will automatically error out, all others still receive the warning message about lack of availability for rain data.
I need to update the tests for the min, max and solar to reflect the warning message if any of them goes offline as rain currently has.
I've another new function I'm working on to fetch sub-daily timescales using stationaRy::get_met(). Once I've incorporated that, I'll get a new release pushed to CRAN. In the meantime, you should be able to install and use the latest version now from GitHub using:
if (!require("remotes")) {
install.packages("remotes", repos = "http://cran.rstudio.com/")
library("remotes")
}
install_github("ropensci/bomrang", build_vignettes = TRUE)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ropensci/bomrang/issues/120#issuecomment-683401639, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AG7QKKZQXPW5SX5C4Y2PMGLSDIQPPANCNFSM4QG5M4DA.
get_historical() is currently failing. Symptom is:
Error returned is:
I did a quick investigation and I think it is failing in .get_ncc()
It seems that there is a bug on the BOM site today where a call for rain stations is returning zero (0) stations. The call is:
http://www.bom.gov.au/climate/data/lists_by_element/alphaAUS_136.txt
It currently returns:
The call in .get_ncc for this 0 stations have the following for ncc:
In the .get_ncc function, this seems to be causing the error on line 264 of the current get_historical.R file (the second line in this quote below):
This call appears to be trying to exclude the copyright blocks at the bottom of the "data".
Suggestion:
One option is to update / replace current lines 262 - 273 with something like this: