Skip to content

Commit 8ec126e

Browse files
shuds13jlnav
authored andcommitted
Format aposmm
1 parent d1e7e17 commit 8ec126e

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

‎libensemble/gen_classes/aposmm.py‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,10 @@ def suggest_numpy(self, num_points: int = 0) -> npt.NDArray:
401401
if not self._told_initial_sample:
402402
if not self._initial_sample_generated:
403403
total = self._user_specs["initial_sample_size"]
404-
self._add_k_sample_points(total, self._user_specs, self.persis_info, self._n, [], self.local_H, self._sim_id_to_child_inds)
404+
self._add_k_sample_points(
405+
total, self._user_specs, self.persis_info,
406+
self._n, [], self.local_H, self._sim_id_to_child_inds,
407+
)
405408
self._initial_sample_generated = True
406409
self._initial_suggest_idx = 0
407410

@@ -443,7 +446,9 @@ def suggest_numpy(self, num_points: int = 0) -> npt.NDArray:
443446
if isinstance(x_new, ConvergedMsg):
444447
x_opt = x_new.x
445448
opt_flag = x_new.opt_flag
446-
opt_ind = self._update_history_optimal(x_opt, opt_flag, self.local_H, self._run_order[child_idx])
449+
opt_ind = self._update_history_optimal(
450+
x_opt, opt_flag, self.local_H, self._run_order[child_idx],
451+
)
447452
new_opt_inds.append(opt_ind)
448453
self._local_opters.pop(child_idx)
449454
self._ended_runs.append(child_idx)
@@ -459,7 +464,9 @@ def suggest_numpy(self, num_points: int = 0) -> npt.NDArray:
459464
self._sim_id_to_child_inds[sid] = (child_idx,)
460465

461466
# Decide where to start new local optimization runs
462-
starting_inds = self._decide_where_to_start(self.local_H, self._n, self._n_s, self._rk_const, self._ld, self._mu, self._nu)
467+
starting_inds = self._decide_where_to_start(
468+
self.local_H, self._n, self._n_s, self._rk_const, self._ld, self._mu, self._nu,
469+
)
463470

464471
for ind in starting_inds:
465472
if len([p for p in self._local_opters.values() if p.is_running]) < self._max_active_runs:
@@ -491,7 +498,10 @@ def suggest_numpy(self, num_points: int = 0) -> npt.NDArray:
491498
num_samples = self._n_r - len(new_inds)
492499

493500
if num_samples > 0:
494-
self._add_k_sample_points(num_samples, self._user_specs, self.persis_info, self._n, [], self.local_H, self._sim_id_to_child_inds)
501+
self._add_k_sample_points(
502+
num_samples, self._user_specs, self.persis_info,
503+
self._n, [], self.local_H, self._sim_id_to_child_inds,
504+
)
495505
new_inds = new_inds + list(range(len(self.local_H) - num_samples, len(self.local_H)))
496506

497507
all_inds = new_inds + new_opt_inds

0 commit comments

Comments
 (0)