Skip to content

Commit

Permalink
catch invalid prepend_points (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpapp authored Sep 7, 2022
1 parent e708a98 commit 87d60f8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MultistartOptimization"
uuid = "3933049c-43be-478e-a8bb-6e0f7fd53575"
authors = ["Tamas K. Papp <[email protected]>"]
version = "0.2.0"
version = "0.2.1"

[deps]
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
Expand Down
4 changes: 3 additions & 1 deletion src/tiktak.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ function multistart_minimization(multistart_method::TikTak, local_method,
use_threads = true,
prepend_points = Vector{Vector{Float64}}())
@unpack quasirandom_N, initial_N, θ_min, θ_max, θ_pow = multistart_method
@unpack objective = minimization_problem
@unpack objective, lower_bounds, upper_bounds = minimization_problem
@argcheck(all(x -> all(lower_bounds .≤ x .≤ upper_bounds), prepend_points),
"prepend_points outside problem bounds")
quasirandom_points = sobol_starting_points(minimization_problem, quasirandom_N,
use_threads)
initial_points = _keep_lowest(quasirandom_points, initial_N)
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,5 @@ end
r1 = multistart_minimization(MM, LM, P; use_threads = false, prepend_points = [z1])
@test r1.value == vz1
@test r1.location == z1
@test_throws ArgumentError multistart_minimization(MM, LM, P; use_threads = false, prepend_points = [lb .- 2])
end

2 comments on commit 87d60f8

@tpapp
Copy link
Owner Author

@tpapp tpapp commented on 87d60f8 Sep 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/67847

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.1 -m "<description of version>" 87d60f840ea433d229b8a1994d7bd33bbb25fb3f
git push origin v0.2.1

Please sign in to comment.