Communication¶
-
class
optunity.communication.EvalManager(max_vectorized=100, replacements={})[source]¶ Bases:
objectConstructs an EvalManager object.
Parameters: - max_vectorized (int) – the maximum size of a vector evaluation larger vectorizations will be chunked
- replacements (dict) – a mapping of original:replacement keyword names
-
cv¶
-
max_vectorized¶
-
pmap(f, *args)[source]¶ Performs vector evaluations through pipes.
Parameters: - f (callable) – the objective function (piped_function_eval)
- args (iterables) – function arguments
The vector evaluation is sent in chunks of size self.max_vectorized.
-
processed_semaphore¶
-
queue¶
-
queue_lock¶
-
replacements¶ Keys that must be replaced: keys are current values, values are what must be sent through the pipe.
-
semaphore¶
-
vectorized¶
-
optunity.communication.json_decode(data)[source]¶ Decodes given JSON string and returns its data.
>>> orig = {1: 2, 'a': [1,2]} >>> data = json_decode(json_encode(orig)) >>> data[str(1)] 2 >>> data['a'] [1, 2]