USEPA / CompTox-ToxCast-tcplFit2

Performs basic concentration response curve fitting
https://cran.r-project.org/package=tcplfit2
Other
1 stars 0 forks source link

63 create unit tests for htpp global data fit with tcplfit2 #68

Closed gracezhihuizhao closed 6 months ago

gracezhihuizhao commented 7 months ago

This PR includes:

  1. An R script documenting how I selected HTPP subsets, stored under data-raw/.
  2. sysdata.rda containing all the data needed for HTPP unit tests.
  3. A unit test for global level HTPP data set up under test-concRespCore.R.
sedavid01 commented 6 months ago

Here are the results from running the unit tests for the package. You may just load the data with R/sysdata.rda or use the here package to call the data you need for the unit test.

testthat::test_local("~/Git/tcplfit2/") ✔ | F W S OK | Context ✖ | 1 1 4 | concRespCore [0.8s]
────────────────────────────────────────────────────────────────────────────────── Warning (test-concRespCore.R:24): HTPP global data internal check cannot open compressed file 'C:/Users/sdavid01/OneDrive - Environmental Protection Agency (EPA)/Profile/Documents/CompTox-ToxCast-tcplFit2/R/sysdata.rda', probable reason 'No such file or directory' Backtrace:

  1. base::load("~/CompTox-ToxCast-tcplFit2/R/sysdata.rda") at test-concRespCore.R:24:2
  2. base::readChar(con, 5L, useBytes = TRUE)

Error (test-concRespCore.R:24): HTPP global data internal check Error in readChar(con, 5L, useBytes = TRUE): cannot open the connection Backtrace:

  1. base::load("~/CompTox-ToxCast-tcplFit2/R/sysdata.rda") at test-concRespCore.R:24:2
  2. base::readChar(con, 5L, useBytes = TRUE) ────────────────────────────────────────────────────────────────────────────────── ✔ | 2 | fitexp2 [0.2s]
    ✔ | 3 | fitexp3 [0.4s]
    ✔ | 2 | fitexp4 [0.1s]
    ✔ | 3 | fitexp5 [0.4s]
    ✔ | 5 | fitgnls [1.2s]
    ✔ | 3 | fithill [0.5s]
    ✔ | 1 | fitpoly1 [0.1s]
    ✔ | 2 | fitpoly2 [0.2s]
    ✔ | 2 | fitpow [0.2s]
    ✔ | 23 | tcplfit2_core [0.7s]
    ✔ | 4 | tcplhit2_core [0.6s]

══ Results ═══════════════════════════════════════════════════════════════════════ Duration: 6.6 s

[ FAIL 1 | WARN 1 | SKIP 0 | PASS 54 ]

sedavid01 commented 6 months ago

The test is still not passing. I tried using 'data' but that also seemed to not be able to call the appropriate file. Suggest continuing to edit and test, may close out the project or have multiple R sessions running (one in the project and one outside the project).

@gracezhihuizhao, still requires some work

sedavid01 commented 6 months ago

Latest update was successful with the test. Approving this pull request and this branch is ready to be merged into 'dev'.

testthat::test_local("~/Git/tcplfit2/") ✔ | F W S OK | Context ✔ | 11 | concRespCore [6.5s]
✔ | 2 | fitexp2 [0.3s]
✔ | 3 | fitexp3 [0.6s]
✔ | 2 | fitexp4 [0.2s]
✔ | 3 | fitexp5 [0.6s]
✔ | 5 | fitgnls [2.2s]
✔ | 3 | fithill [0.7s]
✔ | 1 | fitpoly1 [0.1s]
✔ | 2 | fitpoly2 [0.3s]
✔ | 2 | fitpow [0.4s]
✔ | 23 | tcplfit2_core [1.0s]
✔ | 4 | tcplhit2_core [0.7s]

══ Results ═══════════════════════════════════════════════════════════════════════ Duration: 14.5 s

[ FAIL 0 | WARN 0 | SKIP 0 | PASS 61 ] Warning message: package ‘testthat’ was built under R version 4.2.2

sedavid01 commented 6 months ago

@brown-jason, changes are merged to 'master' please verify when you get the chance and if any branch clean-up is needed please either do so or provide guidance/instructions. Thanks, -Sarah