Skip to content

Commit

Permalink
merge Dev_merge to fit manual for ecosim.R and Rpath_Support.R
Browse files Browse the repository at this point in the history
  • Loading branch information
kerim aydin committed May 23, 2024
2 parents a83e701 + c75b11b commit 7d24f22
Show file tree
Hide file tree
Showing 141 changed files with 4,941 additions and 1,478 deletions.
13 changes: 13 additions & 0 deletions ..Rcheck/00check.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
* using log directory ‘/home/rklasky/R/packages/Rpath/..Rcheck’
* using R version 4.3.1 (2023-06-16)
* using platform: x86_64-pc-linux-gnu (64-bit)
* R was compiled by
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
GNU Fortran (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
* running under: Linux Mint 20
* using session charset: UTF-8
* checking for file ‘./DESCRIPTION’ ... ERROR
Required fields missing or empty:
‘Author’ ‘Maintainer’
* DONE
Status: 1 ERROR
18 changes: 10 additions & 8 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@

^.*\.Rproj$
^\.Rproj\.user$
^\.github$
^_pkgdown\.yml$
^docs$
^pkgdown$
^data-raw$

^.*\.Rproj$
^\.Rproj\.user$
^\.github$
^_pkgdown\.yml$
^docs$
^pkgdown$
^data-raw$
^doc$
^Meta$
1 change: 1 addition & 0 deletions .Renviron
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_R_CHECK_DONTTEST_EXAMPLES_=FALSE
31 changes: 11 additions & 20 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# 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, UnitTests]
pull_request:
branches: [main, master]

Expand All @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
Expand All @@ -29,30 +29,21 @@ jobs:
R_KEEP_PKG_SOURCE: yes

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

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

- uses: r-lib/actions/setup-r@v1
- 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@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck

- uses: r-lib/actions/check-r-package@v1

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
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 .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@master

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/secretScan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
fetch-depth: '2'
- name: gitleaks-action
uses: zricethezav/gitleaks-action@master
uses: gitleaks/gitleaks-action@v1.6.0

94 changes: 94 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@

on:
push:
paths:
- '.github/workflows/tests.yml'
- 'R/*'
- 'tests/testthat/*'
- 'README.md'
- 'DESCRIPTION'
pull_request:
paths:
- '.github/workflows/tests.yml'
- 'R/*'
- 'tests/testthat/*'

name: Unit-Tests

jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: r-lib/actions/setup-r@v2
# - uses: r-lib/actions/setup-pandoc@v2
# - name: Install dependencies
# run: Rscript -e "install.packages(c('testthat', 'tidyverse', 'here'))"
# - name: Run tests
# run: Rscript -e "source('tests/testthat.R')"

Unit-Tests:
runs-on: ${{matrix.config.os}}

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

strategy:
fail-fast: false
matrix:
#os: [macos-latest, ubuntu-latest, windows-latest]
#os: [ubuntu-latest]
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_REMOTES_NO_ERRORS_FROM_WARNINGS: false
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4
# with:
# fetch-depth: 0

- 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
# r-version: '4.3.1'

- uses: r-lib/actions/setup-r-dependencies@v2

- name: Install command line packages
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt-get install libcurl4-openssl-dev libgit2-dev
- name: Install dependencies
#run: Rscript -e "install.packages(c('remotes','testthat', 'tidyverse', 'here'))"
run: |
install.packages(c('usethis','remotes','testthat','tidyverse','here','rmarkdown','qpdf','distillery','ggpubr','rlist'))
remotes::install_github("NOAA-EDAB/Rpath")
shell: Rscript {0}

- name: Run tests
#run: Rscript -e "source('tests/testthat.R')"
run: |
source(here::here("data-raw/REcosystem.R"))
source(here::here("tests/testthat.R"))
shell: Rscript {0}

# - name: commit data files
# run: |
# git config user.name github-actions
# git config user.email github-actions@github.com
# file.copy('here::here("tests/testthat/Rplots.pdf")",to=here::here("inst/extdata/Rplots.pdf"))
# git add inst/extdata/Rplots.pdf
# git commit -m "automated commit from testthat yml"
# git push
16 changes: 14 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
.Rproj.user
.Rhistory
.RData
*.png
.Renviron
*.jpg
*.tif
*.tar
*.so
outputs
code
*.xlsx
*.docx
*.pdf
Ecopath_dev
Rpath.Rcheck*
src/*.o
src/*.dll
NAMESPACE
tests/testthat/data/output/*
tests/testthat/data/bkup/*
tests/testthat/data/input/REcosystem_Current_*.dat
tests/testthat/data/input/REcosystem_Current_*.rds
tests/testthat/data/input/REcosystem_Current_*.csv
tests/testthat/old/*
tests/testthat/bkup/*
tests/testthat/old dat files/*
docs
doc
Meta
Rpath.Rproj
18 changes: 16 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ License: file LICENSE
Encoding: UTF-8
Imports:
data.table,
methods,
graphics,
grDevices,
MASS,
Expand All @@ -24,11 +25,24 @@ Imports:
utils
LinkingTo: Rcpp
Suggests:
here,
knitr,
rmarkdown
rmarkdown,
distillery,
ggplot2,
ggpubr,
rlist,
stringr,
qpdf,
usethis,
dplyr,
generics,
testthat (>= 3.0.0)
VignetteBuilder: knitr
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
URL: https://github.com/NOAA-EDAB/Rpath
BugReports: https://github.com/NOAA-EDAB/Rpath/issues
Depends:
R (>= 2.10)
Config/testthat/edition: 3
LazyData: true
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,5 @@ import(stats)
import(utils)
importFrom(Rcpp,sourceCpp)
importFrom(grDevices,rainbow)
importFrom(methods,is)
useDynLib(Rpath)
8 changes: 7 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Rpath 0.0.1.3

## Major Changes
- Added bioenergetic code
- adjust functions can now supply values by individual months rather than by years

# Rpath 0.0.1.2

## Major Changes
Expand Down Expand Up @@ -72,4 +78,4 @@

Did not keep good track of notes prior to version 0.0.0.9003 - My Bad

The initial files were the code sent by Kerim to Sean on March 31, 2014 (ecopath_sim_r_v0_04_toSean_31_03_14.zip) Files have been renamed to drop the version number and take advantage of this VCS.
The initial files were the code sent by Kerim to Sean on March 31, 2014 (ecopath_sim_r_v0_04_toSean_31_03_14.zip) Files have been renamed to drop the version number and take advantage of this VCS.
46 changes: 23 additions & 23 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

rk4_run <- function(params, instate, forcing, fishing, stanzas, StartYear, EndYear) {
.Call('_Rpath_rk4_run', PACKAGE = 'Rpath', params, instate, forcing, fishing, stanzas, StartYear, EndYear)
}

Adams_run <- function(params, instate, forcing, fishing, stanzas, StartYear, EndYear, InitDeriv) {
.Call('_Rpath_Adams_run', PACKAGE = 'Rpath', params, instate, forcing, fishing, stanzas, StartYear, EndYear, InitDeriv)
}

deriv_vector <- function(params, state, forcing, fishing, stanzas, inyear, m, tt) {
.Call('_Rpath_deriv_vector', PACKAGE = 'Rpath', params, state, forcing, fishing, stanzas, inyear, m, tt)
}

SplitSetPred <- function(stanzas, state) {
.Call('_Rpath_SplitSetPred', PACKAGE = 'Rpath', stanzas, state)
}

SplitUpdate <- function(stanzas, state, forcing, deriv, yr, mon) {
.Call('_Rpath_SplitUpdate', PACKAGE = 'Rpath', stanzas, state, forcing, deriv, yr, mon)
}

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

rk4_run <- function(params, instate, forcing, fishing, stanzas, StartYear, EndYear) {
.Call('_Rpath_rk4_run', PACKAGE = 'Rpath', params, instate, forcing, fishing, stanzas, StartYear, EndYear)
}

Adams_run <- function(params, instate, forcing, fishing, stanzas, StartYear, EndYear, InitDeriv) {
.Call('_Rpath_Adams_run', PACKAGE = 'Rpath', params, instate, forcing, fishing, stanzas, StartYear, EndYear, InitDeriv)
}

deriv_vector <- function(params, state, forcing, fishing, stanzas, inyear, m, tt) {
.Call('_Rpath_deriv_vector', PACKAGE = 'Rpath', params, state, forcing, fishing, stanzas, inyear, m, tt)
}

SplitSetPred <- function(stanzas, state) {
.Call('_Rpath_SplitSetPred', PACKAGE = 'Rpath', stanzas, state)
}

SplitUpdate <- function(stanzas, state, forcing, deriv, yr, mon) {
.Call('_Rpath_SplitUpdate', PACKAGE = 'Rpath', stanzas, state, forcing, deriv, yr, mon)
}

0 comments on commit 7d24f22

Please sign in to comment.