bedapub / designit

Blocking and randomization for experimental design
https://bedapub.github.io/designit/
Other
7 stars 1 forks source link

read-only BatchContainer and trace as tibble #22

Closed idavydov closed 1 year ago

idavydov commented 1 year ago

here I implement proposed changes, most importantly:

Multi-plate optimization seems to work fine.

I did make sure that the following vignettes are compiling successfully:

I didn't update tests yet, I would like to hear your feedback first (new API, function naming & so on).

Could you please take a look and let me know if the new API looks good to you? Maybe you could also check if it works in practice for you. Once the API approved, I can start updating other vignettes, tests and so on.

More specifically, what do you think about:

Here's a small example:

bc <- BatchContainer$new(
  dimensions = list("batch" = 3, "location" = 11),
) %>%
  assign_random(subject_data)
bc <- optimize_design(
  bc,
  scoring = list(
    group = osat_score_generator(
      batch_vars = "batch",
      feature_vars = "Group"
    ),
    sex = osat_score_generator(
      batch_vars = "batch",
      feature_vars = "Sex"
    )
  ),
  n_shuffle = 1,
  acceptance_func =
    ~ accept_leftmost_improvement(..., tolerance = 0.01),
  max_iter = 150,
  quiet = TRUE
)
bc$plot_trace(include_aggregated = TRUE)

closes #17, closes #19

idavydov commented 1 year ago

updated all the vignettes (including cached) and all the tests pass now. should be ready to merge, unless some problems are discovered. @ingitwetrust @banfai @julianesiebourg