DOI-USGS / streamMetabolizer

streamMetabolizer uses inverse modeling to estimate aquatic metabolism (photosynthesis and respiration) from time series data on dissolved oxygen, water temperature, depth, and light.
http://usgs-r.github.io/streamMetabolizer/
Other
37 stars 22 forks source link

debug metab_Kmodel for 9/16 refactor #234

Closed aappling-usgs closed 8 years ago

aappling-usgs commented 8 years ago

make sure the test suite is sufficient and passing

aappling-usgs commented 8 years ago

Pretty close. Most recent test results:

==> devtools::test()

Loading streamMetabolizer
Loading required package: testthat
This package is in development. We are using it for our own early applications and welcome flexible, resilient new users who can help us make the package better. Details of the user interface and model implementations will change. Please give us feedback at https://github.com/USGS-R/streamMetabolizer/issues/new.

This information is preliminary or provisional and is subject to revision. It is being provided to meet the need for timely best science. The information has not received final approval by the U.S. Geological Survey (USGS) and is provided on the condition that neither the USGS nor the U.S. Government shall be held liable for any damages resulting from the authorized or unauthorized use of the information. Although this software program has been used by the USGS, no warranty, expressed or implied, is made by the USGS or the U.S. Government as to the accuracy and functioning of the program and related program material nor shall the fact of distribution constitute any such warranty, and no responsibility is assumed by the USGS in connection therewith.

Attaching package: 'dplyr'

The following object is masked from 'package:testthat':

    matches

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

Testing streamMetabolizer
calc_depth: ........
calc_DO: ..............
calc_light: ..................
conversion functions: .................................................................
french creek data: ......................starting worker pid=6380 on localhost:11441 at 11:22:03.342
starting worker pid=10988 on localhost:11441 at 11:22:03.562
starting worker pid=7644 on localhost:11441 at 11:22:03.793
starting worker pid=5140 on localhost:11441 at 11:22:04.053

SAMPLING FOR MODEL 'b_np_oi_eu_plrckm' NOW (CHAIN 1).

Chain 1, Iteration:   1 / 700 [  0%]  (Warmup)
Chain 1, Iteration:  70 / 700 [ 10%]  (Warmup)
SAMPLING FOR MODEL 'b_np_oi_eu_plrckm' NOW (CHAIN 2).

Chain 2, Iteration:   1 / 700 [  0%]  (Warmup)
Chain 1, Iteration: 140 / 700 [ 20%]  (Warmup)
SAMPLING FOR MODEL 'b_np_oi_eu_plrckm' NOW (CHAIN 3).

Chain 3, Iteration:   1 / 700 [  0%]  (Warmup)
Chain 1, Iteration: 210 / 700 [ 30%]  (Warmup)
Chain 2, Iteration:  70 / 700 [ 10%]  (Warmup)
Chain 1, Iteration: 280 / 700 [ 40%]  (Warmup)
Chain 3, Iteration:  70 / 700 [ 10%]  (Warmup)
Chain 2, Iteration: 140 / 700 [ 20%]  (Warmup)
Chain 1, Iteration: 350 / 700 [ 50%]  (Warmup)
SAMPLING FOR MODEL 'b_np_oi_eu_plrckm' NOW (CHAIN 4).

Chain 4, Iteration:   1 / 700 [  0%]  (Warmup)
Chain 2, Iteration: 210 / 700 [ 30%]  (Warmup)
Chain 1, Iteration: 420 / 700 [ 60%]  (Warmup)
Chain 3, Iteration: 140 / 700 [ 20%]  (Warmup)
Chain 2, Iteration: 280 / 700 [ 40%]  (Warmup)
Chain 4, Iteration:  70 / 700 [ 10%]  (Warmup)
Chain 3, Iteration: 210 / 700 [ 30%]  (Warmup)
Chain 1, Iteration: 490 / 700 [ 70%]  (Warmup)
Chain 2, Iteration: 350 / 700 [ 50%]  (Warmup)
Chain 1, Iteration: 501 / 700 [ 71%]  (Sampling)
Chain 3, Iteration: 280 / 700 [ 40%]  (Warmup)
Chain 2, Iteration: 420 / 700 [ 60%]  (Warmup)
Chain 4, Iteration: 140 / 700 [ 20%]  (Warmup)
Chain 1, Iteration: 570 / 700 [ 81%]  (Sampling)
Chain 3, Iteration: 350 / 700 [ 50%]  (Warmup)
Chain 2, Iteration: 490 / 700 [ 70%]  (Warmup)
Chain 1, Iteration: 640 / 700 [ 91%]  (Sampling)
Chain 2, Iteration: 501 / 700 [ 71%]  (Sampling)
Chain 4, Iteration: 210 / 700 [ 30%]  (Warmup)
Chain 3, Iteration: 420 / 700 [ 60%]  (Warmup)
Chain 1, Iteration: 700 / 700 [100%]  (Sampling)
 Elapsed Time: 2.451 seconds (Warm-up)
               0.868 seconds (Sampling)
               3.319 seconds (Total)

[1] "The following numerical problems occured the indicated number of times after warmup on chain 1"
                                                                                            count
Exception thrown at line 83: normal_log: Location parameter[1] is inf, but must be finite!      6
Exception thrown at line 83: normal_log: Location parameter[1] is -inf, but must be finite!     2
[1] "When a numerical problem occurs, the Hamiltonian proposal gets rejected."
[1] "If the number in the 'count' column is small,  do not ask about this message on stan-users."

Chain 2, Iteration: 570 / 700 [ 81%]  (Sampling)
Chain 3, Iteration: 490 / 700 [ 70%]  (Warmup)
Chain 3, Iteration: 501 / 700 [ 71%]  (Sampling)
Chain 4, Iteration: 280 / 700 [ 40%]  (Warmup)
Chain 2, Iteration: 640 / 700 [ 91%]  (Sampling)
Chain 3, Iteration: 570 / 700 [ 81%]  (Sampling)
Chain 4, Iteration: 350 / 700 [ 50%]  (Warmup)
Chain 2, Iteration: 700 / 700 [100%]  (Sampling)
 Elapsed Time: 2.531 seconds (Warm-up)
               0.855 seconds (Sampling)
               3.386 seconds (Total)

[1] "The following numerical problems occured the indicated number of times after warmup on chain 2"
                                                                                            count
Exception thrown at line 83: normal_log: Location parameter[1] is -inf, but must be finite!     5
Exception thrown at line 83: normal_log: Location parameter[1] is inf, but must be finite!      5
[1] "When a numerical problem occurs, the Hamiltonian proposal gets rejected."
[1] "If the number in the 'count' column is small,  do not ask about this message on stan-users."

Chain 3, Iteration: 640 / 700 [ 91%]  (Sampling)
Chain 4, Iteration: 420 / 700 [ 60%]  (Warmup)
Chain 3, Iteration: 700 / 700 [100%]  (Sampling)
 Elapsed Time: 2.314 seconds (Warm-up)
               0.843 seconds (Sampling)
               3.157 seconds (Total)

[1] "The following numerical problems occured the indicated number of times after warmup on chain 3"
                                                                                            count
Exception thrown at line 83: normal_log: Location parameter[1] is inf, but must be finite!      8
Exception thrown at line 83: normal_log: Location parameter[1] is -inf, but must be finite!     3
[1] "When a numerical problem occurs, the Hamiltonian proposal gets rejected."
[1] "If the number in the 'count' column is small,  do not ask about this message on stan-users."

Chain 4, Iteration: 490 / 700 [ 70%]  (Warmup)
Chain 4, Iteration: 501 / 700 [ 71%]  (Sampling)
Chain 4, Iteration: 570 / 700 [ 81%]  (Sampling)
Chain 4, Iteration: 640 / 700 [ 91%]  (Sampling)
Chain 4, Iteration: 700 / 700 [100%]  (Sampling)
 Elapsed Time: 2.802 seconds (Warm-up)
               0.707 seconds (Sampling)
               3.509 seconds (Total)

[1] "The following numerical problems occured the indicated number of times after warmup on chain 4"
                                                                                            count
Exception thrown at line 83: normal_log: Location parameter[1] is inf, but must be finite!      8
Exception thrown at line 83: normal_log: Location parameter[1] is -inf, but must be finite!     4
[1] "When a numerical problem occurs, the Hamiltonian proposal gets rejected."
[1] "If the number in the 'count' column is small,  do not ask about this message on stan-users."
...
get_params: ........................starting worker pid=4444 on localhost:11441 at 11:22:54.307
starting worker pid=6512 on localhost:11441 at 11:22:54.497
starting worker pid=1072 on localhost:11441 at 11:22:54.690
starting worker pid=5948 on localhost:11441 at 11:22:54.879

SAMPLING FOR MODEL 'b_np_oipi_tr_plrckm' NOW (CHAIN 1).
WARNING: The initial buffer, adaptation window, and terminal buffer
         overflow the total number of warmup iterations.
         Defaulting to a 15%/75%/10% partition,
           init_buffer = 15
           adapt_window = 75
           term_buffer = 10

Chain 1, Iteration:   1 / 200 [  0%]  (Warmup)
Chain 1, Iteration:  20 / 200 [ 10%]  (Warmup)
Chain 1, Iteration:  40 / 200 [ 20%]  (Warmup)
SAMPLING FOR MODEL 'b_np_oipi_tr_plrckm' NOW (CHAIN 2).
WARNING: The initial buffer, adaptation window, and terminal buffer
         overflow the total number of warmup iterations.
         Defaulting to a 15%/75%/10% partition,
           init_buffer = 15
           adapt_window = 75
           term_buffer = 10

Chain 2, Iteration:   1 / 200 [  0%]  (Warmup)
Chain 1, Iteration:  60 / 200 [ 30%]  (Warmup)
Chain 2, Iteration:  20 / 200 [ 10%]  (Warmup)
Chain 1, Iteration:  80 / 200 [ 40%]  (Warmup)
Chain 2, Iteration:  40 / 200 [ 20%]  (Warmup)
Chain 1, Iteration: 100 / 200 [ 50%]  (Warmup)
Chain 1, Iteration: 101 / 200 [ 50%]  (Sampling)
SAMPLING FOR MODEL 'b_np_oipi_tr_plrckm' NOW (CHAIN 3).
WARNING: The initial buffer, adaptation window, and terminal buffer
         overflow the total number of warmup iterations.
         Defaulting to a 15%/75%/10% partition,
           init_buffer = 15
           adapt_window = 75
           term_buffer = 10

Chain 3, Iteration:   1 / 200 [  0%]  (Warmup)
Chain 1, Iteration: 120 / 200 [ 60%]  (Sampling)
Chain 2, Iteration:  60 / 200 [ 30%]  (Warmup)
Chain 3, Iteration:  20 / 200 [ 10%]  (Warmup)
Chain 1, Iteration: 140 / 200 [ 70%]  (Sampling)
Chain 2, Iteration:  80 / 200 [ 40%]  (Warmup)
Chain 3, Iteration:  40 / 200 [ 20%]  (Warmup)
Chain 1, Iteration: 160 / 200 [ 80%]  (Sampling)
Chain 2, Iteration: 100 / 200 [ 50%]  (Warmup)
Chain 2, Iteration: 101 / 200 [ 50%]  (Sampling)
Chain 1, Iteration: 180 / 200 [ 90%]  (Sampling)
SAMPLING FOR MODEL 'b_np_oipi_tr_plrckm' NOW (CHAIN 4).
WARNING: The initial buffer, adaptation window, and terminal buffer
         overflow the total number of warmup iterations.
         Defaulting to a 15%/75%/10% partition,
           init_buffer = 15
           adapt_window = 75
           term_buffer = 10

Chain 4, Iteration:   1 / 200 [  0%]  (Warmup)
Chain 3, Iteration:  60 / 200 [ 30%]  (Warmup)
Chain 2, Iteration: 120 / 200 [ 60%]  (Sampling)
Chain 1, Iteration: 200 / 200 [100%]  (Sampling)
 Elapsed Time: 1.072 seconds (Warm-up)
               0.929 seconds (Sampling)
               2.001 seconds (Total)

