Skip to content

Commit

Permalink
Dev (#51)
Browse files Browse the repository at this point in the history
* cicd check

* fix danepubliczne.imgw.pl to dane.imgw.pl

* fix for empty ogimet

* fix link

* test github actions

* Update R-CMD-check.yaml
  • Loading branch information
bczernecki authored Dec 21, 2020
1 parent e71759e commit 17e396d
Show file tree
Hide file tree
Showing 46 changed files with 262 additions and 171 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
^data-raw$
^vignettes/articles$

^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
103 changes: 103 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# NOTE: This workflow is overkill for most R packages
# check-standard.yaml is likely a better choice
# usethis::use_github_action("check-standard") will install it.
#
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: '3.6'}
- {os: ubuntu-16.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest", http-user-agent: "R/4.0.0 (ubuntu-16.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
- {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}

- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "16.04"))')
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
37 changes: 0 additions & 37 deletions .github/workflows/r.yml

This file was deleted.

2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: climate
Title: Interface to Download Meteorological (and Hydrological) Datasets
Version: 0.9.8
Version: 0.9.9
Authors@R: c(person(given = "Bartosz",
family = "Czernecki",
role = c("aut", "cre"),
Expand Down
4 changes: 2 additions & 2 deletions R/hydro_imgw.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#' Hydrological data from IMGW
#'
#' Downloading hourly, daily, and monthly hydrological data from the measurement stations available in the danepubliczne.imgw.pl collection
#' Downloading hourly, daily, and monthly hydrological data from the measurement stations available in the dane.imgw.pl collection
#'
#' @param interval temporal resolution of the data ("daily" , "monthly", or "semiannual_and_annual")
#' @param year vector of years (e.g., 1966:2000)
#' @param coords add coordinates of the stations (logical value TRUE or FALSE)
#' @param value type of data (can be: state - "H" (default), flow - "Q", or temperature - "T")
#' @param station vector of hydrological stations danepubliczne.imgw.pl; can be given as station name with CAPITAL LETTERS (character)
#' @param station vector of hydrological stations dane.imgw.pl; can be given as station name with CAPITAL LETTERS (character)
#' It accepts either names (characters in CAPITAL LETTERS) or stations' IDs (numeric)
#' @param col_names three types of column names possible: "short" - default, values with shorten names, "full" - full English description, "polish" - original names in the dataset
#' @param ... other parameters that may be passed to the 'shortening' function that shortens column names
Expand Down
2 changes: 1 addition & 1 deletion R/hydro_imgw_annual.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Semi-annual and annual hydrological data
#'
#' Downloading hydrological data for the semi-annual and annual period
#' available in the danepubliczne.imgw.pl collection
#' available in the dane.imgw.pl collection
#'
#' @param year vector of years (e.g., 1966:2000)
#' @param coords add coordinates of the stations (logical value TRUE or FALSE)
Expand Down
2 changes: 1 addition & 1 deletion R/hydro_imgw_daily.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Daily hydrological data
#'
#' Downloading daily hydrological data from the danepubliczne.imgw.pl collection
#' Downloading daily hydrological data from the dane.imgw.pl collection
#'
#' @param year vector of years (e.g., 1966:2000)
#' @param coords add coordinates of the stations (logical value TRUE or FALSE)
Expand Down
2 changes: 1 addition & 1 deletion R/hydro_imgw_monthly.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Monthly hydrological data
#'
#' Downloading monthly hydrological data from the danepubliczne.imgw.pl collection
#' Downloading monthly hydrological data from the dane.imgw.pl collection
#'
#' @param year vector of years (e.g., 1966:2000)
#' @param coords add coordinates of the stations (logical value TRUE or FALSE)
Expand Down
2 changes: 1 addition & 1 deletion R/hydro_metadata_imgw.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Hydrological metadata
#'
#' Downloading the description (metadata) to hydrological data available in the danepubliczne.imgw.pl repository.
#' Downloading the description (metadata) to hydrological data available in the dane.imgw.pl repository.
#' By default, the function returns a list or data frame for a selected subset
#`
#' @param interval temporal resolution of the data ("daily" , "monthly", or "semiannual_and_annual")
Expand Down
2 changes: 1 addition & 1 deletion R/hydro_shortening_imgw.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Shortening column names for hydrological variables
#'
#' Shortening column names of hydrological parameters to improve the readability of downloaded dataset from the danepubliczne.imgw.pl collection and removing duplicated column names
#' Shortening column names of hydrological parameters to improve the readability of downloaded dataset from the dane.imgw.pl collection and removing duplicated column names
#'
#' @param data downloaded dataset with original column names
#' @param col_names three types of column names possible: "short" - default, values with shorten names, "full" - full English description, "polish" - original names in the dataset
Expand Down
2 changes: 1 addition & 1 deletion R/imgw_hydro_abbrev.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#' @name imgw_hydro_abbrev
#' @title Definitions of hydrological parameters used for shortening column names from the danepubliczne.imgw.pl collection
#' @title Definitions of hydrological parameters used for shortening column names from the dane.imgw.pl collection
#'
#' @description The object contains 3 columns that are currently used for improving readability of the downloaded dataset:
#' fullname, abbr_eng, and fullname_eng
Expand Down
2 changes: 1 addition & 1 deletion R/imgw_hydro_stations.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#' @name imgw_hydro_stations
#' @title Location of the hydrological stations from the danepubliczne.imgw.pl collection
#' @title Location of the hydrological stations from the dane.imgw.pl collection
#'
#' @description The object contains weather stations
#' coordinates, ID numbers, and elevations
Expand Down
2 changes: 1 addition & 1 deletion R/imgw_meteo_abbrev.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#' @name imgw_meteo_abbrev
#' @title Definitions of meteorological parameters used for shortening column names for the meteorological data from the danepubliczne.imgw.pl collection
#' @title Definitions of meteorological parameters used for shortening column names for the meteorological data from the dane.imgw.pl collection
#'
#' @description The object contains 3 columns that are currently used for improving readability of the downloaded dataset:
#' fullname, abbr_eng, and fullname_eng
Expand Down
2 changes: 1 addition & 1 deletion R/imgw_meteo_stations.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#' @name imgw_meteo_stations
#' @title Location of the meteorological stations from the danepubliczne.imgw.pl collection
#' @title Location of the meteorological stations from the dane.imgw.pl collection
#'
#' @description The object contains weather stations
#' coordinates, ID numbers, and elevations
Expand Down
4 changes: 2 additions & 2 deletions R/meteo_imgw.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Meteorological data from IMGW
#'
#' Downloading hourly, daily, and monthly meteorological data from the SYNOP / CLIMATE / PRECIP stations available in the danepubliczne.imgw.pl collection
#' Downloading hourly, daily, and monthly meteorological data from the SYNOP / CLIMATE / PRECIP stations available in the dane.imgw.pl collection
#'
#' @param interval temporal resolution of the data ("hourly", "daily", "monthly")
#' @param rank rank of the stations: "synop" (default), "climate" or "precip"
Expand All @@ -9,7 +9,7 @@
#' @param coords add coordinates of the station (logical value TRUE or FALSE)
#' @param col_names three types of column names possible: "short" - default, values with shorten names, "full" - full English description, "polish" - original names in the dataset
#' @param ... other parameters that may be passed to the 'shortening' function that shortens column names
#' @param station vector of hydrological stations danepubliczne.imgw.pl can be name of station CAPITAL LETTERS(character)
#' @param station vector of hydrological stations dane.imgw.pl can be name of station CAPITAL LETTERS(character)
#' It accepts names (characters in CAPITAL LETTERS) or stations' IDs (numeric)
#' @export
#' @return A data.frame with columns describing the meteorological parameters (e.g. temperature, wind speed, precipitation) where each row represent a measurement,
Expand Down
2 changes: 1 addition & 1 deletion R/meteo_imgw_daily.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Daily IMGW meteorological data
#'
#' Downloading daily (meteorological) data from the SYNOP / CLIMATE / PRECIP stations available in the danepubliczne.imgw.pl collection
#' Downloading daily (meteorological) data from the SYNOP / CLIMATE / PRECIP stations available in the dane.imgw.pl collection
#'
#' @param rank rank of the stations: "synop" (default), "climate", or "precip"
#' @param year vector of years (e.g., 1966:2000)
Expand Down
2 changes: 1 addition & 1 deletion R/meteo_imgw_hourly.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Hourly IMGW meteorological data
#'
#' Downloading hourly (meteorological) data from the SYNOP / CLIMATE / PRECIP stations available in the danepubliczne.imgw.pl collection
#' Downloading hourly (meteorological) data from the SYNOP / CLIMATE / PRECIP stations available in the dane.imgw.pl collection
#'
#' @param rank rank of the stations: "synop" (default), "climate", or "precip"
#' @param year vector of years (e.g., 1966:2000)
Expand Down
2 changes: 1 addition & 1 deletion R/meteo_imgw_monthly.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Monthly IMGW meteorological data
#'
#' Downloading monthly (meteorological) data from the SYNOP / CLIMATE / PRECIP stations available in the danepubliczne.imgw.pl collection
#' Downloading monthly (meteorological) data from the SYNOP / CLIMATE / PRECIP stations available in the dane.imgw.pl collection
#'
#' @param rank rank of the stations: "synop" (default), "climate", or "precip"
#' @param year vector of years (e.g., 1966:2000)
Expand Down
2 changes: 1 addition & 1 deletion R/meteo_metadata_imgw.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Meteorological metadata
#'
#' Downloading the description (metadata) to the meteorological data available in the danepubliczne.imgw repository.imgw.pl.
#' Downloading the description (metadata) to the meteorological data available in the dane.imgw repository.imgw.pl.
#' By default, the function returns a list or data frame for a selected subset
#'
#' @param interval temporal resolution of the data ("hourly", "daily", "monthly")
Expand Down
2 changes: 1 addition & 1 deletion R/meteo_shortening_imgw.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Shortening column names for meteorological variables
#'
#' Shortening column names of meteorological parameters to improve the readability of downloaded dataset from the danepubliczne.imgw.pl collection and removing duplicated column names
#' Shortening column names of meteorological parameters to improve the readability of downloaded dataset from the dane.imgw.pl collection and removing duplicated column names
#'
#' @param data downloaded dataset with original column names
#' @param col_names three types of column names possible: "short" - default, values with shorten names, "full" - full English description, "polish" - original names in the dataset
Expand Down
Loading

0 comments on commit 17e396d

Please sign in to comment.