ParamHelpers icon indicating copy to clipboard operation
ParamHelpers copied to clipboard

order of named parameters matters in isFeasible

Open maierhofert opened this issue 7 years ago • 2 comments

The order of the parameters in par and x makes a difference. I think it would be nice, if the parameter values and the parameters set would be matched by name. See the minimal example:

# minimal example for isFeasible
par.set = makeParamSet(
  makeIntegerParam(id = "int", default = 1L),
  makeLogicalParam(id = "logic", default = TRUE)
)

# this works
par.list = list(int = 2L, logic = TRUE)
isFeasible(par.set, par.list)

# this does not work, but I think it should
par.list2 = list(logic = TRUE, int = 2L)
isFeasible(par.set, par.list2)

maierhofert avatar Mar 28 '17 17:03 maierhofert

i guess you are correct. this is also not documented properly.

but i am currently on holiday :) so you might have to wait a bit

berndbischl avatar Mar 29 '17 12:03 berndbischl

Thank you. There is an easy work-around. Please take your time and don´t fix it while you are on holiday :-)

maierhofert avatar Mar 30 '17 16:03 maierhofert