Skip to content

Commit 6fb48f5

Browse files
committed
update site
2 parents f40324f + 5f92c0e commit 6fb48f5

42 files changed

Lines changed: 527 additions & 107 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.Rbuildignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@
1616
^_pkgdown\.yml$
1717
^codemeta\.json$
1818
^CRAN-RELEASE$
19+
<<<<<<< HEAD
1920
^CRAN-SUBMISSION$
21+
=======
22+
^\.ccache$
23+
^\.github$
24+
^tic\.R$
25+
>>>>>>> 5f92c0e554c5e22aa235c2fc0bec391976bb65f4

.github/workflows/tic.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
## tic GitHub Actions template: linux-macos-windows-deploy
2+
## revision date: 2023-12-15
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- master
9+
- cran-*
10+
pull_request:
11+
branches:
12+
- main
13+
- master
14+
# for now, CRON jobs only run on the default branch of the repo (i.e. usually on master)
15+
schedule:
16+
# * is a special character in YAML so you have to quote this string
17+
- cron: "0 4 * * *"
18+
19+
name: tic
20+
21+
jobs:
22+
all:
23+
runs-on: ${{ matrix.config.os }}
24+
25+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
26+
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
config:
31+
# use a different tic template type if you do not want to build on all listed platforms
32+
- { os: windows-latest, r: "release" }
33+
- { os: macOS-latest, r: "release", pkgdown: "true", latex: "true" }
34+
- { os: ubuntu-latest, r: "devel" }
35+
- { os: ubuntu-latest, r: "release" }
36+
37+
env:
38+
# make sure to run `tic::use_ghactions_deploy()` to set up deployment
39+
TIC_DEPLOY_KEY: ${{ secrets.TIC_DEPLOY_KEY }}
40+
# prevent rgl issues because no X11 display is available
41+
RGL_USE_NULL: true
42+
# if you use bookdown or blogdown, replace "PKGDOWN" by the respective
43+
# capitalized term. This also might need to be done in tic.R
44+
BUILD_PKGDOWN: ${{ matrix.config.pkgdown }}
45+
# use GITHUB_TOKEN from GitHub to workaround rate limits in {remotes}
46+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
47+
48+
steps:
49+
- uses: actions/checkout@v4
50+
51+
- uses: r-lib/actions/setup-r@v2
52+
with:
53+
r-version: ${{ matrix.config.r }}
54+
Ncpus: 4
55+
56+
- uses: r-lib/actions/setup-tinytex@v2
57+
if: matrix.config.latex == 'true'
58+
59+
- uses: r-lib/actions/setup-pandoc@v2
60+
61+
- name: Install sys deps for Ubuntu
62+
if: runner.os == 'Linux'
63+
run: sudo apt update && sudo apt install -y libgit2-dev libcurl4-openssl-dev
64+
65+
# set date/week for use in cache creation
66+
# https://github.qkg1.topmunity/t5/GitHub-Actions/How-to-set-and-access-a-Workflow-variable/m-p/42970
67+
# - cache R packages daily
68+
- name: "[Cache] Prepare daily timestamp for cache"
69+
if: runner.os != 'Windows'
70+
id: date
71+
run: echo "date=$(date '+%d-%m')" >> $GITHUB_OUTPUT
72+
73+
- name: "[Cache] Restore R package cache"
74+
if: runner.os != 'Windows'
75+
uses: actions/cache/restore@v3
76+
with:
77+
path: ${{ env.R_LIBS_USER }}
78+
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}
79+
80+
- name: "[Stage] Install"
81+
run: Rscript -e "install.packages('tic', repos = c('https://ropensci.r-universe.dev', if (grepl('Ubuntu', Sys.info()[['version']])) {sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))} else {'https://cloud.r-project.org'}))" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()"
82+
83+
- name: "[Cache] Save R package cache"
84+
if: runner.os != 'Windows' && always()
85+
uses: actions/cache/save@v3
86+
with:
87+
path: ${{ env.R_LIBS_USER }}
88+
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}
89+
90+
- name: "[Stage] Script"
91+
run: Rscript -e 'tic::script()'
92+
93+
- name: "[Stage] After Success"
94+
run: Rscript -e "tic::after_success()"
95+
96+
- name: "[Stage] Upload R CMD check artifacts"
97+
if: failure()
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
101+
path: check
102+
- name: "[Stage] Before Deploy"
103+
run: |
104+
Rscript -e "tic::before_deploy()"
105+
106+
- name: "[Stage] Deploy"
107+
run: Rscript -e "tic::deploy()"
108+
109+
- name: "[Stage] After Deploy"
110+
run: Rscript -e "tic::after_deploy()"

.github/workflows/update-tic.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
on:
2+
workflow_dispatch:
3+
schedule:
4+
# * is a special character in YAML so you have to quote this string
5+
- cron: "0 4 * * 0" # every week
6+
7+
name: Update tic
8+
9+
jobs:
10+
update-tic:
11+
runs-on: ${{ matrix.config.os }}
12+
13+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
config:
19+
- { os: ubuntu-latest, r: "release" }
20+
21+
env:
22+
# use GITHUB_TOKEN from GitHub to workaround rate limits in {remotes}
23+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
persist-credentials: false
29+
30+
- uses: r-lib/actions/setup-r@v2
31+
with:
32+
r-version: ${{ matrix.config.r }}
33+
Ncpus: 4
34+
35+
- name: "[Stage] Dependencies"
36+
run: |
37+
Rscript -e "install.packages('pak', repos = 'https://r-lib.github.io/p/pak/stable')"
38+
Rscript -e "if (grepl('Ubuntu', Sys.info()[['version']])) {options(repos = c(CRAN = sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))))}; pak::pkg_install('ropensci/tic', dependencies = TRUE)"
39+
40+
- name: "[Stage] Update YAMLs"
41+
run: |
42+
Rscript -e "tic::update_yml()"
43+
44+
- name: "[Stage] Create Pull Request"
45+
uses: peter-evans/create-pull-request@v4
46+
with:
47+
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
48+
token: ${{ secrets.TIC_UPDATE }}
49+
title: "Update tic templates [ci-skip]"
50+
commit-message: "update tic templates"
51+
body: "{tic} templates can be updated :rocket: :robot:"
52+
branch: update-tic

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
inst/doc
66
.DS_Store
77
CRAN-RELEASE
8+
docs/

.travis.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

DESCRIPTION

Lines changed: 14 additions & 1 deletion
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.5.0
4+
Version: 1.7.0
55
Authors@R: c(person("Konstantinos", "Vantas",
66
role = c("aut", "cre"),
77
email = "kon.vantas@gmail.com",
@@ -25,6 +25,7 @@ License: MIT + file LICENSE
2525
Encoding: UTF-8
2626
LazyData: true
2727
RoxygenNote: 7.3.2
28+
<<<<<<< HEAD
2829
Imports: stringi (>= 1.5),
2930
stringr (>= 1.4),
3031
tibble(>= 3.1),
@@ -37,4 +38,16 @@ Suggests:
3738
rmarkdown (>= 2.7),
3839
httptest,
3940
testthat (>= 3.0)
41+
=======
42+
Imports: stringi (>= 1.8),
43+
stringr (>= 1.5),
44+
tibble(>= 3.2),
45+
readr (>= 2.1),
46+
jsonlite (>= 1.8)
47+
Suggests:
48+
ggplot2 (>= 3.5),
49+
knitr (>= 1.45),
50+
rmarkdown (>= 2.25),
51+
testthat (>= 3.2)
52+
>>>>>>> 5f92c0e554c5e22aa235c2fc0bec391976bb65f4
4053
VignetteBuilder: knitr

NEWS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# hydroscoper 1.7.0 (Release date: 2024-07-19)
2+
3+
* remove pingr dependency
4+
5+
# hydroscoper 1.6.0 (Release date: 2024-01-15)
6+
7+
* Update dependencies
8+
19
# hydroscoper 1.5.0 (Release date: 2022-09-29)
210

311
* remove defunct functions

R/utils.R

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ 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
)
16+
<<<<<<< HEAD
1517
tryCatch({
1618
if (all(is.na(pingr::ping_port(server_address(subdomain),
1719
port = 80L,
@@ -23,8 +25,22 @@ server_alive <- function(subdomain) {
2325
error = function(e) {
2426
# The original error message is now the default stop message
2527
stop(err_msg, call. = FALSE)
28+
=======
29+
30+
# test the http capabilities of the current R build
31+
if (!capabilities(what = "http/ftp")) {
32+
stop("The current R build has no http capabilities")
33+
>>>>>>> 5f92c0e554c5e22aa235c2fc0bec391976bb65f4
2634
}
27-
)
35+
36+
# test connection by trying to read first line of url
37+
test <- try(suppressWarnings(readLines(url, n = 1)), silent = TRUE)
38+
39+
# return FALSE if test inherits 'try-error' class
40+
if (inherits(test, "try-error")) {
41+
stop(err_msg)
42+
}
43+
2844
}
2945

3046
#' create coords from points

README.Rmd

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,35 @@ 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
```
35+
<<<<<<< HEAD
2936

3037
[![Travis-CI Build Status](https://app.travis-ci.com/ropensci/hydroscoper.svg?branch=master)](https://app.travis-ci.com/ropensci/hydroscoper)
3138
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/ropensci/hydroscoper?branch=master&svg=true)](https://ci.appveyor.com/project/ropensci/hydroscoper)
3239
[![codecov](https://app.codecov.io/gh/ropensci/hydroscoper/branch/master/graph/badge.svg)](https://app.codecov.io/gh/ropensci/hydroscoper)
40+
=======
41+
[![tic](https://github.com/ropensci/hydroscoper/workflows/tic/badge.svg?branch=master)](https://github.com/ropensci/hydroscoper/actions)
42+
[![codecov](https://codecov.io/github/ropensci/hydroscoper/branch/master/graphs/badge.svg)](https://app.codecov.io/gh/ropensci/hydroscoper)
43+
>>>>>>> 5f92c0e554c5e22aa235c2fc0bec391976bb65f4
3344
[![minimal R version](https://img.shields.io/badge/R%3E%3D-3.4-6666ff.svg)](https://cran.r-project.org/)
3445
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/hydroscoper)](https://cran.r-project.org/package=hydroscoper)
35-
[![packageversion](https://img.shields.io/badge/Package%20version-1.5.0-orange.svg?style=flat-square)](https://github.com/ropensci/hydroscoper)
46+
[![packageversion](https://img.shields.io/badge/Package%20version-1.7.0-orange.svg?style=flat-square)](https://github.com/ropensci/hydroscoper)
3647
[![](https://cranlogs.r-pkg.org/badges/grand-total/hydroscoper)](https://cran.r-project.org/package=hydroscoper)
3748
[![ropensci](https://badges.ropensci.org/185_status.svg)](https://github.com/ropensci/software-review/issues/185)
3849
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1196540.svg)](https://doi.org/10.5281/zenodo.1196540)

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@ hydroscoper
33

44
<!-- README.md is generated from README.Rmd. Please edit that file -->
55

6+
<<<<<<< HEAD
67
[![Travis-CI Build
78
Status](https://app.travis-ci.com/ropensci/hydroscoper.svg?branch=master)](https://app.travis-ci.com/ropensci/hydroscoper)
89
[![AppVeyor Build
910
Status](https://ci.appveyor.com/api/projects/status/github/ropensci/hydroscoper?branch=master&svg=true)](https://ci.appveyor.com/project/ropensci/hydroscoper)
1011
[![codecov](https://app.codecov.io/gh/ropensci/hydroscoper/branch/master/graph/badge.svg)](https://app.codecov.io/gh/ropensci/hydroscoper)
12+
=======
13+
[![tic](https://github.com/ropensci/hydroscoper/workflows/tic/badge.svg?branch=master)](https://github.com/ropensci/hydroscoper/actions)
14+
[![codecov](https://codecov.io/github/ropensci/hydroscoper/branch/master/graphs/badge.svg)](https://app.codecov.io/gh/ropensci/hydroscoper)
15+
>>>>>>> 5f92c0e554c5e22aa235c2fc0bec391976bb65f4
1116
[![minimal R
1217
version](https://img.shields.io/badge/R%3E%3D-3.4-6666ff.svg)](https://cran.r-project.org/)
1318
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/hydroscoper)](https://cran.r-project.org/package=hydroscoper)
14-
[![packageversion](https://img.shields.io/badge/Package%20version-1.5.0-orange.svg?style=flat-square)](https://github.com/ropensci/hydroscoper)
19+
[![packageversion](https://img.shields.io/badge/Package%20version-1.7.0-orange.svg?style=flat-square)](https://github.com/ropensci/hydroscoper)
1520
[![](https://cranlogs.r-pkg.org/badges/grand-total/hydroscoper)](https://cran.r-project.org/package=hydroscoper)
1621
[![ropensci](https://badges.ropensci.org/185_status.svg)](https://github.com/ropensci/software-review/issues/185)
1722
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1196540.svg)](https://doi.org/10.5281/zenodo.1196540)
@@ -78,6 +83,7 @@ library(ggplot2)
7883

7984
ts_raw <- get_data(subdomain = "kyy", time_id = 56)
8085
ts_raw
86+
<<<<<<< HEAD
8187
#> # A tibble: 147,519 × 3
8288
#> date value comment
8389
#> <dttm> <dbl> <chr>
@@ -92,6 +98,8 @@ ts_raw
9298
#> 9 1985-05-06 12:00:00 0 1
9399
#> 10 1985-05-06 12:30:00 0 1
94100
#> # ℹ 147,509 more rows
101+
=======
102+
>>>>>>> 5f92c0e554c5e22aa235c2fc0bec391976bb65f4
95103
```
96104

97105
Let’s create a plot:
@@ -104,8 +112,6 @@ ggplot(data = ts_raw, aes(x = date, y = value))+
104112
theme_classic()
105113
```
106114

107-
![](man/figures/README-plot_time_series-1.png)<!-- -->
108-
109115
## Meta
110116

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

0 commit comments

Comments
 (0)