Skip to content

Commit

Permalink
unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
khufkens committed Jul 25, 2021
1 parent 7485cd4 commit 0bb7e75
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 51 deletions.
82 changes: 31 additions & 51 deletions inst/extdata/ahwahnee_GR_3000_3day_transition_dates.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,36 @@
# ROI ID Number: 3000
# Aggregation period: 3day
# Year min: 2016
# Year max: 2021
# Final Processing Date: 2021-07-19
# Final Processing Time: 02:02:33
# Spline RMSE gcc_mean: 0.00234
# Spline RMSE gcc_50: 0.00246
# Spline RMSE gcc_75: 0.00242
# Spline RMSE gcc_90: 0.00254
# Year max: 2018
# Final Processing Date: 2019-01-14
# Final Processing Time: 15:42:02
# Spline RMSE gcc_mean: 0.00261
# Spline RMSE gcc_50: 0.0028
# Spline RMSE gcc_75: 0.00282
# Spline RMSE gcc_90: 0.00298
#
site,veg_type,roi_id,direction,gcc_value,transition_10,transition_25,transition_50,transition_10_lower_ci,transition_25_lower_ci,transition_50_lower_ci,transition_10_upper_ci,transition_25_upper_ci,transition_50_upper_ci,threshold_10,threshold_25,threshold_50,min_gcc,max_gcc
ahwahnee,GR,3000,rising,gcc_90,2016-02-24,2016-03-05,2016-03-17,2016-02-19,2016-03-03,2016-03-14,2016-02-29,2016-03-07,2016-03-18,0.33685,0.34603,0.36252,0.33086,0.3919
ahwahnee,GR,3000,rising,gcc_90,2017-03-05,2017-03-11,2017-03-19,2017-02-20,2017-03-10,2017-03-18,2017-03-06,2017-03-13,2017-03-20,0.34562,0.35538,0.3725,0.33932,0.40525
ahwahnee,GR,3000,rising,gcc_90,2018-03-31,2018-04-07,2018-04-17,2018-03-29,2018-04-06,2018-04-14,2018-04-02,2018-04-09,2018-04-18,0.33757,0.34815,0.3672,0.33132,0.40002
ahwahnee,GR,3000,rising,gcc_90,2019-03-27,2019-04-03,2019-04-16,2019-03-24,2019-04-02,2019-04-13,2019-03-30,2019-04-06,2019-04-18,0.33638,0.34497,0.36336,0.33002,0.39559
ahwahnee,GR,3000,rising,gcc_90,2020-03-22,2020-04-04,2020-04-20,2020-03-18,2020-04-01,2020-04-17,2020-03-26,2020-04-08,2020-04-22,0.33605,0.34508,0.36118,0.33047,0.39067
ahwahnee,GR,3000,rising,gcc_90,2021-03-18,2021-03-30,2021-04-11,2021-03-10,2021-03-28,2021-04-08,2021-03-23,2021-04-01,2021-04-12,0.33846,0.34683,0.36277,0.33296,0.38953
ahwahnee,GR,3000,rising,gcc_75,2016-02-20,2016-03-04,2016-03-17,2016-02-14,2016-03-02,2016-03-14,2016-02-26,2016-03-07,2016-03-18,0.33449,0.3431,0.35992,0.32864,0.38942
ahwahnee,GR,3000,rising,gcc_75,2017-03-05,2017-03-11,2017-03-20,2017-02-19,2017-03-10,2017-03-18,2017-03-06,2017-03-13,2017-03-21,0.34356,0.35283,0.37189,0.33784,0.40195
ahwahnee,GR,3000,rising,gcc_75,2018-03-31,2018-04-06,2018-04-16,2018-03-29,2018-04-05,2018-04-14,2018-04-02,2018-04-08,2018-04-18,0.3357,0.34441,0.36255,0.32949,0.39512
ahwahnee,GR,3000,rising,gcc_75,2019-03-26,2019-04-03,2019-04-16,2019-03-24,2019-04-02,2019-04-13,2019-03-29,2019-04-05,2019-04-18,0.33401,0.34344,0.36157,0.32824,0.39307
ahwahnee,GR,3000,rising,gcc_75,2020-03-24,2020-04-04,2020-04-19,2020-03-21,2020-04-02,2020-04-17,2020-03-27,2020-04-08,2020-04-21,0.33514,0.34358,0.35897,0.32964,0.38807
ahwahnee,GR,3000,rising,gcc_75,2021-03-17,2021-03-30,2021-04-11,2021-03-08,2021-03-28,2021-04-09,2021-03-22,2021-04-01,2021-04-12,0.33641,0.34483,0.35984,0.3311,0.3872
ahwahnee,GR,3000,rising,gcc_50,2016-02-21,2016-03-05,2016-03-17,2016-02-15,2016-03-03,2016-03-15,2016-02-27,2016-03-08,2016-03-19,0.33254,0.34176,0.35755,0.32691,0.38677
ahwahnee,GR,3000,rising,gcc_50,2017-03-06,2017-03-11,2017-03-20,2017-02-28,2017-03-10,2017-03-18,2017-03-07,2017-03-13,2017-03-21,0.34132,0.34995,0.3682,0.33536,0.39882
ahwahnee,GR,3000,rising,gcc_50,2018-03-30,2018-04-06,2018-04-16,2018-03-29,2018-04-05,2018-04-14,2018-04-02,2018-04-08,2018-04-18,0.33239,0.34231,0.35925,0.327,0.39102
ahwahnee,GR,3000,rising,gcc_50,2019-03-28,2019-04-04,2019-04-16,2019-03-25,2019-04-03,2019-04-14,2019-03-31,2019-04-06,2019-04-18,0.33279,0.3417,0.35826,0.32664,0.38955
ahwahnee,GR,3000,rising,gcc_50,2020-03-25,2020-04-07,2020-04-18,2020-03-20,2020-04-04,2020-04-16,2020-03-30,2020-04-10,2020-04-20,0.33276,0.34119,0.35547,0.32736,0.38297
ahwahnee,GR,3000,rising,gcc_50,2021-03-18,2021-03-29,2021-04-11,2021-03-10,2021-03-27,2021-04-09,2021-03-22,2021-04-01,2021-04-13,0.33399,0.34157,0.35644,0.32869,0.3828
ahwahnee,GR,3000,rising,gcc_mean,2016-02-22,2016-03-04,2016-03-18,2016-02-16,2016-03-02,2016-03-15,2016-02-27,2016-03-08,2016-03-20,0.33269,0.34054,0.35684,0.32706,0.38493
ahwahnee,GR,3000,rising,gcc_mean,2017-03-06,2017-03-11,2017-03-20,2017-03-01,2017-03-10,2017-03-18,2017-03-07,2017-03-13,2017-03-21,0.34031,0.34891,0.3663,0.33457,0.3947
ahwahnee,GR,3000,rising,gcc_mean,2018-03-30,2018-04-06,2018-04-17,2018-03-29,2018-04-05,2018-04-15,2018-04-02,2018-04-08,2018-04-18,0.33207,0.34177,0.35903,0.32671,0.38952
ahwahnee,GR,3000,rising,gcc_mean,2019-03-28,2019-04-04,2019-04-16,2019-03-26,2019-04-02,2019-04-13,2019-03-31,2019-04-06,2019-04-18,0.33223,0.34172,0.35785,0.32649,0.38754
ahwahnee,GR,3000,rising,gcc_mean,2020-03-23,2020-04-05,2020-04-19,2020-03-18,2020-04-03,2020-04-16,2020-03-28,2020-04-09,2020-04-21,0.3319,0.33944,0.35441,0.32664,0.38036
ahwahnee,GR,3000,rising,gcc_mean,2021-03-19,2021-03-30,2021-04-11,2021-03-14,2021-03-28,2021-04-08,2021-03-23,2021-04-01,2021-04-12,0.33346,0.3414,0.35557,0.32861,0.38017
ahwahnee,GR,3000,falling,gcc_90,2020-09-08,2020-08-30,2020-08-04,2020-09-10,2020-09-01,2020-08-09,2020-09-04,2020-08-26,2020-08-02,0.33766,0.34701,0.36285,0.33254,0.39178
ahwahnee,GR,3000,falling,gcc_90,2019-10-03,2019-09-20,2019-08-13,2019-10-04,2019-09-23,2019-08-17,2019-09-29,2019-09-16,2019-08-10,0.33536,0.34515,0.36104,0.33027,0.39142
ahwahnee,GR,3000,falling,gcc_90,2018-10-10,2018-09-20,2018-08-19,2018-10-13,2018-09-22,2018-08-23,2018-10-05,2018-09-16,2018-08-17,0.33909,0.34892,0.36608,0.333,0.39788
ahwahnee,GR,3000,falling,gcc_90,2017-09-25,2017-09-07,2017-06-10,2017-09-27,2017-09-10,2017-06-13,2017-09-21,2017-09-02,2017-06-06,0.34173,0.35115,0.36737,0.33586,0.39842
ahwahnee,GR,3000,falling,gcc_90,2016-07-28,2016-07-08,2016-06-18,2016-08-03,2016-07-16,2016-06-22,2016-07-22,2016-07-01,2016-06-16,0.35142,0.35798,0.3696,0.34713,0.39072
ahwahnee,GR,3000,falling,gcc_75,2020-09-06,2020-08-29,2020-08-05,2020-09-08,2020-08-31,2020-08-10,2020-09-03,2020-08-25,2020-08-02,0.33615,0.34473,0.35987,0.33099,0.38791
ahwahnee,GR,3000,falling,gcc_75,2019-10-05,2019-09-25,2019-08-16,2019-10-07,2019-09-27,2019-08-23,2019-10-03,2019-09-21,2019-08-12,0.33007,0.33981,0.35721,0.32384,0.39012
ahwahnee,GR,3000,falling,gcc_75,2018-10-09,2018-09-19,2018-08-20,2018-10-13,2018-09-21,2018-08-23,2018-10-04,2018-09-15,2018-08-17,0.33782,0.34698,0.36322,0.3316,0.39476
ahwahnee,GR,3000,falling,gcc_75,2017-09-25,2017-09-08,2017-06-12,2017-09-27,2017-09-13,2017-06-16,2017-09-21,2017-09-03,2017-06-10,0.33953,0.34833,0.36361,0.33413,0.39186
ahwahnee,GR,3000,falling,gcc_75,2016-07-29,2016-07-11,2016-06-19,2016-08-04,2016-07-17,2016-06-22,2016-07-23,2016-07-04,2016-06-16,0.34967,0.35604,0.36675,0.34552,0.38764
ahwahnee,GR,3000,falling,gcc_50,2020-09-06,2020-08-30,2020-08-08,2020-09-08,2020-09-01,2020-08-12,2020-09-03,2020-08-27,2020-08-04,0.33208,0.34084,0.35517,0.32734,0.38272
ahwahnee,GR,3000,falling,gcc_50,2019-09-30,2019-09-18,2019-08-11,2019-10-02,2019-09-21,2019-08-16,2019-09-27,2019-09-14,2019-08-07,0.33237,0.34116,0.35652,0.32681,0.38614
ahwahnee,GR,3000,falling,gcc_50,2018-10-11,2018-09-21,2018-08-20,2018-10-14,2018-09-23,2018-08-25,2018-10-06,2018-09-17,2018-08-18,0.33428,0.34323,0.35959,0.32839,0.38961
ahwahnee,GR,3000,falling,gcc_50,2017-09-25,2017-09-09,2017-06-12,2017-09-28,2017-09-13,2017-06-16,2017-09-21,2017-09-04,2017-06-10,0.33659,0.34509,0.35975,0.33125,0.38716
ahwahnee,GR,3000,falling,gcc_50,2016-08-02,2016-07-17,2016-06-19,2016-08-10,2016-07-21,2016-06-23,2016-07-26,2016-07-10,2016-06-17,0.34638,0.35249,0.36428,0.3421,0.3852
ahwahnee,GR,3000,falling,gcc_mean,2020-09-04,2020-08-29,2020-08-09,2020-09-05,2020-08-31,2020-08-13,2020-09-02,2020-08-26,2020-08-06,0.32911,0.33847,0.35346,0.32479,0.38144
ahwahnee,GR,3000,falling,gcc_mean,2019-09-30,2019-09-18,2019-08-08,2019-10-02,2019-09-21,2019-08-12,2019-09-27,2019-09-15,2019-08-05,0.33231,0.34111,0.35595,0.32688,0.38398
ahwahnee,GR,3000,falling,gcc_mean,2018-10-12,2018-09-23,2018-08-19,2018-10-15,2018-09-25,2018-08-25,2018-10-08,2018-09-20,2018-07-29,0.33311,0.34169,0.35808,0.32703,0.38852
ahwahnee,GR,3000,falling,gcc_mean,2017-09-24,2017-09-06,2017-06-13,2017-09-27,2017-09-09,2017-06-17,2017-09-18,2017-09-02,2017-06-10,0.33661,0.34483,0.35884,0.33154,0.386
ahwahnee,GR,3000,falling,gcc_mean,2016-08-03,2016-07-19,2016-06-20,2016-08-09,2016-07-23,2016-06-24,2016-07-27,2016-07-13,2016-06-17,0.34477,0.35122,0.36246,0.34068,0.38365
ahwahnee,GR,3000,rising,gcc_90,2016-02-24,2016-03-05,2016-03-17,2016-02-18,2016-03-03,2016-03-14,2016-02-28,2016-03-07,2016-03-18,0.33656,0.34593,0.36252,0.33084,0.39195
ahwahnee,GR,3000,rising,gcc_90,2017-03-05,2017-03-11,2017-03-19,2017-02-19,2017-03-10,2017-03-17,2017-03-06,2017-03-13,2017-03-20,0.34562,0.35488,0.37309,0.33939,0.40521
ahwahnee,GR,3000,rising,gcc_90,2018-03-31,2018-04-07,2018-04-17,2018-03-30,2018-04-06,2018-04-14,2018-04-03,2018-04-09,2018-04-18,0.33708,0.34837,0.36749,0.33146,0.40083
ahwahnee,GR,3000,rising,gcc_75,2016-02-19,2016-03-04,2016-03-17,2016-02-13,2016-03-02,2016-03-14,2016-02-26,2016-03-07,2016-03-18,0.33427,0.34297,0.35992,0.32856,0.38917
ahwahnee,GR,3000,rising,gcc_75,2017-03-05,2017-03-11,2017-03-19,2017-02-18,2017-03-10,2017-03-17,2017-03-06,2017-03-13,2017-03-20,0.34356,0.35216,0.37048,0.33759,0.40198
ahwahnee,GR,3000,rising,gcc_75,2018-03-31,2018-04-06,2018-04-16,2018-03-29,2018-04-05,2018-04-14,2018-04-02,2018-04-08,2018-04-17,0.33537,0.34449,0.36262,0.32942,0.39485
ahwahnee,GR,3000,rising,gcc_50,2016-02-21,2016-03-05,2016-03-17,2016-02-15,2016-03-03,2016-03-15,2016-02-27,2016-03-08,2016-03-19,0.33271,0.34169,0.35755,0.327,0.38716
ahwahnee,GR,3000,rising,gcc_50,2017-03-05,2017-03-11,2017-03-19,2017-02-18,2017-03-10,2017-03-17,2017-03-06,2017-03-13,2017-03-20,0.34056,0.34949,0.36702,0.33485,0.39867
ahwahnee,GR,3000,rising,gcc_50,2018-03-31,2018-04-06,2018-04-16,2018-03-29,2018-04-05,2018-04-14,2018-04-02,2018-04-08,2018-04-18,0.33338,0.34236,0.35928,0.32705,0.39115
ahwahnee,GR,3000,rising,gcc_mean,2016-02-22,2016-03-05,2016-03-18,2016-02-16,2016-03-02,2016-03-15,2016-02-27,2016-03-08,2016-03-20,0.33278,0.34143,0.35686,0.32713,0.38519
ahwahnee,GR,3000,rising,gcc_mean,2017-03-06,2017-03-11,2017-03-19,2017-02-28,2017-03-10,2017-03-17,2017-03-07,2017-03-13,2017-03-20,0.34031,0.3486,0.36513,0.33446,0.39472
ahwahnee,GR,3000,rising,gcc_mean,2018-03-31,2018-04-06,2018-04-17,2018-03-29,2018-04-04,2018-04-15,2018-04-02,2018-04-08,2018-04-18,0.33301,0.3418,0.35907,0.32675,0.38951
ahwahnee,GR,3000,falling,gcc_90,2018-10-13,2018-09-22,2018-08-21,2018-10-16,2018-09-25,2018-08-25,2018-10-09,2018-09-18,2018-08-19,0.33661,0.34707,0.36466,0.33035,0.39788
ahwahnee,GR,3000,falling,gcc_90,2017-09-26,2017-09-07,2017-06-10,2017-09-29,2017-09-11,2017-06-14,2017-09-21,2017-09-02,2017-06-06,0.34119,0.35106,0.36738,0.33542,0.39845
ahwahnee,GR,3000,falling,gcc_90,2016-07-29,2016-07-09,2016-06-18,2016-08-05,2016-07-17,2016-06-22,2016-07-22,2016-07-02,2016-06-16,0.35108,0.35774,0.36958,0.3467,0.39102
ahwahnee,GR,3000,falling,gcc_75,2018-10-13,2018-09-21,2018-08-22,2018-10-17,2018-09-24,2018-08-25,2018-10-09,2018-09-18,2018-08-19,0.33495,0.3451,0.36186,0.32856,0.39491
ahwahnee,GR,3000,falling,gcc_75,2017-09-28,2017-09-11,2017-06-14,2017-09-30,2017-09-16,2017-06-18,2017-09-23,2017-09-06,2017-06-11,0.33747,0.3471,0.36214,0.33236,0.3914
ahwahnee,GR,3000,falling,gcc_75,2016-07-30,2016-07-11,2016-06-18,2016-08-05,2016-07-18,2016-06-22,2016-07-23,2016-07-04,2016-06-16,0.34936,0.35603,0.36754,0.34524,0.38845
ahwahnee,GR,3000,falling,gcc_50,2018-10-10,2018-09-20,2018-08-20,2018-10-12,2018-09-23,2018-08-24,2018-10-05,2018-09-17,2018-08-18,0.33439,0.34371,0.35977,0.32884,0.38987
ahwahnee,GR,3000,falling,gcc_50,2017-09-26,2017-09-09,2017-06-12,2017-09-29,2017-09-13,2017-06-15,2017-09-21,2017-09-04,2017-06-09,0.33611,0.34514,0.36018,0.33082,0.38866
ahwahnee,GR,3000,falling,gcc_50,2016-08-02,2016-07-16,2016-06-19,2016-08-11,2016-07-21,2016-06-23,2016-07-26,2016-07-09,2016-06-17,0.34637,0.35293,0.36407,0.34225,0.3852
ahwahnee,GR,3000,falling,gcc_mean,2018-10-11,2018-09-22,2018-08-19,2018-10-14,2018-09-25,2018-08-24,2018-10-07,2018-09-18,2018-07-29,0.33308,0.34246,0.35852,0.32737,0.38877
ahwahnee,GR,3000,falling,gcc_mean,2017-09-25,2017-09-06,2017-06-13,2017-09-28,2017-09-10,2017-06-18,2017-09-19,2017-09-02,2017-06-10,0.3362,0.34466,0.35915,0.33113,0.386
ahwahnee,GR,3000,falling,gcc_mean,2016-08-04,2016-07-20,2016-06-20,2016-08-12,2016-07-23,2016-06-24,2016-07-28,2016-07-14,2016-06-17,0.34445,0.35081,0.36214,0.34039,0.38366
7 changes: 7 additions & 0 deletions tests/testthat/test_formatting_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,11 @@ test_that("test formatting functions",{
npn_data <- pr_fm_csv(t, phenophase = "spring")
expect_type(npn_data, "list")

# phenocam formatting
phenocam_data <- pr_fm_phenocam(path = system.file(
"extdata",
package = "phenor",
mustWork = TRUE))
expect_type(phenocam_data, "list")

})

0 comments on commit 0bb7e75

Please sign in to comment.