Skip to content

Commit b3a4eb3

Browse files
committed
remove pingr
1 parent 5300a5e commit b3a4eb3

File tree

9 files changed

+42
-44
lines changed

9 files changed

+42
-44
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@
2323
^\.github$
2424
^tic\.R$
2525
>>>>>>> 5f92c0e554c5e22aa235c2fc0bec391976bb65f4
26+
^doc$
27+
^Meta$

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ inst/doc
66
.DS_Store
77
CRAN-RELEASE
88
docs/
9+
/doc/
10+
/Meta/

DESCRIPTION

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Encoding: UTF-8
2626
LazyData: true
2727
RoxygenNote: 7.3.2
2828
Imports: stringi (>= 1.8),
29-
pingr (>= 2.0),
3029
stringr (>= 1.5),
3130
tibble(>= 3.2),
3231
readr (>= 2.1),

NEWS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# hydroscoper 1.7.0 (Release date: 2024-07-19)
22

3-
* remove pingr dependency
3+
* `pingr` dependency has been removed. The check if a sub-domain is alive is
4+
performed by a native R function.
45

56
# hydroscoper 1.6.0 (Release date: 2024-01-15)
67

@@ -49,7 +50,7 @@
4950
- The included data in the package cover all Hydroscope's databases.
5051
- Add vignettes "An introduction to `hydroscoper`" and "Using `hydroscoper`'s data".
5152
- Add package documentation site.
52-
- Use pingr package to check if a sub-domain is alive.
53+
5354
- All the functions return tibbles.
5455
- Add `greece_borders` dataset.
5556

R/utils.R

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,24 @@ server_address <- function(subdomain) {
77
#' Check if a remote server is alive
88
#' @noRd
99
server_alive <- function(subdomain) {
10-
11-
err_msg <- paste(
12-
"The server for that data source is probably down,",
13-
"get more info at [email protected] or try",
14-
"again later.")
15-
16-
tryCatch({
17-
if (all(is.na(pingr::ping_port(server_address(subdomain),
18-
port = 80L,
19-
count = 3
20-
)))) {
21-
stop(err_msg, call. = FALSE)
22-
}
23-
},
24-
error = function(e) {
25-
# The original error message is now the default stop message
26-
stop(err_msg, call. = FALSE)})
27-
2810
# test the http capabilities of the current R build
2911
if (!capabilities(what = "http/ftp")) {
3012
stop("The current R build has no http capabilities")
3113
}
3214

15+
url <- server_address(subdomain)
3316
# test connection by trying to read first line of url
3417
test <- try(suppressWarnings(readLines(url, n = 1)), silent = TRUE)
3518

3619
# return FALSE if test inherits 'try-error' class
3720
if (inherits(test, "try-error")) {
21+
err_msg <- paste(
22+
"The server for that data source is probably down,",
23+
"get more info at [email protected] or try",
24+
"again later."
25+
)
3826
stop(err_msg)
3927
}
40-
4128
}
4229

4330
#' create coords from points

codemeta.json

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"name": "R",
1515
"url": "https://r-project.org"
1616
},
17-
"runtimePlatform": "R version 4.4.1 (2024-06-14 ucrt)",
17+
"runtimePlatform": "R version 4.5.0 (2025-04-11)",
1818
"author": [
1919
{
2020
"@type": "Person",
@@ -80,6 +80,18 @@
8080
},
8181
"sameAs": "https://CRAN.R-project.org/package=rmarkdown"
8282
},
83+
{
84+
"@type": "SoftwareApplication",
85+
"identifier": "httptest",
86+
"name": "httptest",
87+
"provider": {
88+
"@id": "https://cran.r-project.org",
89+
"@type": "Organization",
90+
"name": "Comprehensive R Archive Network (CRAN)",
91+
"url": "https://cran.r-project.org"
92+
},
93+
"sameAs": "https://CRAN.R-project.org/package=httptest"
94+
},
8395
{
8496
"@type": "SoftwareApplication",
8597
"identifier": "testthat",
@@ -168,7 +180,7 @@
168180
},
169181
"SystemRequirements": null
170182
},
171-
"fileSize": "510.698KB",
183+
"fileSize": "507.75KB",
172184
"citation": [
173185
{
174186
"@type": "ScholarlyArticle",
@@ -197,12 +209,8 @@
197209
}
198210
],
199211
"releaseNotes": "https://github.com/ropensci/hydroscoper/blob/master/NEWS.md",
200-
<<<<<<< HEAD
201-
"contIntegration": ["https://app.travis-ci.com/ropensci/hydroscoper", "https://ci.appveyor.com/project/ropensci/hydroscoper", "https://app.codecov.io/gh/ropensci/hydroscoper"],
202-
=======
203212
"readme": "https://github.com/ropensci/hydroscoper/blob/master/README.md",
204-
"contIntegration": ["https://github.com/ropensci/hydroscoper/actions", "https://app.codecov.io/gh/ropensci/hydroscoper"],
205-
>>>>>>> 5f92c0e554c5e22aa235c2fc0bec391976bb65f4
213+
"contIntegration": ["https://app.travis-ci.com/ropensci/hydroscoper", "https://ci.appveyor.com/project/ropensci/hydroscoper", "https://app.codecov.io/gh/ropensci/hydroscoper"],
206214
"review": {
207215
"@type": "Review",
208216
"url": "https://github.com/ropensci/software-review/issues/185",

data-raw/hydroscope_data.Rmd

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,16 @@ This vignette shows how to create a tidy data frame for the stations' and time s
2929
This vignette requires an internet connection to run and that the Hydroscope's subdomains to be online. We can check if the sub-domains are online using the `pingr` package:
3030

3131
```{r}
32-
library(pingr)
33-
3432
# helper function to check if a sub-domain is online
3533
online <- function(h_url){
36-
!is.na(pingr::ping(h_url, count = 1))
34+
!inherits(try(suppressWarnings(readLines(h_url, n = 1)), silent = TRUE),
35+
"try-error")
3736
}
3837
3938
# check if sub-domains are online
40-
kyy <- online("kyy.hydroscope.gr")
41-
emy <- online("emy.hydroscope.gr")
42-
ypaat <- online("ypaat.hydroscope.gr")
39+
kyy <- online("http://kyy.hydroscope.gr")
40+
emy <- online("http://emy.hydroscope.gr")
41+
ypaat <- online("http://ypaat.hydroscope.gr")
4342
chk_online <- kyy & emy & ypaat
4443
print(paste("All sub-domains are online:", chk_online))
4544
```

docs/news/index.html

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

docs/pkgdown.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ pkgdown_sha: ~
44
articles:
55
intro_hydroscoper: intro_hydroscoper.html
66
stations_with_data: stations_with_data.html
7-
last_built: 2025-07-11T18:07Z
7+
last_built: 2025-07-11T19:10Z

0 commit comments

Comments
 (0)