Skip to content

Commit

Permalink
evaluate runs through properly using existing evaluation methods
Browse files Browse the repository at this point in the history
nothing saved, etc, but calculations can run and reproduce as existing
  • Loading branch information
juniperlsimonis committed Apr 21, 2022
1 parent eb3ba7a commit 43801c8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: portalcasting
Title: Functions Used in Predicting Portal Rodent Dynamics
Version: 0.36.0
Version: 0.37.0
Authors@R: c(
person(c("Juniper", "L."), "Simonis",
email = "[email protected]", role = c("aut", "cre"),
Expand Down
16 changes: 9 additions & 7 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

Version numbers follow [Semantic Versioning](https://semver.org/).

# [portalcasting 0.37.0](https://github.com/weecology/portalcasting/releases/tag/v0.37.0)
*2022-04-21*

### Building out evaluation pipeline
* starting with what is already occurring, but formalizing as such as part of an `evaluate_casts` and `evaluate_cast` pair of functions
* `evaluate_casts` function now works automatically to evaluate all the casts using `evaluate_cast`, generating the error table as it does when being used, but nothing is saved out or updated.
* there is also no filter on evaluated casts by deafult, so the output from the forecasts without observations to evaluate is a table with a single row with NaN, and then they get wrapped up into the list.
* no errors, just noteworthy

# [portalcasting 0.36.0](https://github.com/weecology/portalcasting/releases/tag/v0.36.0)
*2022-04-08*

Expand All @@ -10,13 +19,6 @@ Version numbers follow [Semantic Versioning](https://semver.org/).
* No more `most_abundant_species` function, as we're not using it on the website.


# portalcasting 0.36.0
*In Progress*

### Building out evaluation pipeline
* starting with what is already occurring, but formalizing as such


# [portalcasting 0.35.0](https://github.com/weecology/portalcasting/releases/tag/v0.35.0)
*2022-04-07*

Expand Down
22 changes: 10 additions & 12 deletions R/evaluate.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#'
#' @param verbose \code{logical} indicator of whether or not to print out all of the information (and thus just the tidy messages).
#'
#' @return \code{NULL}, \code{\link[base]{invisible}}-ly.
#' @return A \code{data.frame}, or \code{list} of \code{data.frame}s.
#'
#' @name evaluate forecasts
#'
Expand Down Expand Up @@ -41,17 +41,19 @@ evaluate_casts <- function (main = ".",

}

out <- named_null_list(element_names = cast_ids)

for (i in 1:ncast_ids) {

evaluate_cast(main = main,
settings = settings,
cast_id = cast_ids[i],
quiet = quiet,
verbose = verbose)
out[[i]] <- evaluate_cast(main = main,
settings = settings,
cast_id = cast_ids[i],
quiet = quiet,
verbose = verbose)

}

invisible()
out

}

Expand Down Expand Up @@ -96,11 +98,7 @@ evaluate_cast <- function (main = ".",
cast_tab <- add_covered_to_cast_tab(main = main,
settings = settings,
cast_tab = cast_tab)
cast_err <- measure_cast_level_error(cast_tab = cast_tab)



invisible()
measure_cast_level_error(cast_tab = cast_tab)

}

Expand Down
2 changes: 1 addition & 1 deletion man/evaluate-forecasts.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion tests/testthat/test-22-evaluate.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ main <- "./testing"

test_that(desc = "evaluate_casts evaluates casts", {

expect_null(evaluate_casts(main = main))
expect_is(evaluate_casts(main = main, cast_ids = 1:2), "list")

})


test_that(desc = "evaluate_cast evaluates cast", {

expect_null(evaluate_cast(main = main))
expect_is(evaluate_cast(main = main, cast_id = 1), "data.frame")

})

0 comments on commit 43801c8

Please sign in to comment.