Skip to content

Commit 5f92c0e

Browse files
committed
Remove pingr dependency. All servers of Hydroscope are currently not working
1 parent 771c833 commit 5f92c0e

31 files changed

+349
-443
lines changed

DESCRIPTION

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: hydroscoper
22
Type: Package
33
Title: Interface to the Greek National Data Bank for Hydrometeorological Information
4-
Version: 1.6.0
4+
Version: 1.7.0
55
Authors@R: c(person("Konstantinos", "Vantas",
66
role = c("aut", "cre"),
77
email = "kon.vantas@gmail.com",
@@ -24,15 +24,14 @@ Depends: R (>= 3.4)
2424
License: MIT + file LICENSE
2525
Encoding: UTF-8
2626
LazyData: true
27-
RoxygenNote: 7.3.0
27+
RoxygenNote: 7.3.2
2828
Imports: stringi (>= 1.8),
2929
stringr (>= 1.5),
3030
tibble(>= 3.2),
31-
pingr (>= 2.0),
3231
readr (>= 2.1),
3332
jsonlite (>= 1.8)
3433
Suggests:
35-
ggplot2 (>= 3.4),
34+
ggplot2 (>= 3.5),
3635
knitr (>= 1.45),
3736
rmarkdown (>= 2.25),
3837
testthat (>= 3.2)

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# hydroscoper 1.7.0 (Release date: 2024-07-19)
2+
3+
* remove pingr dependency
4+
15
# hydroscoper 1.6.0 (Release date: 2024-01-15)
26

37
* Update dependencies

R/utils.R

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,29 @@ server_address <- function(subdomain) {
44
paste0(subdomain, ".hydroscope.gr")
55
}
66

7-
#' Ping a remote server to see if its alive
7+
#' Check if a remote server is alive
88
#' @noRd
99
server_alive <- function(subdomain) {
10+
1011
err_msg <- paste(
1112
"The server for that data source is probably down,",
1213
"get more info at hydroscope@hydroscope.gr or try",
1314
"again later."
1415
)
15-
tryCatch({
16-
pingr::ping_port(server_address(subdomain),
17-
port = 80L,
18-
count = 1
19-
)
20-
if (all(is.na(pingr::ping_port(server_address(subdomain),
21-
port = 80L,
22-
count = 3
23-
)))) {
24-
stop()
25-
}
26-
},
27-
error = function(e) {
28-
stop(err_msg, call. = FALSE)
16+
17+
# test the http capabilities of the current R build
18+
if (!capabilities(what = "http/ftp")) {
19+
stop("The current R build has no http capabilities")
2920
}
30-
)
21+
22+
# test connection by trying to read first line of url
23+
test <- try(suppressWarnings(readLines(url, n = 1)), silent = TRUE)
24+
25+
# return FALSE if test inherits 'try-error' class
26+
if (inherits(test, "try-error")) {
27+
stop(err_msg)
28+
}
29+
3130
}
3231

3332
#' create coords from points

README.Rmd

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,28 @@ knitr::opts_chunk$set(
1515
1616
chk_online <- FALSE
1717
18-
library(pingr)
19-
2018
# helper function to check if a sub-domain is online
21-
online <- function(h_url){
22-
!is.na(pingr::ping(h_url, count = 1))
19+
online <- function(url = "kyy.hydroscope.gr") {
20+
21+
# test the http capabilities of the current R build
22+
if (!capabilities(what = "http/ftp")) return(FALSE)
23+
24+
# test connection by trying to read first line of url
25+
test <- try(suppressWarnings(readLines(url, n = 1)), silent = TRUE)
26+
27+
# return FALSE if test inherits 'try-error' class
28+
!inherits(test, "try-error")
2329
}
2430
2531
# check if sub-domains are online
26-
chk_online <- online("kyy.hydroscope.gr")
32+
chk_online <- online()
2733
2834
```
2935
[![tic](https://github.com/ropensci/hydroscoper/workflows/tic/badge.svg?branch=master)](https://github.com/ropensci/hydroscoper/actions)
3036
[![codecov](https://codecov.io/github/ropensci/hydroscoper/branch/master/graphs/badge.svg)](https://app.codecov.io/gh/ropensci/hydroscoper)
3137
[![minimal R version](https://img.shields.io/badge/R%3E%3D-3.4-6666ff.svg)](https://cran.r-project.org/)
3238
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/hydroscoper)](https://cran.r-project.org/package=hydroscoper)
33-
[![packageversion](https://img.shields.io/badge/Package%20version-1.6.0-orange.svg?style=flat-square)](https://github.com/ropensci/hydroscoper)
39+
[![packageversion](https://img.shields.io/badge/Package%20version-1.7.0-orange.svg?style=flat-square)](https://github.com/ropensci/hydroscoper)
3440
[![](https://cranlogs.r-pkg.org/badges/grand-total/hydroscoper)](https://cran.r-project.org/package=hydroscoper)
3541
[![ropensci](https://badges.ropensci.org/185_status.svg)](https://github.com/ropensci/software-review/issues/185)
3642
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1196540.svg)](https://doi.org/10.5281/zenodo.1196540)

README.md

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ hydroscoper
88
[![minimal R
99
version](https://img.shields.io/badge/R%3E%3D-3.4-6666ff.svg)](https://cran.r-project.org/)
1010
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/hydroscoper)](https://cran.r-project.org/package=hydroscoper)
11-
[![packageversion](https://img.shields.io/badge/Package%20version-1.6.0-orange.svg?style=flat-square)](https://github.com/ropensci/hydroscoper)
11+
[![packageversion](https://img.shields.io/badge/Package%20version-1.7.0-orange.svg?style=flat-square)](https://github.com/ropensci/hydroscoper)
1212
[![](https://cranlogs.r-pkg.org/badges/grand-total/hydroscoper)](https://cran.r-project.org/package=hydroscoper)
1313
[![ropensci](https://badges.ropensci.org/185_status.svg)](https://github.com/ropensci/software-review/issues/185)
1414
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1196540.svg)](https://doi.org/10.5281/zenodo.1196540)
@@ -75,20 +75,6 @@ library(ggplot2)
7575

7676
ts_raw <- get_data(subdomain = "kyy", time_id = 56)
7777
ts_raw
78-
#> # A tibble: 147,519 × 3
79-
#> date value comment
80-
#> <dttm> <dbl> <chr>
81-
#> 1 1985-05-06 08:00:00 0 1
82-
#> 2 1985-05-06 08:30:00 0 1
83-
#> 3 1985-05-06 09:00:00 0 1
84-
#> 4 1985-05-06 09:30:00 0 1
85-
#> 5 1985-05-06 10:00:00 0 1
86-
#> 6 1985-05-06 10:30:00 0 1
87-
#> 7 1985-05-06 11:00:00 0 1
88-
#> 8 1985-05-06 11:30:00 0 1
89-
#> 9 1985-05-06 12:00:00 0 1
90-
#> 10 1985-05-06 12:30:00 0 1
91-
#> # ℹ 147,509 more rows
9278
```
9379

9480
Let’s create a plot:
@@ -101,8 +87,6 @@ ggplot(data = ts_raw, aes(x = date, y = value))+
10187
theme_classic()
10288
```
10389

104-
![](man/figures/README-plot_time_series-1.png)<!-- -->
105-
10690
## Meta
10791

10892
- Bug reports, suggestions, and code are welcome. Please see

codemeta.json

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,17 @@
44
"identifier": "hydroscoper",
55
"description": "R interface to the Greek National Data Bank for Hydrological and Meteorological Information. It covers Hydroscope's data sources and provides functions to transliterate, translate and download them into tidy dataframes.",
66
"name": "hydroscoper: Interface to the Greek National Data Bank for Hydrometeorological Information",
7-
"relatedLink": ["https://docs.ropensci.org/hydroscoper/", "https://CRAN.R-project.org/package=hydroscoper"],
7+
"relatedLink": "https://docs.ropensci.org/hydroscoper/",
88
"codeRepository": "https://github.com/ropensci/hydroscoper",
99
"issueTracker": "https://github.com/ropensci/hydroscoper/issues ",
1010
"license": "https://spdx.org/licenses/MIT",
11-
"version": "1.5.0",
11+
"version": "1.7.0",
1212
"programmingLanguage": {
1313
"@type": "ComputerLanguage",
1414
"name": "R",
1515
"url": "https://r-project.org"
1616
},
17-
"runtimePlatform": "R version 4.2.1 (2022-06-23)",
18-
"provider": {
19-
"@id": "https://cran.r-project.org",
20-
"@type": "Organization",
21-
"name": "Comprehensive R Archive Network (CRAN)",
22-
"url": "https://cran.r-project.org"
23-
},
17+
"runtimePlatform": "R version 4.4.1 (2024-06-14 ucrt)",
2418
"author": [
2519
{
2620
"@type": "Person",
@@ -51,7 +45,7 @@
5145
"@type": "SoftwareApplication",
5246
"identifier": "ggplot2",
5347
"name": "ggplot2",
54-
"version": ">= 3.3",
48+
"version": ">= 3.5",
5549
"provider": {
5650
"@id": "https://cran.r-project.org",
5751
"@type": "Organization",
@@ -64,7 +58,7 @@
6458
"@type": "SoftwareApplication",
6559
"identifier": "knitr",
6660
"name": "knitr",
67-
"version": ">= 1.31",
61+
"version": ">= 1.45",
6862
"provider": {
6963
"@id": "https://cran.r-project.org",
7064
"@type": "Organization",
@@ -77,7 +71,7 @@
7771
"@type": "SoftwareApplication",
7872
"identifier": "rmarkdown",
7973
"name": "rmarkdown",
80-
"version": ">= 2.7",
74+
"version": ">= 2.25",
8175
"provider": {
8276
"@id": "https://cran.r-project.org",
8377
"@type": "Organization",
@@ -90,7 +84,7 @@
9084
"@type": "SoftwareApplication",
9185
"identifier": "testthat",
9286
"name": "testthat",
93-
"version": ">= 3.0",
87+
"version": ">= 3.2",
9488
"provider": {
9589
"@id": "https://cran.r-project.org",
9690
"@type": "Organization",
@@ -111,7 +105,7 @@
111105
"@type": "SoftwareApplication",
112106
"identifier": "stringi",
113107
"name": "stringi",
114-
"version": ">= 1.5",
108+
"version": ">= 1.8",
115109
"provider": {
116110
"@id": "https://cran.r-project.org",
117111
"@type": "Organization",
@@ -124,7 +118,7 @@
124118
"@type": "SoftwareApplication",
125119
"identifier": "stringr",
126120
"name": "stringr",
127-
"version": ">= 1.4",
121+
"version": ">= 1.5",
128122
"provider": {
129123
"@id": "https://cran.r-project.org",
130124
"@type": "Organization",
@@ -137,7 +131,7 @@
137131
"@type": "SoftwareApplication",
138132
"identifier": "tibble",
139133
"name": "tibble",
140-
"version": ">= 3.1",
134+
"version": ">= 3.2",
141135
"provider": {
142136
"@id": "https://cran.r-project.org",
143137
"@type": "Organization",
@@ -147,23 +141,10 @@
147141
"sameAs": "https://CRAN.R-project.org/package=tibble"
148142
},
149143
"5": {
150-
"@type": "SoftwareApplication",
151-
"identifier": "pingr",
152-
"name": "pingr",
153-
"version": ">= 2.0",
154-
"provider": {
155-
"@id": "https://cran.r-project.org",
156-
"@type": "Organization",
157-
"name": "Comprehensive R Archive Network (CRAN)",
158-
"url": "https://cran.r-project.org"
159-
},
160-
"sameAs": "https://CRAN.R-project.org/package=pingr"
161-
},
162-
"6": {
163144
"@type": "SoftwareApplication",
164145
"identifier": "readr",
165146
"name": "readr",
166-
"version": ">= 1.4",
147+
"version": ">= 2.1",
167148
"provider": {
168149
"@id": "https://cran.r-project.org",
169150
"@type": "Organization",
@@ -172,11 +153,11 @@
172153
},
173154
"sameAs": "https://CRAN.R-project.org/package=readr"
174155
},
175-
"7": {
156+
"6": {
176157
"@type": "SoftwareApplication",
177158
"identifier": "jsonlite",
178159
"name": "jsonlite",
179-
"version": ">= 1.7",
160+
"version": ">= 1.8",
180161
"provider": {
181162
"@id": "https://cran.r-project.org",
182163
"@type": "Organization",
@@ -187,7 +168,7 @@
187168
},
188169
"SystemRequirements": null
189170
},
190-
"fileSize": "534.714KB",
171+
"fileSize": "510.698KB",
191172
"citation": [
192173
{
193174
"@type": "ScholarlyArticle",
@@ -216,10 +197,12 @@
216197
}
217198
],
218199
"releaseNotes": "https://github.com/ropensci/hydroscoper/blob/master/NEWS.md",
219-
"contIntegration": ["https://travis-ci.org/ropensci/hydroscoper", "https://ci.appveyor.com/project/ropensci/hydroscoper", "https://codecov.io/gh/ropensci/hydroscoper"],
200+
"readme": "https://github.com/ropensci/hydroscoper/blob/master/README.md",
201+
"contIntegration": ["https://github.com/ropensci/hydroscoper/actions", "https://app.codecov.io/gh/ropensci/hydroscoper"],
220202
"review": {
221203
"@type": "Review",
222204
"url": "https://github.com/ropensci/software-review/issues/185",
223205
"provider": "https://ropensci.org"
224-
}
206+
},
207+
"keywords": ["climate", "hydroscope", "hydrometeorology", "hydrology", "tidy-data", "time-series", "greece", "water-resources", "meteorological-stations", "meteorological-data", "r", "rstats", "r-package", "peer-reviewed"]
225208
}

docs/404.html

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)