MCPcopy
hub / github.com/hyperopt/hyperopt / safe_int_cast

Function safe_int_cast

hyperopt/rdists.py:268–273  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

266
267
268def safe_int_cast(obj):
269 if isinstance(obj, np.ndarray):
270 return obj.astype("int")
271 if isinstance(obj, list):
272 return [int(i) for i in obj]
273 return int(obj)
274
275
276# -- non-empty last line for flake8

Callers 8

__init__Method · 0.85
rvsMethod · 0.85
__init__Method · 0.85
rvsMethod · 0.85
in_domainMethod · 0.85
rvsMethod · 0.85
in_domainMethod · 0.85
rvsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected