Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mb706 opened this issue Feb 28, 2021 · 0 comments
Closed

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

mb706 opened this issue Feb 28, 2021 · 0 comments

Comments

@mb706
Copy link
Contributor

mb706 commented Feb 28, 2021

$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
@mllg mllg closed this as completed in 618aa6d Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant