Skip to content

Commit

Permalink
bug fix for pints optimiser
Browse files Browse the repository at this point in the history
pints doesn't like popSize=None
pints-team/pints#1690
  • Loading branch information
mjowen committed Nov 14, 2024
1 parent 333659a commit f869e99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ionbench/optimisers/pints_optimisers/cmaes_pints.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def run(bm, x0=None, popSize=None, maxIter=1000, debug=False):
"""
model, opt = classes_pints.pints_setup(bm, x0, pints.CMAES, maxIter, debug)
opt.optimiser().set_population_size(popSize)
if popSize is not None:
opt.optimiser().set_population_size(popSize)
x, f = opt.run()
if opt.iterations() >= maxIter:
model.bm.set_max_iter_flag()
Expand Down

0 comments on commit f869e99

Please sign in to comment.