Repository navigation
feat: check for missing parameters - #422
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new allow_subset parameter to the ParamSet validation methods (check, test, assert, check_dt, test_dt, assert_dt) that enables checking whether all parameters are present in a configuration. When allow_subset = FALSE, all parameters must be present except for dependent parameters whose dependencies are not satisfied. This provides stricter validation for complete parameter configurations.
Key Changes:
- Added
allow_subsetparameter (defaultTRUEfor backward compatibility) to all validation methods - Implemented logic to verify all parameters are present when
allow_subset = FALSE, with proper handling of dependencies - Added comprehensive test coverage for single and multi-parent dependency scenarios
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| R/ParamSet.R | Implements allow_subset parameter logic in check(), test(), assert(), check_dt(), test_dt(), and assert_dt() methods with dependency satisfaction checking |
| tests/testthat/test_ParamSet.R | Adds comprehensive test cases covering missing parameters, parent parameters, and dependent parameters with satisfied/unsatisfied dependencies |
| man/ParamSet.Rd | Updates documentation for all modified methods to describe the new allow_subset parameter |
| NEWS.md | Documents the new feature in the changelog |
| DESCRIPTION | Updates RoxygenNote version and removes trailing whitespace |
| .lintr | Updates linter configuration (unrelated housekeeping) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| #' If `"none"` (default), no check is performed for the presence of parameters. | ||
| #' If `"all"`, all parameters must be present in `xs`, except for parameters with unsatisfied dependencies. | ||
| #' If `"required"`, required parameters must be present in `xs`, except for parameters with unsatisfied dependencies. | ||
| #' For `"all"` and `"required"`, `TuneToken`s are not allowed to be present in `xs`. |
There was a problem hiding this comment.
I would say (dis)allowing tune tokens is orthogonal to requiring presence, maybe we want to have an extra argument allow_tunetoken (default TRUE)? Also, do we want to forbid InternalTuneToken?
There was a problem hiding this comment.
I mean, for the sake of dependencies in $check_dependencies we are more liberal w/r/t TuneToken. The view there seems to be that if something is a TuneToken, the parameter is present for the sake of being depended on.
There was a problem hiding this comment.
I added allow_token = TRUE
Co-authored-by: mb706 <mb706@users.noreply.github.com>
Co-authored-by: mb706 <mb706@users.noreply.github.com>
Checks for missing parameters. Parameters are only allowed to be missing if their dependencies are unsatisfied.