Skip to content

Sampler1DRfun gives wrong result for $sample(0) #338

@mb706

Description

@mb706

$sample(0) should return an empty design, but Sampler1DRfun returns a design with one NA-valued row:

Sampler1DRfun$new(param = ParamDbl$new("x", 0, 10), rfun = function(n) numeric(0))$sample(0)
#> <Design> with 1 rows:
#>     x
#> 1: NA

Expected is what other samplers do:

Sampler1DUnif$new(param = ParamDbl$new("x", 0, 10))$sample(0)
#> <Design> with 0 rows:
#> Empty data.table (0 rows and 1 cols): x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions