Skip to content

Commit

Permalink
Temporarily dissable custom_eqn (#29).
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolepore committed Mar 22, 2019
1 parent 62838e6 commit d4206c4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
17 changes: 12 additions & 5 deletions R/allo_find.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,24 @@ allo_find_memoised <- memoise::memoise(allo_find_impl)
#' dbh_unit = "cm",
#' bms_unit = "g",
#' dbh_min_mm = 0,
#' dbh_max_mm = Inf
#' dbh_max_mm = Inf,
#' is_generic = FALSE
#' )
#'
#' class(as_eqn(your_equations))
#'
#' allo_find(census_species, custom_eqn = as_eqn(your_equations))
#'
#' census_species %>%
#' allo_find(custom_eqn = as_eqn(your_equations))
#' # FIXME: https://github.com/forestgeo/fgeo.biomass/issues/29
#' try(allo_find(census_species, custom_eqn = as_eqn(your_equations)))
#' @family constructors
allo_find <- function(data, custom_eqn = NULL) {
if (!is.null(custom_eqn)) {
warn(glue("
Ignoring `custom_equaiton`.
See https://github.com/forestgeo/fgeo.biomass/issues/29
"))
}
custom_eqn <- NULL

inform("Assuming `dbh` in [mm] (required to find dbh-specific equations).")
warn_odd_dbh(data$dbh)
allo_find_memoised(data, custom_eqn = custom_eqn)
Expand Down
1 change: 1 addition & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
prefer_false <- function(x) {
stopifnot(is.logical(x))

if (all(x[!is.na(x)])) {
x
} else {
Expand Down
9 changes: 4 additions & 5 deletions man/allo_find.Rd

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

1 change: 1 addition & 0 deletions tests/testthat/test-allo_find.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ test_that("allo_find errs if custom_eqn is not created with as_eqn", {
anatomic_relevance = c("total aboveground biomass")
)

skip("Ignoring custom_eqn see #29")
expect_error(
suppressWarnings(allo_find(census_species, custom_eqn = your_equations)),
"must be of class 'eqn'"
Expand Down

0 comments on commit d4206c4

Please sign in to comment.