Skip to content

Commit

Permalink
Merge pull request #221 from ropensci/test-fixes
Browse files Browse the repository at this point in the history
Test fixes
  • Loading branch information
christophsax authored May 6, 2023
2 parents c8de915 + 196c87b commit c3953f8
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 63 deletions.
76 changes: 20 additions & 56 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# 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
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches:
- main
- master
branches: [main, master]
pull_request:
branches:
- main
- master
branches: [main, master]

name: R-CMD-check

Expand All @@ -22,64 +18,32 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest", http-user-agent: "R/4.1.0 (ubuntu-20.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

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

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- 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: Restore R package cache
uses: actions/cache@v2
- uses: r-lib/actions/setup-r-dependencies@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", "20.04"))')
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
extra-packages: any::rcmdcheck
needs: check

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
- uses: r-lib/actions/check-r-package@v2
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
upload-snapshots: true
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: tsbox
Type: Package
Title: Class-Agnostic Time Series
Version: 0.4
Version: 0.4.1
Authors@R: c(
person("Christoph", "Sax", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7192-7044")),
person("Cathy", "Chamberlin", role = c("rev")),
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# tsbox 0.4.1 (2023-05-06)

## Bug fixes

- Fix an issue with a test


# tsbox 0.4 (2023-03-08)

## Features
Expand Down
6 changes: 3 additions & 3 deletions R/ts_ggplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ts_ggplot <- function(..., title, subtitle, ylab = "") {
if (n == 2L) {
p <- ggplot2::ggplot(
df,
ggplot2::aes_string(x = cname$time, y = cname$value)
ggplot2::aes(x = !! cname$time, y = !! cname$value)
)
} else if (n > 2) {

Expand All @@ -87,7 +87,7 @@ ts_ggplot <- function(..., title, subtitle, ylab = "") {
}
p <- ggplot2::ggplot(
df,
ggplot2::aes_string(x = cname$time, y = cname$value, color = cname$id)
ggplot2::aes(x = !! cname$time, y = !! cname$value, color = cname$id)
)
}
p <- p + ggplot2::geom_line()
Expand Down Expand Up @@ -132,7 +132,7 @@ theme_tsbox <- function(base_family = getOption("ts_font", ""),
margin = ggplot2::margin(t = 0, b = half_line * 1.2),
size = ggplot2::rel(0.8)
),
panel.grid = ggplot2::element_line(size = 0.2),
panel.grid = ggplot2::element_line(linewidth = 0.2),
axis.text = ggplot2::element_text(
color = "grey10",
size = ggplot2::rel(0.7)
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ knitr::opts_chunk$set(
# tsbox: Class-Agnostic Time Series in R

<!-- badges: start -->
[![R-CMD-check](https://github.com/ropensci/tsbox/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/tsbox/actions)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Codecov test coverage](https://codecov.io/gh/ropensci/tsbox/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ropensci/tsbox?branch=main)
[![Status at rOpenSci Software Peer
Review](https://badges.ropensci.org/464_status.svg)](https://github.com/ropensci/software-review/issues/464)
[![R-CMD-check](https://github.com/ropensci/tsbox/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/tsbox/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

The R ecosystem knows a [vast
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

<!-- badges: start -->

[![R-CMD-check](https://github.com/ropensci/tsbox/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/tsbox/actions)
[![Project Status: Active – The project has reached a stable, usable
state and is being actively
developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Codecov test
coverage](https://codecov.io/gh/ropensci/tsbox/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ropensci/tsbox?branch=main)
[![Status at rOpenSci Software Peer
Review](https://badges.ropensci.org/464_status.svg)](https://github.com/ropensci/software-review/issues/464)
[![R-CMD-check](https://github.com/ropensci/tsbox/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/tsbox/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

The R ecosystem knows a [vast
Expand Down
5 changes: 5 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Boxable
CMD
Cheatsheet
Codecov
Dygraphs
Grosse
Loess
POSIXct
Routledge
Shyu
boxable
Expand All @@ -19,6 +21,7 @@ prcomp
rOpenSci
retransform
ropensci
stopifnot
subfunction
subfunctions
td
Expand All @@ -28,6 +31,7 @@ tibble
tibbles
tibbletime
timeSeries
timetk
tis
tseries
tsibble
Expand All @@ -37,3 +41,4 @@ vectorized
vectorizes
xts
ylab
zooreg
4 changes: 3 additions & 1 deletion tests/testthat/test-missing.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ test_that("Functions keep NaN values", {
ts_chain,
ts_default,
ts_diff,
ts_diffy,
# ts_diffy,
ts_first_of_period,
# ts_forecast, #
ts_index,
Expand All @@ -79,6 +79,8 @@ test_that("Functions keep NaN values", {
expect_identical(z[5], NaN)
}

expect_identical(ts_diffy(x)[5 + 12], NaN)

# functions that remvoe NA
expect_false(is.na(ts_na_interpolation(x)[5]))

Expand Down

0 comments on commit c3953f8

Please sign in to comment.