Chain 4, Iteration:  20 / 200 [ 10%]  (Warmup)
Chain 3, Iteration:  80 / 200 [ 40%]  (Warmup)
Chain 2, Iteration: 140 / 200 [ 70%]  (Sampling)
Chain 4, Iteration:  40 / 200 [ 20%]  (Warmup)
Chain 3, Iteration: 100 / 200 [ 50%]  (Warmup)
Chain 3, Iteration: 101 / 200 [ 50%]  (Sampling)
Chain 2, Iteration: 160 / 200 [ 80%]  (Sampling)
Chain 4, Iteration:  60 / 200 [ 30%]  (Warmup)
Chain 3, Iteration: 120 / 200 [ 60%]  (Sampling)
Chain 4, Iteration:  80 / 200 [ 40%]  (Warmup)
Chain 2, Iteration: 180 / 200 [ 90%]  (Sampling)
Chain 3, Iteration: 140 / 200 [ 70%]  (Sampling)
Chain 4, Iteration: 100 / 200 [ 50%]  (Warmup)
Chain 4, Iteration: 101 / 200 [ 50%]  (Sampling)
Chain 2, Iteration: 200 / 200 [100%]  (Sampling)
 Elapsed Time: 1.081 seconds (Warm-up)
               1.295 seconds (Sampling)
               2.376 seconds (Total)

[1] "The following numerical problems occured the indicated number of times after warmup on chain 2"
                                                                                            count
Exception thrown at line 101: normal_log: Location parameter[3] is nan, but must be finite!     1
[1] "When a numerical problem occurs, the Hamiltonian proposal gets rejected."
[1] "If the number in the 'count' column is small,  do not ask about this message on stan-users."

Chain 3, Iteration: 160 / 200 [ 80%]  (Sampling)
Chain 4, Iteration: 120 / 200 [ 60%]  (Sampling)
Chain 4, Iteration: 140 / 200 [ 70%]  (Sampling)
Chain 3, Iteration: 180 / 200 [ 90%]  (Sampling)
Chain 4, Iteration: 160 / 200 [ 80%]  (Sampling)
Chain 3, Iteration: 200 / 200 [100%]  (Sampling)
 Elapsed Time: 1.083 seconds (Warm-up)
               1.279 seconds (Sampling)
               2.362 seconds (Total)

[1] "The following numerical problems occured the indicated number of times after warmup on chain 3"
                                                                                            count
Exception thrown at line 101: normal_log: Location parameter[2] is nan, but must be finite!     1
[1] "When a numerical problem occurs, the Hamiltonian proposal gets rejected."
[1] "If the number in the 'count' column is small,  do not ask about this message on stan-users."

Chain 4, Iteration: 180 / 200 [ 90%]  (Sampling)
Chain 4, Iteration: 200 / 200 [100%]  (Sampling)
 Elapsed Time: 1.036 seconds (Warm-up)
               0.964 seconds (Sampling)
               2 seconds (Total)

[1] "The following numerical problems occured the indicated number of times after warmup on chain 4"
                                                                                            count
Exception thrown at line 101: normal_log: Location parameter[1] is nan, but must be finite!     2
[1] "When a numerical problem occurs, the Hamiltonian proposal gets rejected."
[1] "If the number in the 'count' column is small,  do not ask about this message on stan-users."
....
hierarchy: 
metab_model class and inheriting classes: ..............
metab_bayes: 
metab_model_helpers: ..............................................
metab_Kmodel: ..........1
metab_mle: ..........................
metab_night: ............2.3..4....
metab_sim: .56............
mm_name: .......................7...
model_by_ply: ..................
predict: ......starting worker pid=7756 on localhost:11441 at 11:24:55.395
starting worker pid=8304 on localhost:11441 at 11:24:55.600
starting worker pid=8336 on localhost:11441 at 11:24:55.814
starting worker pid=276 on localhost:11441 at 11:24:56.033

SAMPLING FOR MODEL 'b_np_oipi_tr_plrckm' NOW (CHAIN 1).
WARNING: The initial buffer, adaptation window, and terminal buffer
         overflow the total number of warmup iterations.
         Defaulting to a 15%/75%/10% partition,
           init_buffer = 15
           adapt_window = 75
           term_buffer = 10

Chain 1, Iteration:   1 / 200 [  0%]  (Warmup)
Chain 1, Iteration:  20 / 200 [ 10%]  (Warmup)
Chain 1, Iteration:  40 / 200 [ 20%]  (Warmup)
SAMPLING FOR MODEL 'b_np_oipi_tr_plrckm' NOW (CHAIN 2).
WARNING: The initial buffer, adaptation window, and terminal buffer
         overflow the total number of warmup iterations.
         Defaulting to a 15%/75%/10% partition,
           init_buffer = 15
           adapt_window = 75
           term_buffer = 10

Chain 2, Iteration:   1 / 200 [  0%]  (Warmup)
Chain 1, Iteration:  60 / 200 [ 30%]  (Warmup)
Chain 1, Iteration:  80 / 200 [ 40%]  (Warmup)
Chain 2, Iteration:  20 / 200 [ 10%]  (Warmup)
Chain 1, Iteration: 100 / 200 [ 50%]  (Warmup)
Chain 1, Iteration: 101 / 200 [ 50%]  (Sampling)
Chain 2, Iteration:  40 / 200 [ 20%]  (Warmup)
SAMPLING FOR MODEL 'b_np_oipi_tr_plrckm' NOW (CHAIN 3).
WARNING: The initial buffer, adaptation window, and terminal buffer
         overflow the total number of warmup iterations.
         Defaulting to a 15%/75%/10% partition,
           init_buffer = 15
           adapt_window = 75
           term_buffer = 10

Chain 3, Iteration:   1 / 200 [  0%]  (Warmup)
Chain 1, Iteration: 120 / 200 [ 60%]  (Sampling)
Chain 3, Iteration:  20 / 200 [ 10%]  (Warmup)
Chain 2, Iteration:  60 / 200 [ 30%]  (Warmup)
Chain 1, Iteration: 140 / 200 [ 70%]  (Sampling)
Chain 2, Iteration:  80 / 200 [ 40%]  (Warmup)
Chain 3, Iteration:  40 / 200 [ 20%]  (Warmup)
Chain 2, Iteration: 100 / 200 [ 50%]  (Warmup)
Chain 2, Iteration: 101 / 200 [ 50%]  (Sampling)
Chain 3, Iteration:  60 / 200 [ 30%]  (Warmup)
Chain 1, Iteration: 160 / 200 [ 80%]  (Sampling)
SAMPLING FOR MODEL 'b_np_oipi_tr_plrckm' NOW (CHAIN 4).
WARNING: The initial buffer, adaptation window, and terminal buffer
         overflow the total number of warmup iterations.
         Defaulting to a 15%/75%/10% partition,
           init_buffer = 15
           adapt_window = 75
           term_buffer = 10

Chain 4, Iteration:   1 / 200 [  0%]  (Warmup)
Chain 2, Iteration: 120 / 200 [ 60%]  (Sampling)
Chain 3, Iteration:  80 / 200 [ 40%]  (Warmup)
Chain 1, Iteration: 180 / 200 [ 90%]  (Sampling)
Chain 4, Iteration:  20 / 200 [ 10%]  (Warmup)
Chain 3, Iteration: 100 / 200 [ 50%]  (Warmup)
Chain 2, Iteration: 140 / 200 [ 70%]  (Sampling)
Chain 3, Iteration: 101 / 200 [ 50%]  (Sampling)
Chain 1, Iteration: 200 / 200 [100%]  (Sampling)
 Elapsed Time: 1.058 seconds (Warm-up)
               1.294 seconds (Sampling)
               2.352 seconds (Total)

