python-adaptive / adaptive

:chart_with_upwards_trend: Adaptive: parallel active learning of mathematical functions
http://adaptive.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.16k stars 60 forks source link

Create API for just signle process (No pickle) #442

Closed lsyxiaopang closed 1 year ago

lsyxiaopang commented 1 year ago

I am trying to combine adaptive and mph (a python interface to interact with COMSOL) together, but I've found that when I try to make a runner, it will tell me TypeError: cannot pickle '_jpype._JField' object

I only need one process (because mph only supports it), so I think pickle may not needed. Is there any method that can avoid pickle?

Thank you

basnijholt commented 1 year ago

Try https://adaptive.readthedocs.io/en/latest/reference/adaptive.runner.extras.html#adaptive.runner.simple

Also, could you share your code (i.e., what have you tried exactly?)

lsyxiaopang commented 1 year ago

Try https://adaptive.readthedocs.io/en/latest/reference/adaptive.runner.extras.html#adaptive.runner.simple

Also, could you share your code (i.e., what have you tried exactly?)

Thank you, it works! What a shame that I didn't fully read the document