-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Exclude draws #336
Exclude draws #336
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #336 +/- ##
==========================================
+ Coverage 95.00% 95.15% +0.15%
==========================================
Files 47 47
Lines 3744 3757 +13
==========================================
+ Hits 3557 3575 +18
+ Misses 187 182 -5 ☔ View full report in Codecov by Sentry. |
This is how benchmark results would change (along with a 95% confidence interval in relative change) if e84ad9d is merged into master:
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 15aaa65 is merged into master:
|
I tried to change as little code as necessary to implement this. But I think this is now ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this. I have left a few rather small comments I think
#' iterations, or draws be allowed? If `TRUE` (the default) only | ||
#' unique chains, iterations, and draws are selected regardless of | ||
#' how often they appear in the respective selecting arguments. | ||
#' @param exclude (logical) Should the selected subset be excluded? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not just selection of draws but of variables etc. too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
R/subset_draws.R
Outdated
@@ -55,6 +61,22 @@ subset_draws.draws_matrix <- function(x, variable = NULL, iteration = NULL, | |||
iteration <- check_iteration_ids(iteration, x, unique = unique) | |||
chain <- check_chain_ids(chain, x, unique = unique) | |||
draw <- check_draw_ids(draw, x, unique = unique) | |||
|
|||
if (exclude) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please input check exclude via as_one_logical
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Keep forgetting to do this. I now added input checking into the check_* functions, as is done with the the other arguments regex
and unique
. This does mean that the inputs are not checked if all draw
, iteration
, variable
, chain
are NULL though
R/subset_draws.R
Outdated
@@ -55,6 +61,22 @@ subset_draws.draws_matrix <- function(x, variable = NULL, iteration = NULL, | |||
iteration <- check_iteration_ids(iteration, x, unique = unique) | |||
chain <- check_chain_ids(chain, x, unique = unique) | |||
draw <- check_draw_ids(draw, x, unique = unique) | |||
|
|||
if (exclude) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given that this code needs to be repeated for every draws format? Should we perhaps have exclude handled inside check_existing_variables, check_iteration_ids etc? I think this would be cleaner actually
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I changed this
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 03e88ac is merged into master:
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if e055c0a is merged into master:
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if aafaf7d is merged into master:
|
@paul-buerkner I think I addressed your comments now, also added more tests |
Perfect. Thank you! |
Summary
Adds an
exclude
option tosubset_draws
that will remove the matched draws. Addresses #333TODO:
TestsCopyright and Licensing
By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the following licenses: