smac.utils.numpyencoder

Classes

NumpyEncoder(*[, skipkeys, ensure_ascii, ...])

Custom encoder for numpy data types

Interfaces

class smac.utils.numpyencoder.NumpyEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: JSONEncoder

Custom encoder for numpy data types

From https://stackoverflow.com/a/61903895

default(obj)[source]

Handle numpy datatypes if present by converting to native python

Parameters:

obj (Any) – Object to serialize

Returns:

Object in native python

Return type:

Any