Skip to content

Commit

Permalink
Merge pull request #26 from mb706/warnfix
Browse files Browse the repository at this point in the history
handle error -> warning conversion correctly
  • Loading branch information
mb706 authored Jul 30, 2024
2 parents f7ab87b + 475f3d2 commit df43bae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Suggests:
LazyData: yes
Roxygen: list(markdown = TRUE, r6 = FALSE)
ByteCompile: yes
Version: 0.5.1-9000
Version: 0.5.1-2
RoxygenNote: 7.3.1
Collate:
'utils.R'
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# mlrintermbo 0.5.1-2
- minor bugfix: converting errors to warnings did not work when inside `try()`.

# mlrintermbo 0.5.1-1
- compatibility with upcoming bbotk release

Expand Down
2 changes: 1 addition & 1 deletion R/optimize.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ See https://github.com/mlr-org/mlrMBO/issues/474")
TRUE
}, error = function(e) {
if (self$on.surrogate.error == "stop") stop(e)
if (self$on.surrogate.error == "warn") warning(e)
if (self$on.surrogate.error == "warn") warning(warningCondition(conditionMessage(e), call = conditionCall(e)))
if (still.needs.proposition) {
instance$eval_batch(generate_design_lhs(instance$search_space, 1)$data) # evaluate a random point
FALSE
Expand Down

0 comments on commit df43bae

Please sign in to comment.