Chain 3, Iteration: 120 / 200 [ 60%]  (Sampling)
Chain 4, Iteration:  40 / 200 [ 20%]  (Warmup)
Chain 2, Iteration: 160 / 200 [ 80%]  (Sampling)
Chain 3, Iteration: 140 / 200 [ 70%]  (Sampling)
Chain 4, Iteration:  60 / 200 [ 30%]  (Warmup)
Chain 2, Iteration: 180 / 200 [ 90%]  (Sampling)
Chain 3, Iteration: 160 / 200 [ 80%]  (Sampling)
Chain 4, Iteration:  80 / 200 [ 40%]  (Warmup)
Chain 2, Iteration: 200 / 200 [100%]  (Sampling)
 Elapsed Time: 1.139 seconds (Warm-up)
               1.231 seconds (Sampling)
               2.37 seconds (Total)

[1] "The following numerical problems occured the indicated number of times after warmup on chain 2"
                                                                                            count
Exception thrown at line 101: normal_log: Location parameter[3] is nan, but must be finite!     1
[1] "When a numerical problem occurs, the Hamiltonian proposal gets rejected."
[1] "If the number in the 'count' column is small,  do not ask about this message on stan-users."

Chain 3, Iteration: 180 / 200 [ 90%]  (Sampling)
Chain 4, Iteration: 100 / 200 [ 50%]  (Warmup)
Chain 4, Iteration: 101 / 200 [ 50%]  (Sampling)
Chain 3, Iteration: 200 / 200 [100%]  (Sampling)
 Elapsed Time: 1.026 seconds (Warm-up)
               0.947 seconds (Sampling)
               1.973 seconds (Total)

[1] "The following numerical problems occured the indicated number of times after warmup on chain 3"
                                                                                            count
Exception thrown at line 101: normal_log: Location parameter[1] is nan, but must be finite!     1
Exception thrown at line 101: normal_log: Location parameter[2] is nan, but must be finite!     1
[1] "When a numerical problem occurs, the Hamiltonian proposal gets rejected."
[1] "If the number in the 'count' column is small,  do not ask about this message on stan-users."

Chain 4, Iteration: 120 / 200 [ 60%]  (Sampling)
Chain 4, Iteration: 140 / 200 [ 70%]  (Sampling)
Chain 4, Iteration: 160 / 200 [ 80%]  (Sampling)
Chain 4, Iteration: 180 / 200 [ 90%]  (Sampling)
Chain 4, Iteration: 200 / 200 [100%]  (Sampling)
 Elapsed Time: 1.263 seconds (Warm-up)
               1.117 seconds (Sampling)
               2.38 seconds (Total)

[1] "The following numerical problems occured the indicated number of times after warmup on chain 4"
                                                                                            count
Exception thrown at line 101: normal_log: Location parameter[3] is nan, but must be finite!     1
[1] "When a numerical problem occurs, the Hamiltonian proposal gets rejected."
[1] "If the number in the 'count' column is small,  do not ask about this message on stan-users."
....................................

Failed -------------------------------------------------------------------------
1. Error: try a complete PRK-K-PR workflow (@test-metab_Kmodel.R#58) -----------
object 'K600' not found
1: predict_metab(mm1) %>% select(date, K600, K600.lower, K600.upper) at streamMetabolizer/tests/testthat/test-metab_Kmodel.R:58
2: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
3: eval(quote(`_fseq`(`_lhs`)), env, env)
4: eval(expr, envir, enclos)
5: `_fseq`(`_lhs`)
6: freduce(value, `_function_list`)
7: withVisible(function_list[[k]](value))
8: function_list[[k]](value)
9: select(., date, K600, K600.lower, K600.upper)
10: select_(.data, .dots = lazyeval::lazy_dots(...))
11: select_.data.frame(.data, .dots = lazyeval::lazy_dots(...))
12: select_vars_(names(.data), dots)
13: lazyeval::lazy_eval(args, names_list)
14: lapply(x, lazy_eval, data = data)
15: FUN(X[[i]], ...)
16: eval(x$expr, data, x$env)
17: eval(expr, envir, enclos)

2. Failure: day_tests=c('full_day','include_sunset') get handled appropriately (@test-metab_night.R#50) 
predict_metab(metab_night(sp, data = dat))$errors not equal to "data don't include day-night transition; data don't start when expected".
1/1 mismatches
x[1]: NA
y[1]: "data don't include day-night transition; data don't start when expected"

3. Failure: day_tests=c('full_day','include_sunset') get handled appropriately (@test-metab_night.R#57) 
...$NULL not equal to "data don't include day-night transition".
1/1 mismatches
x[1]: NA
y[1]: "data don't include day-night transition"

4. Failure: day_tests=c('full_day','include_sunset') get handled appropriately (@test-metab_night.R#74) 
predict_metab(metab_night(sp, data = dat))$errors not equal to "data don't end when expected".
1/1 mismatches
x[1]: NA
y[1]: "data don't end when expected"

5. Failure: metab_sim predictions (predict_metab, predict_DO) make sense (@test-metab_sim.R#20) 
select(get_params(mm), GPP = GPP.daily, ER = ER.daily) not equal to select(predict_metab(mm), GPP, ER).
Component "GPP": 'is.NA' value mismatch: 1 in current 0 in target

6. Failure: metab_sim predictions (predict_metab, predict_DO) make sense (@test-metab_sim.R#21) 
select(get_params(mm2), GPP = GPP.daily, ER = ER.daily) not equal to select(predict_metab(mm2), GPP, ER).
Component "GPP": 'is.NA' value mismatch: 1 in current 0 in target

7. Failure: specs uses any valid mm_name (@test-mm_name.R#52) ------------------
length(mnames) is not more than 1000. Difference: -117

DONE ===========================================================================
aappling-usgs commented 8 years ago

better:

checking tests ... ERROR
Running the tests in 'tests/testthat.R' failed.
Last 13 lines of output:
  2: get_params.metab_bayes(mm, uncertainty = "none", messages = FALSE)
  3: NextMethod()
  4: get_params.metab_model(mm, uncertainty = "none", messages = FALSE)
  5: stop(paste0("can't find metabolism parameter", if (length(missing.metabs) > 1) "s", 
         " ", paste0(missing.metabs, collapse = ", ")))

  testthat results ================================================================
  OK: 381 SKIPPED: 0 FAILED: 2
  1. Error: French Creek predictions are similar for streamMetabolizer & Bob Hall's code (@test-french.R#94) 
  2. Error: get_params works for each model type, basic GPP & ER equations (@test-get_params.R#70) 

  Error: testthat unit tests failed
  Execution halted

checking R code for possible problems ... WARNING
Found a .Internal call in the following function:
  'create_calc_dDOdt'
with calls to .Internal functions
  'mean'

Packages should not call .Internal(): it is not part of the API, for
use only by R itself and subject to change without notice.

In addition to the above warning(s), found the following notes:

Found the following calls to attach():
File 'streamMetabolizer/R/revise.R':
  attach(specs, warn.conflicts = FALSE)
See section 'Good practice' in '?attach'.

checking re-building of vignette outputs ... WARNING
Error in re-building vignettes:
  ...
Quitting from lines 327-328 (get_started.Rmd) 
Error: processing vignette 'get_started.Rmd' failed with diagnostics:
can't find metabolism parameters GPP.daily, ER.daily, K600.daily
Execution halted

checking installed package size ... NOTE
  installed size is  9.7Mb
  sub-directories of 1Mb or more:
    doc   7.9Mb

checking top-level files ... NOTE
Non-standard files/directories found at top level:
  'man-roxygen' 'temp'

checking dependencies in R code ... NOTE
'library' or 'require' call to 'rstan' in package code.
  Please use :: or requireNamespace() instead.
  See section 'Suggested packages' in the 'Writing R Extensions' manual.
Unexported objects imported by ':::' calls:
  'devtools:::github_resolve_ref' 'devtools:::parse_git_repo'
  See the note in ?`:::` about the use of this operator.

checking for unstated dependencies in vignettes ... NOTE
'library' or 'require' call not declared from: 'rmdformats'
R CMD check results
1 error  | 2 warnings | 4 notes

R CMD check succeeded
aappling-usgs commented 8 years ago

and done - all tests pass, and down to the 3 CHECK-wontfixes described in #248