MCPcopy
hub / github.com/hyperopt/hyperopt / evaluate_async

Method evaluate_async

hyperopt/base.py:919–939  ·  view source on GitHub ↗

this is the first part of async evaluation for ipython parallel engines (see ipy.py) This breaks evaluate into two parts to allow for the apply_async call to only pass the objective function and arguments.

(self, config, ctrl, attach_attachments=True)

Source from the content-addressed store, hash-verified

917 return dict_rval
918
919 def evaluate_async(self, config, ctrl, attach_attachments=True):
920 """
921 this is the first part of async evaluation for ipython parallel engines (see ipy.py)
922
923 This breaks evaluate into two parts to allow for the apply_async call
924 to only pass the objective function and arguments.
925 """
926 memo = self.memo_from_config(config)
927 use_obj_for_literal_in_memo(self.expr, ctrl, Ctrl, memo)
928 if self.pass_expr_memo_ctrl:
929 pyll_rval = self.fn(expr=self.expr, memo=memo, ctrl=ctrl)
930 else:
931 # -- the "work" of evaluating `config` can be written
932 # either into the pyll part (self.expr)
933 # or the normal Python part (self.fn)
934 pyll_rval = pyll.rec_eval(
935 self.expr,
936 memo=memo,
937 print_node_on_error=self.rec_eval_print_node_on_error,
938 )
939 return (self.fn, pyll_rval)
940
941 def evaluate_async2(self, rval, ctrl, attach_attachments=True):
942 """

Callers 1

call_domainFunction · 0.80

Calls 3

memo_from_configMethod · 0.95
fnMethod · 0.80

Tested by

no test coverage detected