markmfredrickson / optmatch

Functions for optimal matching in R
https://markmfredrickson.github.io/optmatch
Other
47 stars 14 forks source link

test/warning inconsistency re max_problem_size option #125

Closed benthestatistician closed 7 years ago

benthestatistician commented 7 years ago

In R/fmatch.R, definition of internal functionfmatch, we have

 if (problem.size > getMaxProblemSize()) {
      stop(paste(<...>,
              "Set 'options(\"optmatch_max_problem_size\" = Inf)' to disable this check."),
           call. = FALSE)

Meanwhile, tests/testthat/test.feasible.R seems to assume that infinite matched problem sizes won't work.

# the options('optmatch_max_problem_size') should exist and be less than 1e100
  expect_true(options("optmatch_max_problem_size")[[1]] < 1e100)

which one is it?

benthestatistician commented 7 years ago

Maybe the test is just encoding an expectation that the package will ship with "optmatch_max_problem_size" set to a finite value, leaving it to the user to re-set it to Inf if he so desires. On this assumption, closing.