Skip to content

Props cannot be NumPy floats #48

@neelnanda-io

Description

@neelnanda-io

convert_props({"a": np.float32(1.)}) gives the error TypeError: Object of type float32 is not JSON serializable

This is an issue if you take eg max_value=array.max() for some numpy array, as this returns a np.float32 object not float. This can likely be fixed with a quick hack to cast types like this to a float. I may add this myself at some point.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions