<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 9 January 2018 at 13:48, Eric Larson <<a href="mailto:larson.eric.d@gmail.com">larson.eric.d@gmail.com</a>> wrote:<br>> If you can use `__iter__` instead of `__next__` in your DifferentialEvolutionSolver class I think you can avoid this problem with something along the lines of:<br>><br>> class DifferentialEvolutionSolver(object):<br>> ...<br>> def __iter__(self):<br>> with Parallel(...) ...:<br>> for it in ...:<br>> yield it<br></blockquote><div><br></div><div>That seems Pythonic, I'll look into that in more detail. One hurdle might be when the two approaches are mixed, starting off with a generator, uses the solver method, etc.<br></div></div>
</div></div>