9 Jan
2018
9 Jan
'18
4:22 a.m.
On 9 January 2018 at 13:48, Eric Larson <larson.eric.d@gmail.com> wrote:
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:
class DifferentialEvolutionSolver(object): ... def __iter__(self): with Parallel(...) ...: for it in ...: yield it
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.