1- # Copyright 2020 PaGMO development team
1+ # Copyright 2020, 2021 PaGMO development team
22#
33# This file is part of the pygmo library.
44#
@@ -41,7 +41,8 @@ def run_basic_tests(self):
4141
4242 # First a few non-algos.
4343 self .assertRaises (NotImplementedError , lambda : algorithm (1 ))
44- self .assertRaises (NotImplementedError , lambda : algorithm ("hello world" ))
44+ self .assertRaises (NotImplementedError ,
45+ lambda : algorithm ("hello world" ))
4546 self .assertRaises (NotImplementedError , lambda : algorithm ([]))
4647 self .assertRaises (TypeError , lambda : algorithm (int ))
4748 # Some algorithms missing methods, wrong arity, etc.
@@ -549,7 +550,6 @@ def run_scipy_wrapper_tests(self):
549550 scp .get_name ()
550551 scp .set_verbosity (0 )
551552
552-
553553 # testing constrained problem on incompatible methods
554554 prob = problem (luksan_vlcek1 (10 ))
555555 pop = population (prob = prob , size = 1 , seed = 0 )
@@ -576,7 +576,8 @@ def run_scipy_wrapper_tests(self):
576576 # testing invalid selection policy
577577 prob = problem (luksan_vlcek1 (10 ))
578578 pop = population (prob = prob , size = 10 , seed = 0 )
579- scp = algorithm (scipy_optimize (selection = s_policy (select_best (rate = 2 ))))
579+ scp = algorithm (scipy_optimize (
580+ selection = s_policy (select_best (rate = 2 ))))
580581 self .assertRaises (ValueError , lambda : scp .evolve (pop ))
581582
582583 # testing callback
@@ -590,7 +591,7 @@ def increment(self, *args, **kwargs):
590591 prob = problem (luksan_vlcek1 (10 ))
591592 pop = population (prob = prob , size = 10 , seed = 0 )
592593 counter = callback_counter ()
593- scp = algorithm (scipy_optimize (callback = counter .increment ))
594+ scp = algorithm (scipy_optimize (callback = counter .increment ))
594595 scp .evolve (pop )
595596 self .assertTrue (counter .value > 0 )
596597
@@ -620,7 +621,8 @@ def increment(self, *args, **kwargs):
620621
621622 # testing hessian wrapper generator
622623 prob = problem (rastrigin (10 ))
623- f = scipy_optimize ._fitness_wrapper (prob )._generate_hessian_sparsity_wrapper (0 )
624+ f = scipy_optimize ._fitness_wrapper (
625+ prob )._generate_hessian_sparsity_wrapper (0 )
624626 hessian = f (array ([0 ] * prob .get_nx ()))
625627 self .assertEqual (len (hessian ), prob .get_nx ())
626628 self .assertEqual (len (hessian [0 ]), prob .get_nx ())
0 commit comments