Skip to content

Commit 8a98bb1

Browse files
committed
Avoid noisy JSON seralization warning for callables (e.g. numpy ufuncs)
1 parent 4bbe6be commit 8a98bb1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: reporting.py

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ def to_json_serializable(o):
3333
return tuple(to_json_serializable(i) for i in o)
3434
if isinstance(o, list):
3535
return [to_json_serializable(i) for i in o]
36+
if callable(o):
37+
return repr(o)
3638

3739
# Ensure everything is JSON serializable. If this warning is issued, it
3840
# means the given type needs to be added above if possible.

0 commit comments

Comments
 (0)