Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests #82

Merged
merged 308 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
308 commits
Select commit Hold shift + click to select a range
c30b106
test
rklasky Jan 8, 2024
4a8021b
test
rklasky Jan 8, 2024
c8f5f83
test
rklasky Jan 8, 2024
2576c54
test
rklasky Jan 8, 2024
60dab31
test
rklasky Jan 8, 2024
28ae146
test
rklasky Jan 8, 2024
ef576c1
test
rklasky Jan 8, 2024
3fbcb7f
test
rklasky Jan 8, 2024
4a33e58
test
rklasky Jan 9, 2024
5ce628b
test
rklasky Jan 9, 2024
d88b905
test
rklasky Jan 9, 2024
55c59c4
test
rklasky Jan 9, 2024
8735710
test
rklasky Jan 9, 2024
cf66b63
test
rklasky Jan 9, 2024
d8e1d12
test
rklasky Jan 9, 2024
16eaae5
test
rklasky Jan 9, 2024
9e17a8a
test
rklasky Jan 9, 2024
2029496
test
rklasky Jan 9, 2024
79f08d2
test
rklasky Jan 9, 2024
1a0f70c
test
rklasky Jan 9, 2024
7ecb10e
test
rklasky Jan 10, 2024
473425d
save Rplots.pdf
rklasky Jan 11, 2024
5c36406
save Rplots.pdf
rklasky Jan 11, 2024
31b39b5
test
rklasky Jan 11, 2024
e05f3ee
test
rklasky Jan 11, 2024
c50899a
regenerated r-cmd-check yaml file
rklasky Jan 11, 2024
5c484ce
test
rklasky Jan 11, 2024
c1e83c6
test
rklasky Jan 12, 2024
03adef2
test
rklasky Jan 12, 2024
be212e9
test
rklasky Jan 12, 2024
6bf76a8
test
rklasky Jan 12, 2024
88ff4ef
test
rklasky Jan 12, 2024
40d78f1
test putting baseiine in current
rklasky Jan 12, 2024
0d8eded
test
rklasky Jan 12, 2024
ec296b5
moved baseline into tests/testthat/data/input/current folder
rklasky Jan 12, 2024
1b8cf0c
test
rklasky Jan 12, 2024
482c10c
test
rklasky Jan 12, 2024
5b25ccf
test
rklasky Jan 13, 2024
18ace25
test without Adu and Juv for now
rklasky Jan 13, 2024
3ab75af
test without adu and juv
rklasky Jan 13, 2024
ab89817
test w/o adu and juv
rklasky Jan 13, 2024
fe85ce4
test
rklasky Jan 13, 2024
04b5ba0
updating 5 baseline files
rklasky Jan 13, 2024
714e3ca
updated more baseline files
rklasky Jan 13, 2024
4c6fbde
updated more baseline files
rklasky Jan 13, 2024
700fa10
test
rklasky Jan 13, 2024
5cf6229
removed all baseline files
rklasky Jan 13, 2024
52281ff
regenerated
rklasky Jan 13, 2024
20d30fb
cleaning
rklasky Jan 13, 2024
6e33cce
regenerating
rklasky Jan 13, 2024
0f153cd
regenerating
rklasky Jan 13, 2024
c82668f
moved input files up a level
rklasky Jan 13, 2024
cb30671
updated baseline input dir
rklasky Jan 13, 2024
e5ef0c6
fixed warning and updated path
rklasky Jan 13, 2024
76111ba
test
rklasky Jan 13, 2024
22a067a
testing
rklasky Jan 13, 2024
1c58ca3
testing
rklasky Jan 13, 2024
d5b2ed3
test
rklasky Jan 13, 2024
5702efd
test
rklasky Jan 13, 2024
70f285c
test
rklasky Jan 13, 2024
5f81b6f
test
rklasky Jan 13, 2024
96268f8
test
rklasky Jan 13, 2024
37040c9
test
rklasky Jan 13, 2024
fc1d84c
test 1:50
rklasky Jan 13, 2024
9376be3
test 1:52
rklasky Jan 13, 2024
813b441
test 2:19
rklasky Jan 13, 2024
df5341e
test 2:21
rklasky Jan 13, 2024
e3374d1
test 2:22
rklasky Jan 13, 2024
bed5d4c
test 2:23
rklasky Jan 13, 2024
7bfc929
refreshing baseline files
rklasky Jan 13, 2024
781e5f5
new baseline files 4:11
rklasky Jan 13, 2024
ffac7d9
test update test-rpath.R
rklasky Jan 13, 2024
28ffd97
test 8:12
rklasky Jan 14, 2024
f277816
updated
rklasky Jan 14, 2024
857ebd6
updated
rklasky Jan 14, 2024
7eaaa3f
Added zero table logic
rklasky Jan 14, 2024
fd3828e
replacing baseline files
rklasky Jan 14, 2024
70130a8
refreshed baseline files 10:57
rklasky Jan 14, 2024
310054b
refreshing baseline files 11:19
rklasky Jan 14, 2024
f127775
testing with diffTable == zeroTable
rklasky Jan 14, 2024
3a87cf7
comparing with NA's instead of 0's
rklasky Jan 14, 2024
524b33e
comparing with 1's
rklasky Jan 14, 2024
f8a7fae
forcing fist col to numeric
rklasky Jan 14, 2024
7f3374d
more testing
rklasky Jan 14, 2024
daa8b52
removed table headers before expect_equal
rklasky Jan 15, 2024
010d7ff
reading table differently
rklasky Jan 15, 2024
bf842a2
testing expect_identical
rklasky Jan 15, 2024
57f9391
yet another test
rklasky Jan 15, 2024
761c587
testing data frames
rklasky Jan 15, 2024
d69b58c
trying setdiff
rklasky Jan 15, 2024
cf641a7
using identical and expect_true instead of expect_equal
rklasky Jan 15, 2024
572e723
test printing out column totals
rklasky Jan 17, 2024
f40c76b
testing different col sums
rklasky Jan 17, 2024
dad4d86
testing with set.seed(1)
rklasky Jan 17, 2024
b2bb81d
testing with row sums (n = 100)
rklasky Jan 17, 2024
26e71ad
read.table header=TRUE
rklasky Jan 17, 2024
36b4031
modified read.table
rklasky Jan 17, 2024
5d2aef8
re-testing total columns
rklasky Jan 17, 2024
b189dee
testing jitter functon
rklasky Jan 18, 2024
765e7e4
added colSums for ForcedMatris
rklasky Jan 18, 2024
74e65c5
more tests with jitter
rklasky Jan 18, 2024
b5dcde3
used NULL instead of 0 in jitter()
rklasky Jan 18, 2024
c2cb941
trying tot vec
rklasky Jan 19, 2024
82875c8
using own jitter test2
rklasky Jan 19, 2024
c11a54c
own jitter #2
rklasky Jan 19, 2024
98af3c3
testing with randomNumber() function
rklasky Jan 19, 2024
19c3cff
added debug stmt
rklasky Jan 19, 2024
263baa9
changed jitter() to a custom random function
rklasky Jan 19, 2024
13b047c
added custome random function
rklasky Jan 19, 2024
b8c7828
baseline files regenerated with new random function
rklasky Jan 19, 2024
7bb84d6
more testing
rklasky Jan 19, 2024
6239680
debug statement
rklasky Jan 19, 2024
54804f0
checking tot rand val
rklasky Jan 19, 2024
bc14ef1
added tot value
rklasky Jan 19, 2024
670c5c0
using options digits=22
rklasky Jan 19, 2024
a8e62c7
rounding value
rklasky Jan 19, 2024
1d7f3e5
regen'd all files
rklasky Jan 19, 2024
e5e7b86
col totals
rklasky Jan 19, 2024
ab6a7b1
removed jitter
rklasky Jan 20, 2024
bf09af8
more tests
rklasky Jan 20, 2024
fae7e54
changed RK4 to AB for testing
rklasky Jan 20, 2024
2f43a41
put random back in
rklasky Jan 20, 2024
75762c7
testing all with RK4=AB
rklasky Jan 20, 2024
689a72c
sat test 1
rklasky Jan 20, 2024
501ca89
added more rounding
rklasky Jan 21, 2024
c0e2042
changed RK4 to AB and regen'd baseline files
rklasky Jan 21, 2024
eb4f461
removed last round()
rklasky Jan 21, 2024
5e5e05c
running tests before jitter
rklasky Jan 21, 2024
dd019ca
running with jitter commented out
rklasky Jan 21, 2024
42434e4
running with re-defining scene
rklasky Jan 21, 2024
99fb9d5
running with scene inside loop
rklasky Jan 21, 2024
9148278
running with forcingOriginalData inside loop
rklasky Jan 21, 2024
cafccaf
comented out the scene stmt to see if I get more than 2 error
rklasky Jan 21, 2024
3eb84de
moved jitter = scene line to before loop to see if I get more than 2 …
rklasky Jan 21, 2024
734f507
using the copy command, less than 4 errors?
rklasky Jan 21, 2024
0276a10
commented out unused statements, should have <= 2 errors
rklasky Jan 21, 2024
0ec3c23
extended logic to next loop; should be 4 errors now
rklasky Jan 22, 2024
ffe8d1c
Did this make a difference? Should still have 2 errors.
rklasky Jan 22, 2024
05272d4
added modified lines, still have 2 errors?
rklasky Jan 22, 2024
493d8fe
added copy() in modifyForcingMatrix function, still 2 errors?
rklasky Jan 22, 2024
07fc958
added round() to modifiedBio
rklasky Jan 22, 2024
b87d469
added 2 more copy() commands, still 2 errors?
rklasky Jan 22, 2024
637663a
testing commenting out AB lines to see if RK4 lines work
rklasky Jan 22, 2024
298dd93
refactoring names and commenting out some AB code
rklasky Jan 22, 2024
9b05b8d
rerunning the push to see if commenting out made a difference
rklasky Jan 22, 2024
ff0faaa
trying moving code around
rklasky Jan 22, 2024
bb5f28d
another test
rklasky Jan 22, 2024
64bd34d
trying small test
rklasky Jan 22, 2024
cb07f02
trying a small test
rklasky Jan 22, 2024
478f641
commented out modifiedBio
rklasky Jan 22, 2024
95b0f29
commented in modifiedBio
rklasky Jan 22, 2024
1bdb795
refactoring modifyForcingMatrix()
rklasky Jan 23, 2024
651eb5a
added 2 copy() commands
rklasky Jan 23, 2024
632ac1f
Took out createJItterVectorFromValue()
rklasky Jan 23, 2024
51d561c
testing with a new matrix
rklasky Jan 23, 2024
6e63a86
using jitter()
rklasky Jan 23, 2024
4852448
new ii jitter logic
rklasky Jan 23, 2024
d492b47
trying randomNumber() logic
rklasky Jan 23, 2024
ffe37d5
testing with set.seed
rklasky Jan 23, 2024
5486104
testing before/after snippet
rklasky Jan 23, 2024
04da894
testing before/after code snippet
rklasky Jan 23, 2024
e55e1d7
testing before/after code snippet
rklasky Jan 23, 2024
4b94c91
removed *.png from .gitignore since there are png files in the vignettes
rklasky Jan 23, 2024
b75e731
using rds files for RK4 test
rklasky Jan 23, 2024
a6202ce
testing rds
rklasky Jan 23, 2024
24e89f0
testing rds #2
rklasky Jan 24, 2024
a56950f
testing rds 2
rklasky Jan 24, 2024
7228c97
testing rds 3 - print diffTable
rklasky Jan 24, 2024
4bb839e
testing rds 3 - printing diffTable
rklasky Jan 24, 2024
47bc8ec
using .rds for all dat files
rklasky Jan 24, 2024
c7ff18f
changed summary from .rds to .dat
rklasky Jan 24, 2024
4be5f40
using runTestRDS
rklasky Jan 24, 2024
ef960c4
used saveRDS() instead of write.Rsim() for BaselineAB and BaselineRK4
rklasky Jan 24, 2024
2edc51c
put write.Rsim back in and added tot rand val
rklasky Jan 24, 2024
d5ba415
fixed tot rand val and added speciesBiomass print
rklasky Jan 24, 2024
44fcc5a
added totSpeciesBiomass
rklasky Jan 24, 2024
2809145
Added SUM print statements
rklasky Jan 24, 2024
6ddec98
Added another rsim.scenario which shouldn't make any difference
rklasky Jan 25, 2024
5873440
adjusted arguments of runTestRDS()
rklasky Jan 25, 2024
7d182da
re-testing "no fail" case
rklasky Jan 25, 2024
b3bb9d2
randomNumber() code back in with one line commented out
rklasky Jan 25, 2024
e7df50e
uncommented one line
rklasky Jan 25, 2024
a3f6265
testing using temp matrix mat
rklasky Jan 25, 2024
0d7b87c
undid mat test
rklasky Jan 25, 2024
76dc72e
renamed env vars
rklasky Jan 26, 2024
d246745
renamed env vars and did a clean/install
rklasky Jan 26, 2024
c3e7bc9
renamed env vars and did a clean install
rklasky Jan 26, 2024
791aa80
renamed env vars and did a clean install
rklasky Jan 26, 2024
4ed88bf
added new jitterMatrixColumns()
rklasky Jan 26, 2024
7ed4169
commenting out sim run
rklasky Jan 26, 2024
f3f1af5
commented out lines
rklasky Jan 26, 2024
eff6263
re-running tests
rklasky Jan 26, 2024
cde0b18
Added all baseline files
rklasky Jan 27, 2024
b106084
updated data files
rklasky Jan 27, 2024
1752fcd
update data files
rklasky Jan 27, 2024
bd6953d
checking with AB code commented out
rklasky Jan 27, 2024
d800f41
should be a lot off
rklasky Jan 27, 2024
d3de562
added another rpath() call
rklasky Jan 27, 2024
acf6bcc
testing with one line commented out
rklasky Jan 27, 2024
53888ec
test all code
rklasky Jan 27, 2024
ea27d45
trying default case
rklasky Jan 27, 2024
6a2e8d6
updated seed offset
rklasky Jan 27, 2024
1677cc8
removed setwd() commands
rklasky Jan 27, 2024
5869d09
added more print statements
rklasky Jan 27, 2024
322571d
added more print statements
rklasky Jan 27, 2024
7085d49
added print function
rklasky Jan 27, 2024
314b329
added sim print
rklasky Jan 28, 2024
bbe1874
added more print statements
rklasky Jan 28, 2024
2b3052b
rounding to 6 places
rklasky Jan 28, 2024
4e2b32a
moved a couple lines
rklasky Jan 28, 2024
a59ae92
moved a couple lines
rklasky Jan 28, 2024
728f7a0
print out col sums
rklasky Jan 28, 2024
62e98aa
removed [,-1] bug
rklasky Jan 28, 2024
26c07ab
modified print statements
rklasky Jan 28, 2024
5463cbd
replace rds logic with dat logic as rds files shouldn't be used acros…
rklasky Jan 28, 2024
f718dd8
added diffTable logic
rklasky Jan 28, 2024
e393d44
more print statements
rklasky Jan 28, 2024
6271516
trying with sum function
rklasky Jan 28, 2024
d221bfb
added sumDiffTable
rklasky Jan 28, 2024
df89781
testing
rklasky Jan 29, 2024
a3769c1
added more print statements for sumDiffTable logic
rklasky Jan 29, 2024
cc13f58
Uncommented more tests
rklasky Jan 29, 2024
332bcda
uncommented all tests
rklasky Jan 29, 2024
50b8f66
added better matrix() logic
rklasky Jan 29, 2024
a61b0f1
added more tests
rklasky Jan 29, 2024
3ba61b4
testing with checkout v3
rklasky Jan 29, 2024
ac870b3
updated compiler setting in yml file
rklasky Feb 1, 2024
5d8d616
trying to add an optimization on gcc
rklasky Feb 1, 2024
a545388
Using .rds format for data files again
rklasky Feb 2, 2024
f90c8cb
Adding back in macos and windows
rklasky Feb 2, 2024
74c5100
updated yml
rklasky Feb 4, 2024
bb0e34b
updated tests.yml file for versions
rklasky Feb 7, 2024
7f6e36f
updated yml
rklasky Feb 7, 2024
caf3614
updated yml
rklasky Feb 7, 2024
db848b0
only run tests on ubuntu
rklasky Feb 7, 2024
a64a4ed
updated yml again
rklasky Feb 7, 2024
0980a6c
fixed runs-on line in yml file
rklasky Feb 7, 2024
2ddce11
modified yml
rklasky Feb 7, 2024
00cc259
updated yml again
rklasky Feb 7, 2024
0360535
Separating large test file
rklasky Feb 17, 2024
fae121b
Updated unit tests
rklasky Apr 8, 2024
6b81275
First commit to dev of UnitTests branch
Apr 10, 2024
6d6775e
Merge branch 'dev' into UnitTests
rklasky Apr 11, 2024
49a810b
Added linux check for sudo commands
rklasky Apr 11, 2024
0629925
Merge branch 'UnitTests' of https://github.com/NOAA-EDAB/Rpath into U…
rklasky Apr 11, 2024
8bc5b7a
Created new baseline files
rklasky Apr 12, 2024
470b436
Temporarily changed for new baseline file generation
rklasky Apr 12, 2024
004aeb9
added debug statement
rklasky Apr 12, 2024
5e42ef7
debug stmt
rklasky Apr 12, 2024
8cf3e3d
Commented out some tests
rklasky Apr 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 2 additions & 2 deletions .github/workflows/secretScan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ 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.yml
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 [email protected]
# 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
17 changes: 14 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
.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_*.csv
tests/testthat/old/*
tests/testthat/bkup/*
tests/testthat/old dat files/*
docs
Rpath.Rproj
doc
Meta
Rpath.Rproj
82 changes: 48 additions & 34 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,34 +1,48 @@
Package: Rpath
Type: Package
Title: R implementation of Ecopath with Ecosim
Version: 0.0.1.2
Date: 2016-07-15
Authors@R: c(
person("Kerim", "Aydin", email = "[email protected]", role = "aut"),
person("Sean", "Lucey", email = "[email protected]",
role = c("aut", "cre")),
person("Sarah", "Gaichas", email = "[email protected]", role = "aut"))
Description: This package implements the core mass balance equations made popular
by Ecopath with Ecosim. There are two parts to the package, the static snapshot
of energy flow through the system using rpath and dynamic simulations run using
the rsim family of functions.
License: file LICENSE
Encoding: UTF-8
Imports:
data.table,
graphics,
grDevices,
MASS,
Rcpp (>= 0.11.3),
stats,
utils
LinkingTo: Rcpp
Suggests:
knitr,
rmarkdown
VignetteBuilder: knitr
RoxygenNote: 7.1.1
URL: https://github.com/NOAA-EDAB/Rpath
BugReports: https://github.com/NOAA-EDAB/Rpath/issues
Depends:
R (>= 2.10)
Package: Rpath
Type: Package
Title: R implementation of Ecopath with Ecosim
Version: 0.0.1.2
Date: 2016-07-15
Authors@R: c(
person("Kerim", "Aydin", email = "[email protected]", role = "aut"),
person("Sean", "Lucey", email = "[email protected]",
role = c("aut", "cre")),
person("Sarah", "Gaichas", email = "[email protected]", role = "aut"))
Description: This package implements the core mass balance equations made popular
by Ecopath with Ecosim. There are two parts to the package, the static snapshot
of energy flow through the system using rpath and dynamic simulations run using
the rsim family of functions.
License: file LICENSE
Encoding: UTF-8
Imports:
data.table,
methods,
graphics,
grDevices,
MASS,
Rcpp (>= 0.11.3),
stats,
utils
LinkingTo: Rcpp
Suggests:
here,
knitr,
rmarkdown,
distillery,
ggplot2,
ggpubr,
rlist,
stringr,
qpdf,
usethis,
dplyr,
generics,
testthat (>= 3.0.0)
VignetteBuilder: knitr
RoxygenNote: 7.2.3
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 @@ -53,4 +53,5 @@ import(stats)
import(utils)
importFrom(Rcpp,sourceCpp)
importFrom(grDevices,rainbow)
importFrom(methods,is)
useDynLib(Rpath)
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)
}

14 changes: 10 additions & 4 deletions R/Rpath_support.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
library(methods)

########################################################################################
# Set of functions for returning functional group names (character vector)
# using the type input column
#
# Internal supporting function for group names to check type
grouptype <- function(Rpath){
if(class(Rpath)=="Rpath"){gt<-list(type=Rpath$type, grp=Rpath$Group)}
else{
if(class(Rpath)=="Rpath.params"){
#'
#' @importFrom methods is
#'
grouptype <- function(Rpath) {
if (is(Rpath,"Rpath")) {
gt<-list(type=Rpath$type, grp=Rpath$Group)
} else {
if (is(Rpath,"Rpath.params")) {
gt<-list(type=Rpath$model$Type, grp=Rpath$model$Group)}
else{
stop("Input must be an Rpath (balanced) or Rpath.params (unbalanced) object.")
Expand Down
Loading
Loading