Skip to content

warnings in tests #32

Description

@MichaelChirico

I ran the test suite with options(warn = 2) and it generated some failures:

── Error (test-bound.R:61:3): bounds are being respected in submodel ───────────────────────────
Error in `max(Q_submodel)`: (converted from warning) no non-missing arguments to max; returning -Inf
Backtrace:
    ▆
 1. └─testthat::expect_lte(max(Q_submodel), 1 - Q_bound_level) at test-bound.R:61:2
 2.   └─testthat::quasi_label(enquo(object), label, arg = "object")
── Error (test-marginal_structural.R:171:1): (code run outside of `test_that()`) ───────────────────────────
Error in `learner$predict_fold(learner_task, fold_number)`: (converted from warning) Lrnr_density_semiparametric_NULL_NULL is not cv-aware: self$predict_fold reverts to self$predict
Backtrace:
     ▆
  1. └─R6 fit_tmle3(tmle_task, targeted_likelihood, msm, updater) at test-marginal_structural.R:171:0
  2.   └─tmle3 initialize(...)
  3.     └─private$.tmle_fit(max_it)
  4.       └─self$updater$update(self$likelihood, self$tmle_task)
  5.         └─base::lapply(...)
  6.           └─tmle3 FUN(X[[i]], ...)
  7.             └─tmle_param$estimates(tmle_task, update_fold)
  8.               └─self$clever_covariates(tmle_task, fold_number)
  9.                 └─self$observed_likelihood$get_likelihoods(...)
 10.                   └─self$get_likelihood(tmle_task, nodes[[1]], fold_number)
 11.                     └─self$initial_likelihood$get_likelihood(tmle_task, node, fold_number)
 12.                       └─likelihood_factor$get_likelihood(tmle_task, fold_number)
 13.                         └─self$get_density(tmle_task, fold_number)
 14.                           └─learner$predict_fold(learner_task, fold_number)
── Error (test-stratified_intevention.R:61:1): (code run outside of `test_that()`) ───────────────────────────
Error in `ED * private$.targeted_components`: (converted from warning) longer object length is not a multiple of shorter object length
Backtrace:
    ▆
 1. └─R6 fit_tmle3(tmle_task, targeted_likelihood, tmle_param, updater) at test-stratified_intevention.R:61:0
 2.   └─tmle3 initialize(...)
 3.     └─private$.tmle_fit(max_it)
 4.       └─self$updater$update(self$likelihood, self$tmle_task)

It might be best to design the tests or re-write the underlying code so as not to produce these warnings.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions