MCPcopy
hub / github.com/hyperopt/hyperopt / recurse

Method recurse

hyperopt/atpe.py:272–286  ·  view source on GitHub ↗
(key, value, root)

Source from the content-addressed store, hash-verified

270 flatParams = {}
271
272 def recurse(key, value, root):
273 result_key = root + "." + key
274 if isinstance(value, str):
275 flatParams[result_key[1:]] = value
276 elif (
277 isinstance(value, float)
278 or isinstance(value, bool)
279 or isinstance(value, int)
280 or numpy.issubdtype(value, numpy.integer)
281 or numpy.issubdtype(value, numpy.floating)
282 ):
283 flatParams[result_key[1:]] = value
284 elif isinstance(value, dict):
285 for subkey, subvalue in value.items():
286 recurse(subkey, subvalue, result_key)
287
288 for key in params.keys():
289 value = params[key]

Callers

nothing calls this directly

Calls 1

itemsMethod · 0.80

Tested by

no test coverage detected