From 9bc36a4b3a88560891e73b386cb50d85c369f716 Mon Sep 17 00:00:00 2001 From: Andrew Barbour Date: Sun, 13 Aug 2023 23:38:17 +0000 Subject: [PATCH] Sorely needed update --- .Rbuildignore | 1 + .github/.gitignore | 1 + .github/workflows/R-CMD-check.yaml | 49 ++++++++++++++++++++++++++ .github/workflows/test-coverage.yaml | 50 ++++++++++++++++++++++++++ .travis.yml | 44 ----------------------- DESCRIPTION | 6 ++-- R/utilities.R | 16 +++++++-- README.md | 11 ++++-- TODO | 5 --- appveyor.yml | 52 ---------------------------- codecov.yml | 12 ------- cran-comments.md | 11 ++---- inst/NEWS.Rd | 6 ++-- man/logticks.Rd | 10 ++++++ revdep/README.md | 23 ++++++------ revdep/cran.md | 7 ++++ 16 files changed, 162 insertions(+), 142 deletions(-) create mode 100644 .github/.gitignore create mode 100644 .github/workflows/R-CMD-check.yaml create mode 100644 .github/workflows/test-coverage.yaml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml delete mode 100644 codecov.yml create mode 100644 revdep/cran.md diff --git a/.Rbuildignore b/.Rbuildignore index a018736..426f19e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -28,3 +28,4 @@ vignettes/figure ^cran-comments\.md$ ^codecov\.yml$ ^CRAN-RELEASE$ +^\.github$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..a3ac618 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,49 @@ +# 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] + 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: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v3 + + - 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-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..2c5bb50 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,50 @@ +# 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] + pull_request: + branches: [main, master] + +name: test-coverage + +jobs: + test-coverage: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::covr + needs: coverage + + - name: Test coverage + run: | + covr::codecov( + quiet = FALSE, + clean = FALSE, + install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") + ) + shell: Rscript {0} + + - name: Show testthat output + if: always() + run: | + ## -------------------------------------------------------------------- + find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v3 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7799aad..0000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r - -language: r -sudo: required -#dist: trusty -cache: packages -warnings_are_errors: false -#latex: false - -apt_packages: - - libgmp3-dev - - libmpfr-dev - -r_github_packages: -# - abarbour/kelvin - - gagolews/stringi -# - abarbour/psd - -r_packages: -# - stringi - - psd - - Bessel - - kelvin - - dplyr - - RColorBrewer - - signal - - knitr - - formatR - - rmarkdown - - testthat - - covr - -jobs: - include: - - r: devel - - r: release - -notifications: - email: - on_success: change - on_failure: change - -after_success: - - Rscript -e 'covr::codecov()' diff --git a/DESCRIPTION b/DESCRIPTION index b21cb5c..824963e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: kitagawa Type: Package Title: Spectral Response of Water Wells to Harmonic Strain and Pressure Signals -Version: 3.1.0 -Date: 2020-06-21 +Version: 3.1.1 +Date: 2023-08-13 Authors@R: c(person(given = c("Andrew","J."), family = "Barbour", @@ -55,4 +55,4 @@ Suggests: covr VignetteBuilder: knitr Encoding: UTF-8 -RoxygenNote: 7.1.0 +RoxygenNote: 7.2.3 diff --git a/R/utilities.R b/R/utilities.R index 3c12fbd..dcb06b2 100644 --- a/R/utilities.R +++ b/R/utilities.R @@ -189,6 +189,7 @@ sensing_volume <- function(rad_grout, len_grout, rad_screen, len_screen){ #' @param t.ratio numeric; the ratio of minor to major tick lengths. #' @param major.ticks numeric; the axis limits. #' @param base numeric; the base of the logarithm (somewhat experimental) +#' @param ticks.only logical; on the axis #' @param ... additional parameters passed to the \code{axis} call for the major ticks. #' #' @author A. J. Barbour @@ -199,9 +200,16 @@ sensing_volume <- function(rad_grout, len_grout, rad_screen, len_screen){ #' @examples #' x <- 10^(0:8) #' y <- 1:9 +#' +#' plot(log10(x),y,xaxt="n",xlab="x",xlim=c(0,9)) +#' logticks() +#' logticks(ax=3, ticks.only=TRUE) +#' +#' par(tcl=0.5) # have tick marks show up on inside instead #' plot(log10(x),y,xaxt="n",xlab="x",xlim=c(0,9)) #' logticks() -logticks <- function(ax=1, n.minor=9, t.lims, t.ratio=0.5, major.ticks=NULL, base=c("ten","ln","two"), ...){ +#' logticks(ax=3, ticks.only=TRUE) +logticks <- function(ax=1, n.minor=9, t.lims, t.ratio=0.5, major.ticks=NULL, base=c("ten","ln","two"), ticks.only=FALSE, ...){ # axis limits lims <- par("usr") # x or y axis @@ -222,7 +230,11 @@ logticks <- function(ax=1, n.minor=9, t.lims, t.ratio=0.5, major.ticks=NULL, bas base <- switch(base, two=2, ln="e", ten=10) # create tick label expressions - tick.labels <- sapply(major.ticks, function(i) as.expression(bquote(.(base) ^ .(i))) ) + tick.labels <- if (ticks.only){ + FALSE + } else { + sapply(major.ticks, function(i) as.expression(bquote(.(base) ^ .(i))) ) + } # add major ticks axis(ax, at=major.ticks, labels=tick.labels, ...) diff --git a/README.md b/README.md index 32c4fa3..3ac26ba 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,14 @@ Tools to calculate the theoretical spectral response of fluid-pressure in a water well to harmonic strains (e.g., tides, long-period seismic waves). - -[![Travis Build Status](https://travis-ci.org/abarbour/kitagawa.svg)](https://travis-ci.org/abarbour/kitagawa) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/abarbour/kitagawa?branch=master&svg=true)](https://ci.appveyor.com/project/abarbour/kitagawa) [![Code Coverage](https://codecov.io/gh/abarbour/kitagawa/branch/master/graph/badge.svg)](https://codecov.io/gh/abarbour/kitagawa?branch=master) [![License](https://img.shields.io/badge/license-GPL-orange.svg)](https://www.gnu.org/licenses/gpl-2.0.html) [![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/kitagawa)](https://cran.r-project.org/package=kitagawa) [![Downloads](https://cranlogs.r-pkg.org/badges/kitagawa)](https://www.r-pkg.org/pkg/kitagawa) - + + [![R-CMD-check](https://github.com/abarbour/kitagawa/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/abarbour/kitagawa/actions/workflows/R-CMD-check.yaml)\ +[![Code Coverage](https://codecov.io/gh/abarbour/kitagawa/branch/master/graph/badge.svg)](https://codecov.io/gh/abarbour/kitagawa?branch=master)\ +[![License](https://img.shields.io/badge/license-GPL-orange.svg)](https://www.gnu.org/licenses/gpl-2.0.html)\ +[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/kitagawa)](https://cran.r-project.org/package=kitagawa)\ +[![Downloads](https://cranlogs.r-pkg.org/badges/kitagawa)](https://www.r-pkg.org/pkg/kitagawa) + + ## Models of spectral response This code calculates the response at two types of wells: a sealed well and diff --git a/TODO b/TODO index 8f5014b..14e7832 100644 --- a/TODO +++ b/TODO @@ -18,12 +18,7 @@ *** open_well_response [X] *** well_response [ ] -[ ] Method to estimate transfer function between two series -*** MT CSD <-- perhaps include in psd - [ ] Datasets: -*** Honshu timeseries [X] <-- in psd *** PBO-PP well information (and calculated sensing volumes) -*** Slug test series??? diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 3a75e16..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,52 +0,0 @@ -# DO NOT CHANGE the "init" and "install" sections below - -# Download script file from GitHub -init: - ps: | - $ErrorActionPreference = "Stop" - Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1" - Import-Module '..\appveyor-tool.ps1' - -install: - ps: Bootstrap - -cache: - - C:\RLibrary - -environment: - NOT_CRAN: true - # env vars that may need to be set, at least temporarily, from time to time - # see https://github.com/krlmlr/r-appveyor#readme for details - # USE_RTOOLS: true - # R_REMOTES_STANDALONE: true - -# Adapt as necessary starting from here - -build_script: - - travis-tool.sh install_deps - -test_script: - - travis-tool.sh run_tests - -on_failure: - - 7z a failure.zip *.Rcheck\* - - appveyor PushArtifact failure.zip - -artifacts: - - path: '*.Rcheck\**\*.log' - name: Logs - - - path: '*.Rcheck\**\*.out' - name: Logs - - - path: '*.Rcheck\**\*.fail' - name: Logs - - - path: '*.Rcheck\**\*.Rout' - name: Logs - - - path: '\*_*.tar.gz' - name: Bits - - - path: '\*_*.zip' - name: Bits diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index 8f36b6c..0000000 --- a/codecov.yml +++ /dev/null @@ -1,12 +0,0 @@ -comment: false - -coverage: - status: - project: - default: - target: auto - threshold: 1% - patch: - default: - target: auto - threshold: 1% diff --git a/cran-comments.md b/cran-comments.md index 91d8168..858617d 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,10 +1,5 @@ -## Test environments -* local R installation, R 4.0.1 -* Debian Linux (on rhub) -* remote R installation (on travis-ci), R devel (2020-06-22 r78735) -* ubuntu 16.04 (on travis-ci), R 4.0.1 (and devel) -* win-builder (devel) +## R CMD check results -* This fixes build errors caused by removal of linked package 'sapa' +0 errors | 0 warnings | 1 note -Thanks for all you do for the community! +* This is a new release. diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index af4d566..9b16b21 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -19,9 +19,11 @@ News for package \kitagawa{}: \CRANpkg{kitagawa} -- \GITpkg{kitagawa} -- \encoding{UTF-8} -\section{CHANGES IN VERSION 3.1 (2020-06-21)}{ +\section{CHANGES IN VERSION 3.1+ (last updated 2023-08-13)}{ \itemize{ - \item Added the model of Wang et al (2018; \href{https://doi.org/10.1029/2018WR022793}{10.1029/2018WR022793}), + \item 3.1.1: added a \code{ticks.only} option to \code{logticks} + + \item 3.1: Added the model of Wang et al (2018; \href{https://doi.org/10.1029/2018WR022793}{10.1029/2018WR022793}), to the model toolbox and to the ResponseModels toolbox. Thanks to \JK for contributing this. \item New test validating Wang model against Hsieh model (they are equivalent when specific leakage is zero). Thanks to \JK for contributing this. diff --git a/man/logticks.Rd b/man/logticks.Rd index 3027a14..d66a4f3 100644 --- a/man/logticks.Rd +++ b/man/logticks.Rd @@ -14,6 +14,7 @@ logticks( t.ratio = 0.5, major.ticks = NULL, base = c("ten", "ln", "two"), + ticks.only = FALSE, ... ) @@ -36,6 +37,8 @@ log10_ticks(...) \item{base}{numeric; the base of the logarithm (somewhat experimental)} +\item{ticks.only}{logical; on the axis} + \item{...}{additional parameters passed to the \code{axis} call for the major ticks.} } \description{ @@ -58,8 +61,15 @@ in the original plot command to prevent adding default tick marks. \examples{ x <- 10^(0:8) y <- 1:9 + +plot(log10(x),y,xaxt="n",xlab="x",xlim=c(0,9)) +logticks() +logticks(ax=3, ticks.only=TRUE) + +par(tcl=0.5) # have tick marks show up on inside instead plot(log10(x),y,xaxt="n",xlab="x",xlim=c(0,9)) logticks() +logticks(ax=3, ticks.only=TRUE) } \references{ This was modified from a post on StackOverflow: diff --git a/revdep/README.md b/revdep/README.md index 7b97242..ad17af7 100644 --- a/revdep/README.md +++ b/revdep/README.md @@ -1,16 +1,17 @@ # Platform -|field |value | -|:--------|:----------------------------| -|version |R version 4.0.1 (2020-06-06) | -|os |macOS Mojave 10.14.6 | -|system |x86_64, darwin17.0 | -|ui |X11 | -|language |(EN) | -|collate |en_US.UTF-8 | -|ctype |en_US.UTF-8 | -|tz |America/Los_Angeles | -|date |2020-06-22 | +|field |value | +|:--------|:-----------------------------| +|version |R version 4.2.3 (2023-03-15) | +|os |macOS Catalina 10.15.7 | +|system |x86_64, darwin17.0 | +|ui |X11 | +|language |(EN) | +|collate |en_US.UTF-8 | +|ctype |en_US.UTF-8 | +|tz |UTC | +|date |2023-08-13 | +|pandoc |3.1.1 @ /opt/local/bin/pandoc | # Dependencies diff --git a/revdep/cran.md b/revdep/cran.md new file mode 100644 index 0000000..33114b6 --- /dev/null +++ b/revdep/cran.md @@ -0,0 +1,7 @@ +## revdepcheck results + +We checked 0 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. + + * We saw 0 new problems + * We failed to check 0 packages +