Skip to content

Commit 094718f

Browse files
committed
add question about lambdas
1 parent 030ee6e commit 094718f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

docs/source/faq.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ How do I get a `~adaptiveLearner2D`\'s data on a grid?
2525
Use ``learner.interpolated_on_grid()`` optionally with a argument ``n`` to specify the the amount of points in ``x`` and ``y``.
2626

2727

28+
Why can I not use a ``lambda`` function?
29+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30+
31+
The functions evaluations are done on an executor.
32+
Therefore, the ``function`` needs to be serialized (pickled) and send to the executor, ``lambda``\s cannot be pickled.
33+
Instead you can probably use ``functools.partial`` to accomplish what you want to do.
34+
35+
2836
I get "``concurrent.futures.process.BrokenProcessPool``: A process in the process pool was terminated abruptly while the future was running or pending." what does it mean?
2937
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3038

0 commit comments

Comments
 (0)